[RFC] Add first-class support for store enhancers to createStore() API

TL;DR
- const createStoreWithMiddleware = applyMiddleware(thunk, logger)(createStore)
- const store = createStoreWithMiddleware(rootReducer, initialState)
+ const store = createStore(
+   rootReducer,
+   initialState,
+   applyMiddleware(thunk, logger)
+ )

Fixing the Store Enhancer API
It’s often said that creating a store with enhancers like applyMiddleware() or DevTools.instrument() is weird because it just looks outlandish in JavaScript to compose functions in such a savage way:
// bad
const createStoreWithMiddleware = applyMiddleware(thunk, logger)(createStore)
const store = createStoreWithMiddleware(reducer, initialState)

// and even worse
const finalCreateStore = compose(
  applyMiddleware(thunk, logger),
  DevTools.instrument()
)(createStore)
const store = finalCreateStore(reducer, initialState)

Here, we propose to integrate the idea of store enhancers into the createStore() API itself. This would keep the concept of enhancers and their API exactly the same but will simplify applying them in real projects. This is also not a breaking change because we didn’t support any additional arguments to createStore() previously.
// not bad
const store = createStore(
  reducer,
  initialState,
  applyMiddleware(thunk, logger)
)

// not bad either
const store = createStore(
  reducer,
  initialState,
  applyMiddleware(thunk, logger),
  DevTools.instrument()
)

It has often been suggested that we do something about this uneasiness but unfortunately I don’t think there was ever any specific proposal that dealt with store enhancers correctly. Most proposals I saw were focused on the middleware which is just one kind of a store enhancer. I think that this proposal should satisfy the needs of the community in terms of a simple API without compromising on the power of store enhancers.
What do you think?

+1

This might be a stupid question, but how would I skip providing initial state. would this work?
createStore(
  reducer,
  undefined, // no initial state
  applyMiddleware(thunk, batchedUpdates, NewRelicErrorLoggingMiddleware)
)

@tedpennings According to the source, you'd just leave out the initialState, e.g.
createStore(
  reducer,
  applyMiddleware(thunk, batchedUpdates, NewRelicErrorLoggingMiddleware)
)

Nice, I like it.

awesome, thanks @holic -- I like this a lot :bowtie:

Yes, we can detect you didn't pass the initial state because valid state can never be a function.

:+1: I still have to track down some weird mis-config that is making middleware no-op, 99% it's something in my store stuff. Just my opinion but I find too many positional args looks confusing, they all end up looking like middleware or something.

Just my opinion but I find too many positional args looks confusing, they all end up looking like middleware or something.

 I tried a few options with arrays but neither felt satisfactory.

I like that this proposal allows us to drop compose() from the public API is it is no longer necessary for using the library. Those who want it elsewhere in the code can always use the lodash version.

:-1: from me.
What's wrong with encouraging good FP concepts?  Also, the way that reads is like the reducer and initial state are part of the "stack" of composed store enhancers. It's hard to tell when the configuration ends and the store enhancers begin.
What about a singular enhancer (much like a singular reducer), which can use compose to stack them:
const enhancers = compose(
  applyMiddleware(thunk, logger),
  DevTools.instrument()
)

const store = createStore(
  reducer,
  initialState,
  enhancers
)

I like that this proposal allows us to drop compose() from the public API

Yeah, I agree with that. It's weird to provide that when someone might want to use Ramda or a homegrown solution. Redux isn't a FP library, it just leverages FP concepts.

 I tried a few options with arrays but neither felt satisfactory.

No clue :D

What's wrong with encouraging good FP concepts?

It's a parenthesis mess. finalCreateStore and createStoreWithMiddleware are incredible awkward to write and explain. In fact this was one of the reasons I still haven't recorded videos on the middleware—I can't find a way to teach them without writing very weird syntax. See also https://hughfdjackson.com/javascript/does-curry-help/ for a similar perspective.
Those who dig FPisms can always look inside or compose things manually but I've found that usually people turn off their hands at the sight of this blurb and copy-paste it across projects without understanding how it works. Providing a nicer top-level API is the first step towards helping them understand what's happening.

Also, the way that reads is like the reducer and initial state are part of the "stack" of composed store enhancers. It's hard to tell when the configuration ends and the store enhancers begin.

I agree with this criticism. Another problem is it makes the flow unobvious. Actions would hit the enhancers first top-down and then proceed to the reducer which would be weird. If you can offer an alternative way of stacking them that would be backwards compatible, wouldn't be awkward, would make it easy to just use applyMiddleware(), as well as combine it with DevTools, would allow to omit initial state, and wouldn't freak out at arrays as state, I'm keen to hear it!

I've found that usually people turn off their hands at the sight of this blurb and copy-paste it across projects without understanding how it works.

This is totally me hahaha. My first impression when I see lots of distinct calls like that is "oh god, this is complicated", even if they're all doing fundamentally similar things.

I'm not a big fan of the variadic function solution. The original solution is good but it does feel clunky. It feels like you should be able to apply middleware at the same time as creating the store. How about an applyMiddleware chain function? Like so:
const store = createStore(reducer, initialState).applyMiddleware(thunk, logger);

Or ExpressJS style (doesn't feel FP enough though):
const store = createStore(reducers, initialState);

store.use(thunk, logger);

//or
store.use(thunk);
store.use(logger);

Just throwing some thoughts out.

It's a parenthesis mess.

Yeah, that's definitely true. This isn't a lisp! :smile:

If you can offer an alternative...

I think my suggestion satisfies this. Single reducer function, single enhancer function. Since we commonly export a root reducer in our examples and in the the real world, we can also export our enhancers the same way. You'd end up with this:
import rootReducer from '../reducers'
import rootEnhancer from './enhancers'

const store = createStore(
  rootReducer,
  initialState,
  rootEnhancer
)

export default const enhancers = compose(
  applyMiddleware(thunk, logger),
  DevTools.instrument()
)

Keeps parity with how you lay out reducers, so it's familiar. And it's backwards compatible, since it's just a new arg on createStore

No, there are very specific reasons why the underlying types have to be exactly as they are now. Store enhancers must be createStore => createStore'. When you use a store enhancer like DevTools it actually creates another store internally and gives you a projection of that store. We can only do that if we wrap createStore itself. We can't let you create a store because by this point it's too late. This is why those fluent APIs and .use() calls don't work here.

@timdorr I kinda like your suggestion. I really wanted to part ways with compose() but maybe this is our fate.

I think this is a good idea; however, I 100% agree with @tj here:

Just my opinion but I find too many positional args looks confusing, they all end up looking like middleware or something. I think variadic is fine if it's all of the same type like applyMiddleware().

I would suggest making third argument an (optional) array of enhancers:
const store = createStore(
   rootReducer,
   initialState,
   [applyMiddleware(thunk, logger), DevTools.instrument(), ...etc]
 )

So, per @timdorr:
// not bad
const store = createStore(
  reducer,
  initialState,
  applyMiddleware(thunk, logger)
)

// not bad either
const store = createStore(
  reducer,
  initialState,
  compose(
    applyMiddleware(thunk, logger),
    DevTools.instrument()
  )
)

No variadic stuff, probably more static analysis friendly too. Thoughts?

@gaearon that looks pretty good to me

I would suggest making third argument an (optional) array of enhancers:

I wanted to do this but then watch out:
// I want to allow to omit the initial state
const store = createStore(
   rootReducer,
   [applyMiddleware(thunk, logger), DevTools.instrument(), ...etc]
 )

// Haha good luck telling array initial state from array of enhancers
const store = createStore(
   rootReducer,
   [{ lol: true }, { sad: true }],
   [applyMiddleware(thunk, logger), DevTools.instrument(), ...etc]
 )

@gaearon Hmm didn't think about omitting initialState. So... we would type check the second param to see if it's a function? Eh, I'm not a huge fan of that but idk.

How about a single argument function?
const store = createStore({
  reducer,
  initialState,
  enhancer: applyMiddleware(thunk, logger)
})

And/Or
const store = createStore({
  reducer,
  initialState,
  enhancer: [thunk, logger]
})

why not just make the initial state mandatory? looks gross but at least it's obvious

@tj If we could go back in time I'd be 100% for making the initial state mandatory.

@acdlite what about just in this scenario though?

@BerkeleyTrue second one is kinda nice :+1:  I guess it'd be missing the functional feel though BUT I must say it's awesome to import less stuff for composing and whatnot

why not just make the initial state mandatory? looks gross but at least it's obvious

That’s definitely an option. Still might be easy to forget it during refactoring (especially when you add middleware to a project that didn't use it), and it's hard for us to provide a good error message if you mess it up. Also yeah, undefined holes in function calls feel gross.

@gaearon I don't think it's gross, I think it makes it more clear honestly

Both could be done at once, and since reducer is currently always a function it could be done in a backwards compatible way. If first arg is type function, then old api and warn of deprecation. if type object, new api.

@BerkeleyTrue's object suggestion might be nice that way, enough to probe to treat it as a new api

To be fair composing is not a very common scenario anyway. Most people are content with applyMiddleware and haven't bothered with setting up DevTools so the common case is just one line.

@gaearon I don't think it's gross, I think it makes it more clear honestly

It makes it clear for people who know that but I guarantee you people will file issues saying something doesn't work because they forgot to put it in there when they added middleware to a non-server-rendered project that never used initialState.

IMO the grossness of passing undefined as the initial state is really just exposing the hidden grossness of relying on default parameters + an init action to specify initial state. Alas, probably too late to fix that :D

Btw, for me, passing undefined is gross, I thought we were talking about passing {} as a means of no initial state

Alas, probably too late to fix that :D

This is on loop in my head now: https://www.youtube.com/watch?v=BsKbwR7WXN4

I'm a huge fan of keyword/non-positional args. Love, love, love them! But while it's quick and easy for us in ES2015-land, it's going to be more verbose for our ES5 friends. So, there's a small tradeoff there to be aware of.

@timdorr Haha yeah I know I'm fighting a losing battle but...
Imagine if this were a typed language. You would think the type signature for a Redux reducer is
State -> Action -> State

but if you follow idiomatic Redux it's actually
Maybe State -> Action -> State

@timdorr Huh is it really that much more verbose? I don't see what you mean.

it's going to be more verbose for our ES5 friends

I'm not sure what you mean by this. Can you elaborate?

It's only a slight increase:
const store = createStore({
  reducer: reducer,
  initialState: initialState,
  enhancer: applyMiddleware(thunk, logger)
})

Not earth shattering, but not really fun to program if you're not using ES2015 *shrug*

@BerkeleyTrue @tj
I'd rather avoid the “configuration object” API. We’d have to add checks for typos, support both versions to be backwards compatible, tell people to use the new version for “advanced” behaviors, figure out whether to allow enhancer, enhancers, or both, have to put up with lingo code like enhancers: applyMiddleware(thunk) which seems to introduce cryptic terminology in app code for no gain, and worst of all, we’ll get more feature requests to put stuff into that configuration object :smile: . I think configuration object means we can't figure out what the API does. Better for us to choose the right focus.
(I understand it's very subjective though)

I actually prefer that hahaha, ({foo,bar}) looks meaningless to me, I just see args half the time

And for those in IE8 purgatory (I think. It's been a while since I've done ES3):
var store = createStore({
  "reducer": reducer,
  "initialState": initialState,
  "enhancer": applyMiddleware(thunk, logger)
});

And for those in IE8 purgatory

Pfft, as far as I'm concerned they can go to hell

^ That was a (lame) joke, btw, I'm actually a nice guy

Nah, you only need to quote reserved words like default for IE8.

I’m pretty confident I want to get @timdorr’s version in.
 Still has you using compose() if you want multiple enhancers, but they read much nicer. Leaves us a room to do something more drastic in the future with variadic arguments if we choose to. (Compose result is also enhancer so adding support for multiple enhancers without explicit compose() will be backwards compatible.)
If anybody feels like it, please contribute some tests, docs, and tweak the examples, and make a PR against this PR. Thanks for a great discussion!

@gaearon Wait did we figure out the API for omitting initial state?

Current API in this PR lets you do that because it only allows a single enhancer (which has to be a function). We assume top-level state object is not a function (sounds like a pretty safe assumption).

Hmm that's what I thought.

Definately like @timdorr version, thanks for opening topic up for discussion Dan

I think it makes the most sense to compose the middleware functions outside of createStore and pass the composed functions in. That way createStore handle middleware very much the same way it handles reducers.

This is a sign of a good tradeoff :wink:
With our usage we really don’t want to add churn. Removing small impediments to learning Redux or understanding Redux apps with no breakage cost goes a long way.

@hunterc Definitely. The suggested API accommodates that.

@gaearon Yep. I'm liking that solution. :) By the way, thanks for the great lib!

wanted to do this but then watch out:
// Haha good luck telling array initial state from array of enhancers
const store = createStore(
   rootReducer,
   [{ lol: true }, { sad: true }],
   [applyMiddleware(thunk, logger), DevTools.instrument(), ...etc]
 )

@gaearon But if Redux doesn't accept an array of enhancers, does it mean that we have to use compose() anyway for multiple store enhancers? Which prevents dropping compose() off the public API.
(aside)
Crazy idea:
What happens if it starts to look like this instead?
newStore()
.withReducer(rootReducer)
.withInitialState(initialState)
.withEnhancers([applyMidldleware(thunk, logger), DevTools.instrument()])
.create()

I personally dislike the idea of messing with object keys (specially if they're optional) and chaining. :+1: for @timdorr's solution. Looks classy :tophat:

I'm sure I'm outnumbered here, but I really like the configuration object proposal, with support for both enhancer and enhancers. It may add terminology, but to me it seems more clear and verbose than positional arguments.

re making initial state mandatory: I'm :-1:  on anything that makes initial state mandatory because that seems antagonistic to combineReducers.
I worked on a medium-sized Redux application that shipped in late 2015 that uses the (Maybe State, Action) -> State signature to encapsulate a lot of smaller initial states in reducers zipped together with combineReducers. We have 11 reducers that are combined into the root reducer. Each reducer defines its own initial state in a slightly different shape. Generally, the initial state provides defaults and empty data placeholders that render as a loading state. But the individual reducer state trees vary a bit, so I want to keep that DRY.
If initial state were mandatory, I guess I would create my store by first calling my root reducer with undefined and an empty action (like { type: '@@redux/INIT' }) to make the reducers produce their initial state.   If we make initial state mandatory, I think we need to add a big caveat to combineReducers that it produces a leaky abstraction because there isn't a useful initial state encapsulation.

:thumbsup: to named argument objects, but if the reducer arg is non-optional it should probably be a positional parameter? this is the convention in python, anyway - positional arguments are mandatory, named arguments are optionals.
var store = createStore(reducer, {
  initialState: initialState,
  enhancer: applyMiddleware(thunk, logger)
})

I guess the alternative would be to throw a TypeError if the reducer key isn't found on the params object.

@AprilArcus Unfortunately, that would be impossible to maintain any sort of backwards compatibility. The 2nd arg has always been initialState, which may be an object. So, we're unable to distinguish what that object represents (config or initial state). We would have to make a a very breaking change that would likely cause a lot of upgrade hassles.
I really wish we had kwargs in JS, but that's not the world we live in :smile:

But if Redux doesn't accept an array of enhancers, does it mean that we have to use compose() anyway for multiple store enhancers? Which prevents dropping compose() off the public API.

Right. But the result is still better than what we have now. Removing compose() wasn’t a goal by itself, the goal was to simplify common usage which I believe the current proposal does.
As for the fluent API proposal, I don’t think turning one function into a factory with different intermediate methods is something we want to do. Overall I am not a fan of fluent APIs.

re making initial state mandatory: I'm :-1: on anything that makes initial state mandatory because that seems antagonistic to combineReducers.

No, this is not something we even considered. When we talked about making initial state mandatory we only meant about having to specify undefined as the second argument before getting to the new third argument. I don’t want to do this either and the current proposal works around that. This is not related to how combineReducers() works and we are definitely not touching that part ;-)

Maybe I'm speaking non-sens; But I think Redux doesn't need store enhancers neither compose.
I can understand applyMiddleware composition has clear semantics: action travels a chain of middleware that can intercept/modify or let the action passthrough
But for store enhancers, this is not obvious to me: I mean the idea of a store enhancer is pretty obvious, we wrap a store in an enhanced store which adds some feature. But composing enhancers what's the meaning of that ? Why a store enhancer should receive an enhanced createStore from a previous store enhancer ? put another way, does composing enhancements has a any meaning ?
It feels like store enhancers are different from middlewares. Each store enhancer is (or seems) independent from others so all it needs is the original store and not an already enhanced one.
May be I miss something obvious here, but I think if Redux would provide the actual action to its subscribers as argument (actually subscribers are called without arg), one could achieve what he wants without store enhancers; and even better, he wouldn't have to monkey-patch the store as enhancers actually do (each enhancer has its own dispatch version which has some awkward side-effects as it creates a barrier between multiples dispatch chains of different enhancers)

@yelouafi If an enhancer would only receive the original store, then the last enhancer would "win" and its result would be passed to the middleware. But if you have multiple enhancers they must stack.
A middleware cannot receive the final state after the chain has been run. A store enhancer on the other hand can get a copy of the previous state and then a copy of the next state and for example diff the two (like devtools). Or it can log the dispatch duration. Afaik these cannot be solved with normal middleware because you need to be able to do something before and after the actual dispatch.

Each store enhancer is (or seems) independent from others so all it needs is the original store

Please check out how Redux DevTools is implemented. Consider how to make it work with async middleware. I think you'll see why we came up with the current design. If store was created beforehand, I don't see how either would work.

@johanneslumpe I understand, and I think this a consequence of how store enhancers works actually (monkey-patching). But what about the other solution, if we provide subscribers with the dispatched action as argument; The we could achieve the same thing enhancers can do
myEnhancer(store, options) {

 let lastState = store.getState()

  function process(oldState, newState, action) {
   ...
  }

  store.subscribe(action => {
     const newState = store.getState()
     process(lastState, newState, action)
     lastState = newState
  })

}

The subscriber/enhancer above has all the necessary info to build its logic: old/new state and current action. And this hasn't the drawbacks of the actual enhancers (multiple dispatch chains) Because there is only one store version, so multiple enhancers can also inter-communicate via store.dispatch

Can you make a PR to DevTools repo showing how this would work? I still don't see it because DevTools enhancer needs to wrap the reducer and "lift" both getState() and dispatch().

@gaearon Could make it (when I'll have the time of couse :) ). But couldn't something like this work (i mean the idea, impl. details may vary)?
function instrument(store, options) {

 function liftedAction(action, oldState, newState) { ... }
 function liftedReducer(liftedState, liftedAction) { ... }

 const devToolsStore = createStore(liftedReducer)

  function process(oldState, newState, action) {
    devToolsStore.dispatch(liftedAction(action, oldState, newState))
  }

  store.subscribe(action => {
     const newState = store.getState()
     process(lastState, newState, action)
     lastState = newState
  })

}

The idea of providing actions to subscirbers could also serve other meanings: can build an action rx stream and implement side effect with rx observables; ie it connect Redux to the outside world in a more natural way.

How would you make an existing store magically change its state based on what devToolsStore tells it?

How would you make an existing store magically change its state based on what devToolsStore tells it?

With the above solution. The simplest way I see is to have it builtin into the store api (some resetState method), I don't think this is a pb since it'll only serve for developer tools.

I like the current system because it doesn't require internal methods like setState() which no doubt will be abused. I don't see a big issue with how store enhancers work but I'm happy to consider specific alternatives. We spent some hair pulling figuring out the current API and while I understand things are not perfect, I don't have time to reinvent it from the ground up again. If you have specific proposals I'm happy to consider a joint RFC showing new (specific and verified to run correctly) API for composing "new" store enhancers and how that would solve real problems justifying the churn in the ecosystem that would come out of that.

@gaearon I understand. All what I said was a bit of quick thinking :). Perhaps keeping the actual API and providing the action to subscribers as an alternative way (unless there are issues with that), wiil gives a chance to compare how the 2 models works in real-life

We can implement your "process" proposal as middleware, just like sagas today. Can't we?

The issue in my case is other: I used an enhancer like method to implement runSaga which can run sagas outside the middleware env (server side rendering, code splitting ...). I didn't use compose but the result would be similar : patch dispatch function to get the dispatched action. But it has some drawbacks; as in https://github.com/yelouafi/redux-saga/issues/48

saga called with runSaga can dispatch actions to store and all sagas from middleware will see it, but actions dispatched from middleware sagas can't be taken by saga called with runSaga

Since dispatch of inside (passed to the middleware) is not the same as dispatch outside (the final that the enhancer get); the runSaga can only patch the final dispatch returned by applyMiddleware enhancer; So the intermediate dispatch (passed to redux-saga middleware) is not patched and then runSaga can't intercept those actions
I thought if store.subscribe can guarantee the delivery of each action then it wont be necessary to enhance/patch the store. Maybe there other cases where the store enhancer needs just the actual action, so it won't be necessary to complicate the store setup if they could just use subscribe

I don't yet understand but I feel like I'm close. Can you create a 10 line repo showing the problem?

Here is a jsbin demo.
There are 2 middlewares sagas and 1 saga outside (with runSaga). the outside saga dispatch a RUNSAGA_ACTION and both middleware sagas take it;
Then the 1st middleware saga dispatch a MIDDLEWARE_SAGA action; but only the 2nd middleware saga can take it; the saga outside don't see it;

Demi is empty. Wrong link?

Demi is empty. Wrong link?

didn't understand, pb with the link or with or running the demo; re-tried it and it works for me
http://jsbin.com/gezizu/9/edit?js,console
and gist
https://gist.github.com/yelouafi/baf20b6e7e2685d6f08d

perhaps a lifted reducer like used in devtools will work; Is this the only way a store enhancer can get an action from the store

Maybe JSBin is broken on mobile. I'll check when I'm at desktop. Can you please file a separate issue? I'll be happy to discuss there as seems mostly unrelated to this thread.

Ok, will create an issue. Thanks!

Out in 3.1.0.


Create a new test for RTL2f spec

Current test for RTL2f doesn't test what the spec implies (and was removed):

A test should exist to ensure that resumed is always false when a channel first becomes ATTACHED, it is true when the channel is ATTACHED following a successful connection recovery, and is false when the channel is ATTACHED following a failed connection recovery

┆Issue is synchronized with this Jira Task by Unito

Solved in https://github.com/ably/ably-cocoa/pull/1921


Issue creating new items as collection shown as "read-only" despite correct allowed permissions set

Hi,
first of all thank you for creating this boilerplate! I have set up the application following your documentation on Google Cloud Run.
Despite me having configured all allowed permissions ["get", "find", "count", "update", "insert", "remove"], Wix is now allowing me to create a new item and shows me the collection being "read-only". Updating items I created via a direct connection to the MySQL database works properly. What am I doing wrong here?
On another note I realized that the sandbox and live data displayed in Wix are identical. Is it correct that there is no difference between sandbox and live when using external databases?
Many thanks for your support.

Update: I checked the logs of the application and found I was missing to provide columns "_createdDate", "_updatedDate" and "_owner" in the table. That solved the issue with the insert. However I can still not add fields as the collection remains "read-only". Any ideas?

I am getting same errror

@kkchauhan It's important that you add _id and _owner columns to your table (with NULL value allowed).

Shall I create _createdDate and _updatedDate field too.. Because its still not working for me

Hey, in order to make mysql collections writable please use the following template when creating MySQL tables:
create table your_table(     _id varchar(128) not null primary key,     _owner varchar(128),     _createdDate datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,         _updatedDate datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,     .... )


Vulkan support?

Hey there.
I'm total noob on that subject, but I came across this tweet today and I was wondering if picamera could be more efficient/efficient processing with this?
Thanks 😁
Btw, the repo can be found here: https://github.com/Yours3lf/rpi-vk-driver

It's going to make no difference at all. Almost all the camera image processing is done in dedicated hardware known as the ISP (Image Sensor Pipeline), not on the 3D hardware.
There is the potential to render preview images via GL/GLES/Vulkan, but that's outside the scope of Picamera.

Thanks for the clear answer @6by9!


Thingiverse Driver Not Authenticating

It would seem that the Thingiverse driver is returning with a 502 Server Login Exception error when attempting to get My Likes/Makes/Collections/Things
2020-05-15 18:31:39,936 - WARNING - [MainThread] UM.Logger.warning [128]: API returned with status 502 and body []

Yup. It seems Thingiverse has introduced yet another breaking API change. None of these endpoints work anymore where they were fine a couple of days ago...
Also it seems impossible to get into contact with them and their documentation is horribly outdated. Thinking about dropping Thingiverse from the plugin as it's a giant PITA to maintain.

Likely fixed by https://github.com/ChrisTerBeke/ThingiBrowser/pull/50.


feat: add Scroll Sepolia support

Issue: https://github.com/safe-global/safe-deployments/issues/284
Safe-deployments PR: https://github.com/safe-global/safe-deployments/pull/283

@nick8319 everything looks good but it's necessary rebase this branch and fix the conflicts, let me know when be ready to merge it.

@moisses89 Hi! The branch has been rebased and conflicts were fixed.


AD: Support UserProp linearization

This pull request is NOT ready to be merged.  Test results need to be verified with Nick Johnson and the OpenFAST team.

Development is complete, testing was performed (but not by the developer).  No documentation changes needed other than perhaps to mention inclusion of the active aerodynamic control capability in the linearization scheme
Feature or improvement description
The active aerodynamic control capability (UserProp) is now included in the linearization scheme.
Impacted areas of the software

AeroDyn, FAST_Lin, FAST_Subs: Linearization of AeroDyn.

The code for this pull request seems to have been merged already as part of the TCF branch #537 (with one bug fix later in my UA_shutoff branch #647, corresponding to Greg's https://github.com/OpenFAST/openfast/pull/612/commits/a4801de519ceda3136d61415ed9c5628eb05adc4 commit).

@bjonkman there seem to be some code changes here that haven't been merged yet (at least according to github).  I'll check into this further.


PowerShell snippets should maintain the casing of request body properties.

Describe the bug
Some workloads as Microsoft.PIM.AzureRBA have case sensitive request bodies. To mitigate this, PowerShell snippets should generate $params variable with properties that maintain the casing of the request body from the HTTP snippet. i.e.,
HTTP Request
PATCH https://graph.microsoft.com/v1.0/policies/roleManagementPolicies/DirectoryRole_84841066-274d-4ec0-a5c1-276be684bdd3_200ec19a-09e7-4e7a-9515-cf1ee64b96f9/rules/Expiration_EndUser_Assignment
Content-Type: application/json

{
<EMAIL_ADDRESS>"#microsoft.graph.unifiedRoleManagementPolicyExpirationRule",
    "id": "Expiration_EndUser_Assignment",
    "isExpirationRequired": true,
    "target": {
<EMAIL_ADDRESS>"microsoft.graph.unifiedRoleManagementPolicyRuleTarget",
        "caller": "EndUser",
        "operations": ["All"],
        "level": "Assignment",
        "inheritableSettings": [],
        "enforcedSettings": []
    }
}

Current PS Snippet
$params = @{
<EMAIL_ADDRESS>= "#microsoft.graph.unifiedRoleManagementPolicyExpirationRule"
	Id = "Expiration_EndUser_Assignment"
	IsExpirationRequired = $true
	Target = @{
<EMAIL_ADDRESS>= "microsoft.graph.unifiedRoleManagementPolicyRuleTarget"
		Caller = "EndUser"
		Operations = @("All")
		Level = "Assignment"
		InheritableSettings = @()
		EnforcedSettings = @()
	}
}

Update-MgPolicyRoleManagementPolicyRule -UnifiedRoleManagementPolicyId $unifiedRoleManagementPolicyId -UnifiedRoleManagementPolicyRuleId $unifiedRoleManagementPolicyRuleId -BodyParameter $params

Ideal PS Snippet
$params = @{
<EMAIL_ADDRESS>= "#microsoft.graph.unifiedRoleManagementPolicyExpirationRule"
	id = "Expiration_EndUser_Assignment"
	isExpirationRequired = $true
	target = @{
<EMAIL_ADDRESS>= "microsoft.graph.unifiedRoleManagementPolicyRuleTarget"
		caller = "EndUser"
		operations = @("All")
		level = "Assignment"
		inheritableSettings = @()
		enforcedSettings = @()
	}
}

Update-MgPolicyRoleManagementPolicyRule -UnifiedRoleManagementPolicyId $unifiedRoleManagementPolicyId -UnifiedRoleManagementPolicyRuleId $unifiedRoleManagementPolicyRuleId -BodyParameter $params

Closing as fixed - https://learn.microsoft.com/en-us/graph/api/unifiedrolemanagementpolicyrule-update?view=graph-rest-1.0&tabs=powershell#request.


Web - Profile View - Follower/Following Pop Up

As a part of the https://github.com/bounswe/bounswe2023group8/issues/271, I will be making pop-ups for follower and following.

The task is complete, although it may contain some solutions that resemble those of an orangutan.
I forgot my SSH key passphrase, generated a new one, but couldn't find a way to set it as the default SSH key. (I'm unable to commit, etc.) My IDE, Github Desktop, and everything else still ask for the old SSH key.
I've spent hours trying almost every solution, but I still encounter the same error.

I solved the problem related to the SSH key.


[security] Manage transaction size configurations in Move contracts.

Set transaction size configurations in the system configuration contract and execute them in the genesis transaction.

Retrieve transaction size information from the configuration contract during transaction validation.

The sequencer can modify on-chain transaction size configurations through contract upgrades or by modifying the configuration items in the contract.

NOTE: the configuration of transaction size must be at least 4M.

eval the max tx size @stevenlaw123

We limit the tx size via the max gas amount. so we do not need another tx size config.

Maybe we need a test case to ensure it. @steelgeek091


Export functions and add isByteSequence utility

@evert @mihok @mhum @BeckyPollard we'd like to use this library as a dependancy in our project but we need these minor changes please.
It's useful to be able to, for example, directly serialize an Inner List for the sake of calculating the signature inputs for https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures-11
We'd like to avoid needing to publish our fork if we can, any chance you can publish this soon?

The changes look good, would you mind including a test for isByteSequence ?

@evert

including a test for isByteSequence

There don't seem to be any unit tests, just the ones imported from httpwg-tests. Where do you want to add local unit tests?

I'd recommend you make a test/util.ts file for the test

Thank you!


New logo for Mapsui

Hello, I wanted to contribute to Mapsui and I designed a logo for it. If you like it, I can send you a pr. If you have anything you want, you can tell me.

Hi there, Thanks a lot. I would love to use this. I especially like the icon at the top.

Thanks! I sent pr. Please check it. https://github.com/Mapsui/Mapsui/pull/407
If you have any problems, do not hesitate to let me know.

Great, I've merged it. How did you create the logo? Do you also have some kind of vector source?

Of course! all the files you need are here.
https://drive.google.com/open?id=1ikW6D2CD4d5cWMSOTHXJDWWNpgRkt6-Y

Thanks, I will add them to the repo as well. Is that okay?

Ofcourse...


Persian فارسی translation

I have translated it to Persian, I also made some quick fix for the right to left scripts.
https://github.com/hamed/trust

That would be great! There are a few areas where your repo helps mine! I'd also like to share some hacks that will change the numerals to Arabic in the thumbnail and the scripts, like so:

Is it fine if I open an issue on your GitHub repo?

That would be great!

One quicky problem. I can't find the "Issues" tab... 😅

solved!

Thank you @hamed & @MudarAljundi! I've pushed the Persian/Farsi version up to the main page!

(Also, um, because I am not a very worldly-cultured person... what's the difference between Persian & Farsi?)

Wonderful!
Others call it Persian, we call it Farsi.

Ah, thanks @hamed! :)
Also I forgot to mention last time, but wow I'm super impressed with how you + @MudarAljundi managed to right-to-left flip EVERYTHING, even the scoreboard & bottom navigation bar.
Many thanks again! I'll close this issue now~

Thank you for this masterpiece!


post created - published - on github - don't show up in generated site

While setting up a site and testing post through Netlify CMS, I already notices a few times that post don't show up.
I posted on mondayevening a post through cms

got to github ( https://github.com/joachimVdH/TVG-Jekyll-NetlifyCMS/blob/master/_posts/2020-07-27-maandagavond-test-23-40.md )
netlify is triggered

but none shows up : https://optimistic-babbage-aebc91.netlify.app/nieuws

currently I don't know where to start, looking for an anwser or where to best file a bug, since I don't see to what it's related.
thanks in advance

Describe the bug

To Reproduce

post a blogitem-news item through CMS
Expected behavior

that is published through netlify a few minutes later
Screenshots

Applicable Versions:

Netlify CMS version: can't find it -<EMAIL_ADDRESS>Git provider: GitHub
OS: Macos catalina 10.15.6
Browser version firefox 78.0.1

Node.JS version:

CMS configuration

https://github.com/joachimVdH/TVG-Jekyll-NetlifyCMS/blob/master/admin/config.yml
Additional context

Hi @joachimVdH, I can see the post when running locally:

So this is probably not a CMS issue.
I would try running the build again with clearing cache or ask in the Netlify community (if you haven't done so yet).

Closing, please comment if still relevant


Can't create issue via Vue issue helper

github API call fails :
api.github.com/repos/vuejs/vue-cli/releases?page=1&per_page=100 returns :
documentation_url: "https://developer.github.com/v3/#rate-limiting" message: "API rate limit exceeded for XXX.X.XXX.XXX. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"

Sorry to hear that. You can either re-use this existing issiu and describe your bug here - 'll keep it open.
or you wait an hour and try again, when the rate limit from github has reset.
We'll see if we can find a solution to the rate-limit problem in the helper.

It should have resetted at 1pm (gmt+1) I was just able to create it a few minutes ago, sorry for the inconvenience. You can close this one

Thanks, good to hear.
Nonethelesse, I opened an issue to track this in the issue-helper rep: https://github.com/vuejs/vue-issue-helper/issues/40


Creating Vector Index (IVF) error: "expected 1536 dimensions, not 768"

Describe the bug
Hello,
I tried to execute the notebook using my freshly created resources on Azure.
This line cause error:
vector_store.create_index(num_lists,  similarity_algorithm, kind, m, ef_construction)
Output:
OperationFailure: expected 1536 dimensions, not 768, full error: {'ok': 0.0, 'errmsg': 'expected 1536 dimensions, not 768', 'code': 2, 'codeName': 'BadValue'}
To Reproduce
Steps to reproduce the behavior:

Create a "Azure Cosmos DB for MongoDB (vCore)" ressource on Azure (FreeTier) (Public Access)
Create a "Azure OpenAI" ressource on Azure
Deploy model in "Azure Open AI Studio" using model "text-embedding-ada-002" (no dynamic quota and DefaultV2)
Set variables (Api Key, Endpoint, dbname and collection) to connect to MongoDB and openai service
Execute notebook

Desktop:

OS: Windows 11
Soft: Visual Studio Code
Version: Python 3.12.3

Additional context
I can't use VECTOR_HNSW in Free Tier.
If I set dimensions during AzureOpenAIEmbeddings instantiation, I got same error.
If I set dimensions = X, I got error: expected X dimensions, not 768
If I set dimensions = 768, I got error: expected 768 dimensions, not 1536
Thanks for your help.

Hey @CarteKiwi,
Thank you for reporting.
Are you using the latest version of this repo?
we removed the HNSW index so, you shouldn't be getting any errors related to it.
If you are not using the latest version please try to update the code and check again.
If you are using the latest version then I will have to ask a colleague to confirm that vector search with IVF is supported in the free tier. (I'm not sure that it's supported in the free tier)

Also, Regarding the error "768" we have not set this anywhere in our code so please revert to the original code and show me the initial error without any fixes.

Also, Regarding the error "768" we have not set this anywhere in our code so please revert to the original code and show me the initial error without any fixes.

Using original code, not setting 768 anywhere, I got the error:
OperationFailure: expected 1536 dimensions, not 768, full error: {'ok': 0.0, 'errmsg': 'expected 1536 dimensions, not 768', 'code': 2, 'codeName': 'BadValue'}

Hey @CarteKiwi, Thank you for reporting.
Are you using the latest version of this repo? we removed the HNSW index so, you shouldn't be getting any errors related to it. If you are not using the latest version please try to update the code and check again.
If you are using the latest version then I will have to ask a colleague to confirm that vector search with IVF is supported in the free tier. (I'm not sure that it's supported in the free tier)

Thanks for your prompt reply !
Yes, I'm using latest version. But had to change the "OpenAI Client variables" that seems to be obsolete.
Replacing this :
import openai

openai.api_type = os.getenv("OPENAI_API_TYPE", "azure")
openai.base_url = os.getenv("AZURE_OPENAI_ENDPOINT", "https://<YOUR-OPENAI-DEPLOYMENT-NAME>.openai.azure.com/")
openai.api_version = os.getenv("OPENAI_API_VERSION", "2023-09-15-preview")
openai.api_key = os.getenv("OPENAI_API_KEY", "<YOUR-DEPLOYMENT-KEY>")

To this:
os.environ["AZURE_OPENAI_ENDPOINT"] = ("https://<MYNAME>.openai.azure.com/")
os.environ["AZURE_OPENAI_API_KEY"] = "<MYKEY>"

Also, Regarding the error "768" we have not set this anywhere in our code so please revert to the original code and show me the initial error without any fixes.

Using original code, not setting 768 anywhere, I got the error: OperationFailure: expected 1536 dimensions, not 768, full error: {'ok': 0.0, 'errmsg': 'expected 1536 dimensions, not 768', 'code': 2, 'codeName': 'BadValue'}

the error clearly states that you are trying to use dimension = 768 here expected 1536 dimensions, not 768 can you revert this back to 1536?

sorry for the delay in getting back to you on this.
I'm working on it not and will get back to you with a resolution in the next couple of hours.

I just created a fresh deployment and tried replicating your issue but I didn't face the same problem as you have been facing.
My suggestion is that you try updating langchain, langchain and pull the latest version of the repo and try it.


wrong setting

Yes, since 6.0.0 the package is published as ECMAScript module only. Your options are:

migrate your code to ECMAScript modules. It's the best long term solution but probably a lot of work. If you don't migrate, you will see this kind of error with every dependency update since more and more packages are migrating to ESM
import it asynchronously via await import("parse-domain") (see https://nodejs.org/dist/latest-v16.x/docs/api/modules.html)
stay on version 5.0.0

why not just push cjs and esm at same time?

We already did it for two years, but cross-publishing ESM and CJS is not as easy as it sounds. There are a couple of pitfalls I don't want to care of any longer. A lot of module maintainers are slowly switching to ESM, so you probably won't have a choice in the long term.
If you're still using CJS, you can use version 5.0.0. It already has the parse-domain-update command, so you can keep the internal list up-to-date.


[hotfix][docs] Fix output of sample job

Previously, the output listed here was the one for head and not tail
as it's described in the steps to execute the test.

What is the purpose of the change
Fix the output of the tail comment in the steps to run the test, to avoid confusing the user
Brief change log

Fix the output of the tail comment in the steps to run the test, to avoid confusing the user

Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): no
The public API, i.e., is any changed class annotated with @Public(Evolving): no
The serializers: no
The runtime per-record code paths (performance sensitive): no
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
The S3 file system connector: (yes / no / don't know)

Documentation

Does this pull request introduce a new feature? no
If yes, how is the feature documented? not applicable

@zentol Sorry for the delay.

Opened another PR to fix the output for master which needed fix only for the chinese version.
Updated this one to fix both for english and chinese version.


Update Readme to reflect the current situation

Looking good, might need to state the the user needs to hover over the artifact name (for the download icon to work). Azure really made this quite complicated from before.
Could also mention downloading from the GitHub releases system (since that's much easier to use and matches up with the steam workshop version).

Thanks!


maxTicksLimit leaving uneven space at the rear end of graph

Chart.JS version: 2.6.0

I am using maxTicksLimit like

                    scales: {
                        xAxes: [{
                            display: true,
                            ticks: {
                                maxTicksLimit: 5
                            }
                        }],
                        yAxes: [{
                            display: true
                        }]
                    }

There is uneven space between the last two labels in x-axis. I am expecting even spaces between the vertical grid lines.

Link to CodePen is https://codepen.io/shivabhusal/pen/GvWdNq?editors=0010
Any help would be appreciated. Thanks

This is a dupe of https://github.com/chartjs/Chart.js/issues/4358. Let us know how it went, thanks.

Closing as this is a duplicate


[Size constructor in flutter library

Hi everyone,
I was wondering when the height and width of a Size object are the same, should we not always use the Size.square constructor instead of the default one?
Would that not result in cleaner code?

Hi @GaspardMerten
This issue doesn't seem to describe a bug or a feature request. Please see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you

Hi @GaspardMerten
This issue doesn't seem to describe a bug or a feature request. Please see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you

@GaspardMerten
I'm not sure to add complexity to the source code would be  a good trade off
when you need 3 lines of code to have the feature readily available anywhere in your project
/// just add this to your code
extension DoubleToSize on double {
  Size get toSize => Size(this, this);
}

/// you can use it as follows
void main() {
  final size = 2.0.toSize;
  print('$size');
}

@GaspardMerten
I'm not sure to add complexity to the source code would be  a good trade off
when you need 3 lines of code to have the feature readily available anywhere in your project
/// just add this to your code
extension DoubleToSize on double {
  Size get toSize => Size(this, this);
}

/// you can use it as follows
void main() {
  final size = 2.0.toSize;
  print('$size');
}


Input image exceeds pixel limit

Issue Summary
Uploading an animated gif (relatively not too larger) via Ghost Editor throws an internal server error message. I checked the server logs and found out that it throws "Error: Input image exceeds pixel limit at /var/www/mightytools.co/versions/5.74.3/node_modules/@tryghost/image-transform/lib/transform.js:145:15"
Attached the complete log object in the error log section.
Steps to Reproduce

Open the Ghost Editor and try to upload any of the following images.

The image samples to recreate the error:

https://github.com/TryGhost/Ghost/assets/278469/467c2bc5-2ec9-495c-8fa0-59aba8129c2b
https://github.com/TryGhost/Ghost/assets/278469/fba38d33-77ea-4f41-8a42-f40fdc862af2

Ghost Version
5.74.3
Node.js Version
v18.18.2
How did you install Ghost?
Selfhost | Ubuntu 22.04 (LTS)
Database type
MySQL 5.7
Browser & OS version
No response
Relevant log / error output
{
    "name": "Log",
    "hostname": "mightytools-co",
    "pid": 27826,
    "level": 50,
    "version": "5.74.3",
    "req": {
        "meta": {
            "requestId": "71f217d0-d9ca-4755-a803-33b6a14ffb69",
            "userId": "1"
        },
        "url": "/images/upload/",
        "method": "POST",
        "originalUrl": "/ghost/api/admin/images/upload/",
        "params": {},
        "headers": {
            "x-forwarded-for": "<IP_ADDRESS>",
            "x-forwarded-proto": "https",
            "x-real-ip": "<IP_ADDRESS>",
            "host": "mightytools.co",
            "connection": "close",
            "content-length": "2871551",
            "sec-ch-ua": "\"Microsoft Edge\";v=\"119\", \"Chromium\";v=\"119\", \"Not?A_Brand\";v=\"24\"",
            "sec-ch-ua-mobile": "?0",
            "app-pragma": "no-cache",
            "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36 Edg/<IP_ADDRESS>",
            "content-type": "multipart/form-data; boundary=----WebKitFormBoundaryaLYvXlGJ6kbTBNAB",
            "accept": "text/plain, */*; q=0.01",
            "x-requested-with": "XMLHttpRequest",
            "x-ghost-version": "5.74",
            "sec-ch-ua-platform": "\"Windows\"",
            "origin": "https://mightytools.co",
            "sec-fetch-site": "same-origin",
            "sec-fetch-mode": "cors",
            "sec-fetch-dest": "empty",
            "referer": "https://mightytools.co/ghost/",
            "accept-encoding": "gzip, deflate, br",
            "accept-language": "en-US,en;q=0.9",
            "cookie": "**REDACTED**"
        },
        "query": {}
    },
    "res": {
        "_headers": {
            "x-powered-by": "Express",
            "content-version": "v5.74",
            "vary": "Accept-Version, Origin, Accept-Encoding",
            "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
            "access-control-allow-origin": "https://mightytools.co",
            "content-type": "application/json; charset=utf-8",
            "content-length": "274",
            "etag": "W/\"112-3eS8hcbJdLkzXM+OAb0gZ8In0ok\""
        },
        "statusCode": 500,
        "responseTime": "56ms"
    },
    "err": {
        "id": "ecd82c40-8d0f-11ee-affe-13e14cdc1fc7",
        "domain": "https://mightytools.co",
        "code": "IMAGE_PROCESSING",
        "name": "InternalServerError",
        "statusCode": 500,
        "level": "critical",
        "message": "Unable to manipulate image.",
        "stack": "Error: Input image exceeds pixel limit\n    at /var/www/mightytools.co/versions/5.74.3/node_modules/@tryghost/image-transform/lib/transform.js:145:15",
        "hideStack": false
    },
    "msg": "Unable to manipulate image.",
    "time": "2023-11-27T10:30:03.273Z",
    "v": 0
}

Code of Conduct

[X] I agree to be friendly and polite to people in this repository

This is a duplicate of https://github.com/TryGhost/Ghost/issues/17278, but it was closed at the time. I'll tag this one a bug and accept PRs to fix it 🙂


AndroidX Sync 01-06-2023

Sync Core and Compose src from AndroidX back to Github
Need to update build.gradle for Core and Compose.

Core: add androidx.annotation:annotation:1.5.0 dependency to specify @Null and @Nonull
Compose: add the -Xjvm-default option to be able to use @JvmDefaultWithCompatibility

The updates above need to be applied to the existing projects to make them work properly

The change made in https://github.com/androidx/constraintlayout/compare/main...jswong65:sync-0106?expand=1#diff-35a5417bf4670237154587289a9cda917dc088fa60fba32f282ca8c89e42e408R73 also causes an issue in https://github.com/androidx/constraintlayout/blob/f284d8aa5c5feeba2548c1e740487ce0e8af0620/constraintlayout/swing/src/main/java/org/constraintlayout/swing/core/motion/model/MotionEngine.java#L49
@jafu888 could you please help with addressing the issue?

Some of the Java changes need to be backed out.
Specifically:

MotionKeyPosition.java: Where you see stuff being removed

do not change

MotionPaths.java
MotionKeyPosition.java
ArcCurveFit.java


add spectrum.average_photon_energy gallery example

Work in progress.

[X] Closes #2194
[X] I am familiar with the contributing guidelines
[ ] Tests added
[ ] Updates entries in docs/sphinx/source/reference for API changes.
[x] Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
[x] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
[x] Pull request is nearly complete and ready for detailed review.
[x] Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

This example demonstrates the use of spectrum.average_photon_energy with the output of spectrum.spectrl2 as an input.
Link to example here

For everyone else stalking Dax progress with each commit: https://pvlib-python--2206.org.readthedocs.build/en/2206/gallery/spectrum/average_photon_energy.html#sphx-glr-gallery-spectrum-average-photon-energy-py

Tentatively marking this ready for review. Would be good to get some feedback at this stage.

Thanks for the review @IoannisSifnaios

I have resolved all outstanding issues. Let me know if there's anything else

It's a bit lengthy for a gallery example, but until we have a better place for long-form tutorial content, I think this is fine.

^hmm I had been thinking along similar lines

@echedey-ls @kandersolar see the last commit, does that look better? Let me know what you think. Happy to revise further if necessary. I appreciate the review/suggestions

Yeah! It super good.


Add low latency initialisation support on windows by directly interacting with WASAPI

This reduces latency from perceivable (25-40ms) to non-perceivable (5-15ms). With this change, the latency on windows actually becomes limited by the update thread rate.
Pushing this as a draft for those interested in testing it ahead of time. I hope to clean up the single static usage.
If you wish to test in the mean time, please checkout this PR, build osu! after running UseLocalFramework.ps1.

[x] Depends on https://github.com/ppy/osu-framework/pull/6090 (for initialisation sanity)
[x] Depends on https://github.com/ppy/osu-framework/pull/6091

From a code perspective, this is now ready for checking. Note that I haven't tested things still work after refactoring just yet.

I've added some more commentary in the xmldoc, see what you think.

Switching default output (either by audio settings, or by disconnecting / reconnecting a device) does not work by default for me.
I have a rough version that makes it sorta work:
diff --git a/osu.Framework/Audio/AudioManager.cs b/osu.Framework/Audio/AudioManager.cs
index 07e63484e..fd8f87f40 100644
--- a/osu.Framework/Audio/AudioManager.cs
+++ b/osu.Framework/Audio/AudioManager.cs
@@ -162,7 +162,8 @@ public AudioManager(AudioThread audioThread, ResourceStore<byte[]> trackStore, R

             thread.RegisterManager(this);

-            AudioDevice.ValueChanged += onDeviceChanged;
+            AudioDevice.ValueChanged += _ => onDeviceChanged();
+            GlobalMixerHandle.ValueChanged += _ => onDeviceChanged();

             AddItem(TrackMixer = createAudioMixer(null, nameof(TrackMixer)));
             AddItem(SampleMixer = createAudioMixer(null, nameof(SampleMixer)));
@@ -221,9 +222,9 @@ protected override void Dispose(bool disposing)
             base.Dispose(disposing);
         }

-        private void onDeviceChanged(ValueChangedEvent<string> args)
+        private void onDeviceChanged()
         {
-            scheduler.Add(() => setAudioDevice(args.NewValue));
+            scheduler.Add(() => setAudioDevice(AudioDevice.Value));
         }

         private void onDevicesChanged()
diff --git a/osu.Framework/Threading/AudioThread.cs b/osu.Framework/Threading/AudioThread.cs
index 439cf4d16..7e02937ca 100644
--- a/osu.Framework/Threading/AudioThread.cs
+++ b/osu.Framework/Threading/AudioThread.cs
@@ -121,6 +121,7 @@ protected override void OnExit()
         // TODO: All this bass init stuff should probably not be in this class.

         private WasapiProcedure? wasapiProcedure;
+        private WasapiNotifyProcedure? wasapiNotifyProcedure;

         /// <summary>
         /// If a global mixer is being used, this will be the BASS handle for it.
@@ -212,7 +213,11 @@ private void attemptWasapiInitialisation()

             // To keep things in a sane state let's only keep one device initialised via wasapi.
             freeWasapi();
+            initWasapi(wasapiDevice);
+        }

+        private void initWasapi(int wasapiDevice)
+        {
             // This is intentionally initialised inline and stored to a field.
             // If we don't do this, it gets GC'd away.
             wasapiProcedure = (buffer, length, _) =>
@@ -222,13 +227,30 @@ private void attemptWasapiInitialisation()

                 return Bass.ChannelGetData(globalMixerHandle.Value!.Value, buffer, length);
             };
+            wasapiNotifyProcedure = (notify, device, _) =>
+            {
+                if (notify == WasapiNotificationType.DefaultOutput)
+                {
+                    freeWasapi();
+                    initWasapi(device);
+                }
+            };
+
+            bool initialised = BassWasapi.Init(wasapiDevice, Procedure: wasapiProcedure, Buffer: 0.02f, Period: 0.005f);

-            if (BassWasapi.Init(wasapiDevice, Procedure: wasapiProcedure, Buffer: 0.02f, Period: 0.005f))
+            if (!initialised)
             {
-                BassWasapi.GetInfo(out var wasapiInfo);
-                globalMixerHandle.Value = BassMix.CreateMixerStream(wasapiInfo.Frequency, wasapiInfo.Channels, BassFlags.MixerNonStop | BassFlags.Decode | BassFlags.Float);
-                BassWasapi.Start();
+                if (Bass.LastError == Errors.Already)
+                    BassWasapi.CurrentDevice = wasapiDevice;
+                else
+                    return;
             }
+
+            BassWasapi.GetInfo(out var wasapiInfo);
+            globalMixerHandle.Value = BassMix.CreateMixerStream(wasapiInfo.Frequency, wasapiInfo.Channels, BassFlags.MixerNonStop | BassFlags.Decode | BassFlags.Float);
+            BassWasapi.Start();
+
+            BassWasapi.SetNotify(wasapiNotifyProcedure);
         }

         private void freeWasapi()
@@ -237,7 +259,8 @@ private void freeWasapi()

             // The mixer probably doesn't need to be recycled. Just keeping things sane for now.
             Bass.StreamFree(globalMixerHandle.Value.Value);
-            BassWasapi.Free();
+            BassWasapi.Stop();
+            //BassWasapi.Free();
             globalMixerHandle.Value = null;
         }

but:

I had to comment BassWasapi.Free() because it deadlocks if it's left as-is there and I'm not sure how to fix
the AudioManager stuff is a dirty hack just so that all the mixers make their way onto the recycled mixer
sometimes it plays corrupted sound through multiple devices
I even got it to crash once for whatever reason

so I dunno. I'm leaving it there, this may need more serious restructuring. Definitely think that the lack of usage of SetNotify() in this diff as written is an omission and I don't see how this could correctly handle output switches otherwise.

I also got the following with my above broken patch once:
Application: osu!.exe
CoreCLR Version: 6.0.2023.32017
.NET Version: 6.0.20
Description: The application requested process termination through System.Environment.FailFast(string message).

Stack:

so if you're gonna use that for something, both of the bass callbacks should probably be created once ever.

With this PR, opening the audio mixer visualiser (Ctrl+F9) makes the tracks and samples speed up really fast. Closing the mixer visualiser restores it back to normal. The "speed up" is tied to the audio thread update rate, eg. in single threaded, the audio goes faster as you cycle trough Vsync, 2x, 4x, 8x. Or if you unfocus the window.
In TestSceneAudioMixerVisualiser, only the global tracks and samples are sped up, it's fine on the added mixers. Unless you open the actual Ctrl+F9 mixer, then everything is sped up (as with all the other test scenes).
Loud noise warning when you test this!

Fwiw when testing osu!-side with this framework PR (on windows), I do need to set a universal offset of around -45 now to match hitsounds to the audio when playing whereas I was previous using the default 0 just fine. Is that an intended side-effect of these changes?

@Morilli generally yes we know

With this PR, opening the audio mixer visualiser (Ctrl+F9) makes the tracks and samples speed up really fast

Fixed by https://github.com/ppy/osu-framework/pull/6088/commits/1d2f64c04334bcc1fddb60c6649e2fa7af3f97fa


first commit

Could you please explain the purpose of this pull request? Has this been created by mistake?

Could you please explain the purpose of this pull request? Has this been created by mistake?

Yes, it might have been a mistake. Sorry

Yes it was a mistake, Sorry
On Tue, Oct 25, 2022 at 1:27 AM BobsProgrammingAcademy <
@.***> wrote:

Could you please explain the purpose of this pull request? Has this been
created by mistake?
—
Reply to this email directly, view it on GitHub
https://github.com/BobsProgrammingAcademy/freelance-developer-website/pull/1#issuecomment-1289711187,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AT4ZU3WQHBSAZDR3BG2IVPTWE4ENHANCNFSM6AAAAAARG4LYBQ
.
You are receiving this because you authored the thread.Message ID:
<BobsProgrammingAcademy/freelance-developer-website/pull/1/c1289711187@
github.com>

Thank you for clearing that up. We are closing this pull request.

Thanks!
On Tue, Oct 25, 2022 at 6:49 PM BobsProgrammingAcademy <
@.***> wrote:

Closed #1
https://github.com/BobsProgrammingAcademy/freelance-developer-website/pull/1
.
—
Reply to this email directly, view it on GitHub
https://github.com/BobsProgrammingAcademy/freelance-developer-website/pull/1#event-7664934209,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AT4ZU3Q7Z657EELACYREQGTWE76OZANCNFSM6AAAAAARG4LYBQ
.
You are receiving this because you authored the thread.Message ID:
<BobsProgrammingAcademy/freelance-developer-website/pull/1/issue_event/7664934209
@github.com>


Fixes in ST_Difference

Is this PR related to a proposed Issue?
No
What changes were proposed in this PR?
Fixes in ST_Difference to handle null values.
How was this patch tested?
New Scala unit test added
Did this PR include necessary documentation updates?
No

@madzik555 Wait, I think we had a miscommunication here. Your implementation for null safe ST_Difference was correct. The expression should extend "BinaryGeometryExpression" which is automatically null safe.
What @Imbruced asked is that just add some "null" test cases in https://github.com/apache/incubator-sedona/pull/580
So for ST_SymDifference, you should also extend "BinaryGeometryExpression". I believe your old implementation was correct, but the one we merged into the master branch didn't extend "BinaryGeometryExpression"...

Okay, my bad. I fix it tomorrow. 😃


docs(readme): fix build url in readme badge

:tada: This PR is included in version 1.0.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


how to use simple_one_for_one under supervisor tree

Hi:
I'm writing something which use supervisor:start_child to dynamic create worker process.
But my code show's me these processes share same struct which I just make for gen.Server behavior.
Maybe I should write some creater code with method to create the behavior struct , but I donnot know how to do this with supervisor.
Is there some demo code show me how to do this ?
Or I just can do this with spawn process which never under supervisor tree ?

Hello, thanks for the question. There was the same question a while ago https://github.com/ergo-services/ergo/issues/92#issuecomment-1005492091
I would recommend to use this kind of supervisor in this way
   control_process (based on gen.Server)
       |
       ---- spawn sup_process (based on gen.Supervisor with "one for one" strategy)
                     |
                     ------ worker_process (based on gen.Server)

so the code will be like:
// definition
var (
	numWorkers = 5
)

type control struct {
   gen.Server
}
type controlState struct {
   sup *supWorkers
   supProcess gen.Process
   workers    []etf.Pid
   counter    uint64
}

type supWorkers struct {
   gen.Supervisor
}

type worker struct {
  gen.Server
}

/// callbacks for the 'control' process
func (c *control) Init(process *gen.ServerProcess, args ...etf.Term) error {

    sup := &supWorkers{}
    supOptions := gen.ProcessOptions{
        Context: process.Context(), // inherited context to make sup process be hard linked with the control one
    }
    supProcess, err := process.Spawn("", opts, sup)
    state := &controlState{
      sup: sup,
      supProcess: supProcess,
    }
     for i := 0; i < numWorkers; i++ { // start 5 worker processes
		child, err := sup.StartChild(supProcess, "worker")
		if err != nil {
			return err
		}
		state.workers = append(state.workers, child.Self())

               // monitor process in order to restart it on termination
		process.MonitorProcess(child.Self())
	}

   process.State = state
    return nil
}

func (c *control) HandleCast(process *gen.ServerProcess, message etf.Term) gen.ServerStatus {
	state := process.State.(*controlState)

        // use "round robin" to choose the worker process
	n := int(state.counter % uint64(numWorkers))
	state.counter++
        // forward message
	process.Cast(state.workers[n], message)

	return gen.ServerStatusOK
}

func (c *control) HandleInfo(process *gen.ServerProcess, message etf.Term) gen.ServerStatus {
	state := process.State.(*controlState)
	switch m := message.(type) {
	case gen.MessageDown:
		for i, pid := range state.workers {
			if pid != m.Pid {
				continue
			}
			// restart terminated worker
			child, err := state.sup.StartChild(state.supProcess, "worker")
			if err != nil {
				return err
			}
			process.MonitorProcess(child.Self())
			state.workers[i] = child.Self()
			break
		}
	default:
		fmt.Printf("unknown request: %#v\n", m)
	}
	return gen.ServerStatusOK
}

// callback for the supervisor
func (s *supWorkers) Init(args ...etf.Term) (gen.SupervisorSpec, error) {
	return gen.SupervisorSpec{
		Name: "sup_workers",
		Children: []gen.SupervisorChildSpec{
			gen.SupervisorChildSpec{
				Name:  "worker",
				Child: &worker{},
			},
		},
		Strategy: gen.SupervisorStrategy{
			Type:      gen.SupervisorStrategySimpleOneForOne,
			Intensity: 5,
			Period:    5,
			Restart:   gen.SupervisorStrategyRestartTemporary,
		},
	}, nil
}

// callbacks for the 'worker' process
func (w *worker) Init(process *gen.ServerProcess, args ...etf.Term) error {
    // do whatever you need for the initialization
    return nil
}

func (w *worker) HandleCast(process *gen.ServerProcess, message etf.Term) gen.ServerStatus {
        // handle cast message forwarded from the 'control' process
	return gen.ServerStatusOK
}

if you need to forward Call request you should:

forward from value along with the message
use gen.ServerStatusIgnore as a return value in the control's HandleCall callback
in worker's HandleInfo (or HandleCast) use process.ReplyTo(from, replymessage)

type ForwardCall {
    from gen.ServerFrom
    message etf.Term
}

func (c *control) HandleCall(process *gen.ServerProcess, from gen.ServerFrom, message etf.Term) gen.ServerStatus {
	state := process.State.(*controlState)

        // use "round robin" to choose the worker process
	n := int(state.counter % uint64(numWorkers))
	state.counter++
        // forward message
	process.Send(state.workers[n], ForwardCall{from,message})

	return nil, gen.ServerStatusIgnore
}
func (w *worker) HandleInfo(process *gen.ServerProcess, message etf.Term) gen.ServerStatus {
        // handle call message forwarded from the 'control' process
        switch m := message.(type) {
         case ForwardCall:
                // handle message
                reply := "got it"
                process.ReplyTo(m.from, reply)
        }
	return gen.ServerStatusOK
}

Thank you .
From #92 I got it.
func (e *example) Init(process *gen.ServerProcess, args ...etf.Term) error { 	// State has interface{} type 	process.State = &private{i: 123} // this value is only available for this process 	e.shared = 567 // all spawned processes with the same object &example{...} have access to this value 	return nil }
I should save data to process.State .
This tastes really erlang 😂 .

This tastes really erlang

inspired by :)


[d3d9] Refactor state blocks to allocate dynamically.

One thing my branch also does, which this one doesn't do, is only allocate the HWVP constant set if SWVP is not enabled.
I think that's absolutely worthwhile considering that most games don't use SWVP and the SWVP constant set is huge.

One thing my branch also does, which this one doesn't do, is only allocate the HWVP constant set if SWVP is not enabled.

Let's come back to this, fwiu that space is always allocated in DX and games can write up there and probably expect to read them back so we'd need to be careful.

Looks fine to me except for the mess with TextureChangePrivate_.

I solved that by just moving it to the CPP file and doing an explicit template instantiation with:
    template struct D3D9State<dynamic_item>;
    template struct D3D9State<static_item>;


Fix DotDeb key installation, fix #130

Fix provisioning error while installing DotDeb key, see #130

Thanks! :whale2:


Add own ClosureGuard for correct memory tracker

Before calling the Run() method of a RPC closure, reset
the thread-local memory tracker to NULL to ensure that those
released memory will not be counted into our memory tracker

@imay @kangkaisen @chaoyli PTAL


Move hystrix down to other section, point to SC

We're going to drop the hystrix repo from the prometheus
repositry as it's a stale fork. Rather refer
to the original, and put it in the appropriate section.
@beorn7 @tomcz

In general, much cleaner this way.
@tomcz IIRC you weren't involved in the fork anyway. We can't even remember who did it. Since we have a large number of contributed exporters and other tools, and we don't fork any of them in the Prometheus org as a pointer, it's more consistent to not do it with Hystrix, either.

@beorn7 I was not involved in the fork. Didn't really make sense to me but I thought that the Prometheus team wanted to take ownership. I wasn't asked nor did I intend to maintain the fork.


Fixed #28597 -- Moved setting the name of _meta.indexes to Model._prepare().

https://code.djangoproject.com/ticket/28597

jenkins


Need a way to get some past or future date

UseCase: I want to get two days old date
it can be achieved using js like this:
var date = new Date();
console.log(date);

var yesterday = date - 1000 * 60 * 60 * 24 * 2;   // current date's milliseconds - 1,000 ms * 60 s * 60 mins * 24 hrs * (# of days beyond one to go back)
yesterday = new Date(yesterday);
console.log(yesterday);

fixed - https://github.com/EnsembleUI/ensemble_ts_interpreter/issues/15
documentation - https://github.com/EnsembleUI/ensemble_docs/blob/main/build/javascript/Date.md


implement custom function for dataProvider

Creating a draft PR for initial review, if interested
This enables useCustom to call custom api exposed on pocketbase.
I will be updating docs and will try adding tests for the same over the weekend.

Awesome, thank you. 👍   Haven't tried to expose custom pocketbase api routes yet byt will do over the weekend.
Did you create this PR as a draft because you wanted to add more changes?

I made it draft, because I at-least want to attempt adding test for this. I will add those and will make it Ready for review, if I'm successful

@kruschid, marking PR ready for review. Let me know what you think.

Bit curious @kruschid , I noticed that in #2 you mentioned about discord thread. Do you have public discord server/channel, which I can join for discussions?

Bit curious @kruschid , I noticed that in #2 you mentioned about discord thread. Do you have public discord server/channel, which I can join for discussions?

Yea I'm on the refine server and was DMed. But I was planning to start a discord server for my libs. You can join if you like:
https://discord.gg/BCGmvSSJBk
Later, I will add the link to the readme, too.

Thanks for the great PR. I'm gonna try adding some GitHub actions, but if it takes too long, I'll just publish the new version manually and come back to it later.


Pulumi is not triggering configured Instance Refresh after Lanuch Template update.

In the pulumi AWS Auto Scaling Group input, there is option to configure triggering Instance Refresh after events like launch template update etc.
The documentation says that if the instanceRefresh block is configured then pulumi will start the Instance Refresh.
However, I am not observing this behaviour after updating the lunch template, and I need to trigger it from the console manually.
Steps to reproduce
I've created a simple deployment in pulumi node.js to help you reproduce this scenario, link. There you have detailed reproduction steps etc.
However basically, to reproduce:

Launch a deployment containing Auto Scaling Group with instanceRefresh option configured and Launch Template.
Change sth in the Lauch Temple.
Run the deployment again, the pulumi should update the launch temple.
Open AWS console, go to ASG section and check that instance refresh was not triggered, despite the documentation says:

A refresh will always be triggered by a change in any of launch_configuration, launch_template, or mixed_instances_policy.

Expected: Pulumi should trigger Instance Refresh procedure on ASG
Actual: The Instance Refresh is not triggered
Tested on:
Pulumi: v3.7.0
Node: 12.x and 15.x

Unfortunately, I think this is a documentation bug as the documentation is derived from the Terraform documentation and we seem to have missed including the NOTE:

A refresh is started when any of the following Auto Scaling Group properties change: launch_configuration, launch_template, mixed_instances_policy. Additional properties can be specified in the triggers property of instance_refresh.

Because updating the launch template resource itself doesn't cause an update to any of the ASG properties, instance refresh won't be triggered. If you change from say $Latest to $Default in your launchTemplate section of the autoscaling group resource, you'll see that the instance refresh is triggered.
One way to do this would be something along the lines of:
    tags: [{
        key: "userDataHash",
        value: launchTemplate.userData.apply(u => sha256(u)),
        propagateAtLaunch: true,
    }],
    instanceRefresh: {
        strategy: "Rolling",
        preferences: {
            minHealthyPercentage: 50,
        },
        triggers: ["tag"],
    },

@leezen Thank you! I can confirm that the solution you have described work for me 😄

That solution did the trick @leezen. Even tho the official documentation still doesn't say to update the launchTemplate version value from Latest to Default.
This is what worked:
        launch_template=aws.autoscaling.GroupLaunchTemplateArgs(
            id=launch_templates[typ].id,
            version="$Default",
        ),


[Solutions] Media rendering scenario

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/example-scenario/hpc/media/native-hpc-ref-arch.png
:white_check_mark:Succeeded
View

docs/example-scenario/hpc/video-rendering.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


[zh-cn] sync access-authn-authz/validating-admission-policy.md

These look like some new examples referenced by a new/updated page. Please sync that page(s) together with these examples.

These look like some new examples referenced by a new/updated page. Please sync that page(s) together with these examples.

Thanks for review, I will do it later

Looks like there are still 13 conversations not resolved?

Looks like there are still 13 conversations not resolved?

All conversations has been resolved

/lgtm
Please trigger an empty commit to rerun the gate tests.

/lgtm Please trigger an empty commit to rerun the gate tests.

@my-git9
Technical review has been completed, please follow @tengqm advice.

/lgtm


Error associating clonotype abundance/expansion with clusters

Hi, thank you for the great package! This is my first time using muondata objects for joint gex and tcr analysis and I am having some trouble grouping by cluster and plotting abundance.
To Reproduce
I followed the scirpy tutorial through concatenation but then ran harmony to batch correct my data and ran leiden clustering prior to creating the muondata object with RNA and tcr.
I am having an issue where I am not able to plot gene expression alongside observations in the airr modality.
The first error was a key error saying that leiden is not present in .obs or .vars even though leiden is present in .obs. I think I corrected this by running leiden on the concatenated and batch corrected anndata object first and then remaking the muondata object.
However the next error when I try to use scirpy functions to plot observations and data from both the gex and airr modalities is "AttributeError: 'DataFrame' object has no attribute '_convert'". I am not sure what this means. See error and code below. This is true for any functions from scirpy which call obs from both gex and airr.
_ = ir.pl.group_abundance(
    mdata, groupby="airr:is_convergent", target_col="gex:sample", max_cols=15, figsize=(5, 3)
)

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/orange/brusko/leeanapeters/RIMA/miniconda3/envs/scirpy/lib/python3.10/site-packages/scirpy/pl/_group_abundance.py", line 98, in group_abundance
    return base.bar(abundance, **kwargs)
  File "/orange/brusko/leeanapeters/RIMA/miniconda3/envs/scirpy/lib/python3.10/site-packages/scirpy/pl/base.py", line 67, in bar
    # Remove excess x label
  File "/orange/brusko/leeanapeters/RIMA/miniconda3/envs/scirpy/lib/python3.10/site-packages/pandas/plotting/_core.py", line 1136, in bar
  File "/orange/brusko/leeanapeters/RIMA/miniconda3/envs/scirpy/lib/python3.10/site-packages/pandas/plotting/_core.py", line 975, in __call__
    label_kw = kwargs["label"] if "label" in kwargs else False
  File "/orange/brusko/leeanapeters/RIMA/miniconda3/envs/scirpy/lib/python3.10/site-packages/pandas/plotting/_matplotlib/__init__.py", line 71, in plot
    plot_obj.generate()
  File "/orange/brusko/leeanapeters/RIMA/miniconda3/envs/scirpy/lib/python3.10/site-packages/pandas/plotting/_matplotlib/core.py", line 450, in generate
    self._compute_plot_data()
  File "/orange/brusko/leeanapeters/RIMA/miniconda3/envs/scirpy/lib/python3.10/site-packages/pandas/plotting/_matplotlib/core.py", line 608, in _compute_plot_data
    data = data._convert(datetime=True, timedelta=True)
  File "/orange/brusko/leeanapeters/RIMA/miniconda3/envs/scirpy/lib/python3.10/site-packages/pandas/core/generic.py", line 5989, in __getattr__
    -------
AttributeError: 'DataFrame' object has no attribute '_convert'

I know that clone_id is present, as well as is_convergent, and sample in the gex modality.
Any help would be much appreciated!
Session info
anndata             0.9.2
matplotlib          3.7.2
mudata              0.2.3
muon                0.1.5
pandas              2.0.3
scanpy              1.9.3
scirpy              0.13.0
session_info        1.0.0
-----
Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:55:59) [GCC 12.3.0]
Linux-3.10.0-1160.88.1.el7.x86_64-x86_64-with-glibc2.35

Hi @leeanapeters,
thanks for reporting the issue!
It seems the ._convert() method was removed in pandas 2.0 (see https://github.com/pandas-dev/pandas/pull/50026)
I come to suspect that somehow your environment is broken, because pandas 2.0.3 (as per your session info) doesn't have the _convert() call in line 608 of _matplotlib/core.py:
https://github.com/pandas-dev/pandas/blob/0f437949513225922d851e9581723d82120684a6/pandas/plotting/_matplotlib/core.py#L608
Maybe you could try starting with a new venv/conda env from scratch?

Regarding the leiden key missing from your object: You need to be aware that mdata.obs is independent from mdata['gex'].obs and mdata['airr'].obs. You can synchronize them by calling mdata.update(). When re-creating the mdata object, .update() is called implicitly, which is probably why this worked for you.
Hope this helps,
Gregor

Thank you so much for the quick reply!
Both of those sizes got rid of those errors :)
I do have another question though:
Should I subset my object before performing clonotype modularity? I am getting the length error that was previously reported in #302
Thanks!
Leeana

Should I subset my object before performing clonotype modularity? I am getting the length error that was previously reported in https://github.com/scverse/scirpy/issues/302

That should't be nescessary! As mentioned in the comment there, it would be great if you could open a separate issue with the full error message that I can investigate :)

Closing this as the original issue is solved.


Add link to plugin directory from landing page

Helps people find the plugin directory from the landing page.

https://app.shortcut.com/larder/story/4787/link-to-plugin-directory-from-roadie-io


add stacktrace.js to log full stacktraces

Hi all,
I finally found some time to update my solution to include stacktraces. My old PR and comments are here https://github.com/nelmio/NelmioJsLoggerBundle/pull/12
What do you think of the new/updated solution. What changes do you want before merging this?
Cheers,
Dominik

Hi Istronjny,
so you would want to have one item in the $context that contains the full multi-line stacktrace. And then for every line in the stacktrace you would want an extra item in the $context?
$context = array(   'stacktrace' => 'https://local.azine.me/bundles/bundle/compressed/azine_000.js : $.function : 664 : 12 https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js : dispatch : 5 : 14077 https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js : add/v.handle : 5 : 10849', 'line1' => 'https://local.azine.me/bundles/acmebundle/compressed/azine_000.js : $.function : 664 : 12', 'line2' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js : dispatch : 5 : 14077', 'line3' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js : add/v.handle : 5 : 10849' );
I can easily change the data-structure, that is not a problem, but I don't see how exactly you think that data structure should look like.
Or do you just want to include the full "stack" structure as posted by stacktrace.js?

@azine This is what I meant:
context => {
    'jsTraceFile' => 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js',
    'jsTraceLine' => 664,
    'jsTraceFunction' => '$.function',
    'jsTrace' => 'https://local.azine.me/bundles/bundle/compressed/azine_000.js : $.function : 664 : 12
https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js : dispatch : 5 : 14077
https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js : add/v.handle : 5 : 10849'
}

But whatever we do, I think we should make it very easy for a user of the bundle to overload converting the trace to context structure so that we don’t need a one size fits it all. Maybe inject a JavascriptContextFormatter into the controller that takes the post data array and returns a context array so that one can inject an alternate implementation if needed?

@lstrojny  The stacktrace usually has more than one line, so your suggestion does not make much sense, unless I got it wrong. Sorry in that case, please clarify.
Adding the same information twice (by adding both the formatted lines and also adding the stacktrace object => see end of my previous comment) does not make much sense to me either.
I think it should only be one of the two, either the formated lines (like I suggest) or the stacktrace object.
Currently you can specify your own Formatter (via setting in your config.yml) that will format the content of the $context and with some string manipulation you can pretty much output what you want in your custom formatter. But if you don't need anything special, having the line formated as fileName : functionName : lineNumber : columnNumber looks like a good default to me.

@Seldaek @lstrojny: do you see anything that I should change before you (hopefully) merge this PR?

Could anyone with write access comment or merge this please?

Sorry been busy lately, but I think it looks good, thanks!


Incorrect exercise: [courseId=grammar-intro_eng][lessonNumber=11][exerciseId=1862]

Description
I believe my answer is also valid.
Diagnostics information (do not remove)

Exercise identifier: [courseId=grammar-intro_eng][lessonNumber=11][exerciseId=1862]
Exercise payload: {"shouldDisplayHint":false,"exercise":{"canonicalAnswer":"gau mi cmene lo mlatu","sentences":[{"text":"I named the cat.","lojbanic":false}],"title":"Translate this sentence","type":"typing"}}
Attempted solution: {"text":"cmene lo mlatu gau mi"}
Attempted solution was classified as correct: no
Validation payload: {"canonicalAnswer":"gau mi cmene lo mlatu","correct":false}

Your answer is indeed valid, but being able to move sumtcita around is sadly not yet implemented.
(see also #191 )


fix: update React import for Expo 44

This updates the import style for React Native headers so it can be used with Expo 44. Any project will SDK 44 will fail to build without this change.
Related: https://github.com/expo/expo/issues/15622#issuecomment-997141629

Thanks!


[doc tutorial] IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

Hello !
Using the example code used in the RL tutorial, I get the following error :
xxx/lib/python3.6/site-packages/PyBrain-0.3.3-py3.6.egg/pybrain/rl/agents/logging.py:44: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  assert self.lastobs != None
Traceback (most recent call last):
  File "agent.py", line 109, in <module>
    experiment.doInteractions(100)
  File "xxx/lib/python3.6/site-packages/PyBrain-0.3.3-py3.6.egg/pybrain/rl/experiments/experiment.py", line 18, in doInteractions
    self._oneInteraction()
  File "xxx/lib/python3.6/site-packages/PyBrain-0.3.3-py3.6.egg/pybrain/rl/experiments/experiment.py", line 27, in _oneInteraction
    self.task.performAction(self.agent.getAction())
  File "xxx/lib/python3.6/site-packages/PyBrain-0.3.3-py3.6.egg/pybrain/rl/agents/learning.py", line 50, in getAction
    self.lastaction = self.module.activate(self.lastobs)
  File "xxx/lib/python3.6/site-packages/PyBrain-0.3.3-py3.6.egg/pybrain/structure/modules/module.py", line 123, in activate
    self.forward()
  File "xxx/lib/python3.6/site-packages/PyBrain-0.3.3-py3.6.egg/pybrain/structure/modules/module.py", line 75, in forward
    self.outputbuffer[self.offset])
  File "xxx/lib/python3.6/site-packages/PyBrain-0.3.3-py3.6.egg/pybrain/rl/learners/valuebased/interface.py", line 49, in _forwardImplementation
    outbuf[0] = self.getMaxAction(inbuf[0])
  File "xxx/lib/python3.6/site-packages/PyBrain-0.3.3-py3.6.egg/pybrain/rl/learners/valuebased/interface.py", line 53, in getMaxAction
    values = self.params.reshape(self.numRows, self.numColumns)[state, :].flatten()

The executed code is he rl.py tutorial file :
from scipy import * #@UnusedWildImport
import pylab

from pybrain.rl.environments.mazes import Maze, MDPMazeTask
from pybrain.rl.learners.valuebased import ActionValueTable
from pybrain.rl.agents import LearningAgent
from pybrain.rl.learners import Q, SARSA #@UnusedImport
from pybrain.rl.experiments import Experiment

"""
For later visualization purposes, we also need to initialize the
plotting engine.
"""

pylab.gray()
pylab.ion()

"""
The Environment is the world, in which the agent acts. It receives input
with the .performAction() method and returns an output with
.getSensors(). All environments in PyBrain are located under
pybrain/rl/environments.
One of these environments is the maze environment, which we will use for
this tutorial. It creates a labyrinth with free fields, walls, and an
goal point. An agent can move over the free fields and needs to find the
goal point. Let's define the maze structure, a simple 2D numpy array, where
1 is a wall and 0 is a free field:
"""
structure = array([[1, 1, 1, 1, 1, 1, 1, 1, 1],
                   [1, 0, 0, 1, 0, 0, 0, 0, 1],
                   [1, 0, 0, 1, 0, 0, 1, 0, 1],
                   [1, 0, 0, 1, 0, 0, 1, 0, 1],
                   [1, 0, 0, 1, 0, 1, 1, 0, 1],
                   [1, 0, 0, 0, 0, 0, 1, 0, 1],
                   [1, 1, 1, 1, 1, 1, 1, 0, 1],
                   [1, 0, 0, 0, 0, 0, 0, 0, 1],
                   [1, 1, 1, 1, 1, 1, 1, 1, 1]])

"""
Then we create the environment with the structure as first parameter
and the goal field tuple as second parameter:
"""
environment = Maze(structure, (7, 7))

"""
Next, we need an agent. The agent is where the learning happens. It can
interact with the environment with its .getAction() and
.integrateObservation() methods.
The agent itself consists of a controller, which maps states to actions,
a learner, which updates the controller parameters according to the
interaction it had with the world, and an explorer, which adds some
explorative behaviour to the actions. All standard agents already have a
default explorer, so we don't need to take care of that in this
tutorial.
The controller in PyBrain is a module, that takes states as inputs and
transforms them into actions. For value-based methods, like the
Q-Learning algorithm we will use here, we need a module that implements
the ActionValueInterface. There are currently two modules in PyBrain
that do this: The ActionValueTable for discrete actions and the
ActionValueNetwork for continuous actions. Our maze uses discrete
actions, so we need a table:
"""

controller = ActionValueTable(81, 4)
controller.initialize(1.)

"""
The table needs the number of states and actions as parameters. The standard
maze environment comes with the following 4 actions: north, east, south, west.
Then, we initialize the table with 1 everywhere. This is not always necessary
but will help converge faster, because unvisited state-action pairs have a
promising positive value and will be preferred over visited ones that didn't
lead to the goal.
Each agent also has a learner component. Several classes of RL learners
are currently implemented in PyBrain: black box optimizers, direct
search methods, and value-based learners. The classical Reinforcement
Learning mostly consists of value-based learning, in which of the most
well-known algorithms is the Q-Learning algorithm. Let's now create
the agent and give it the controller and learner as parameters.
"""

learner = Q()
agent = LearningAgent(controller, learner)

"""
So far, there is no connection between the agent and the environment. In fact,
in PyBrain, there is a special component that connects environment and agent: the
task. A task also specifies what the goal is in an environment and how the
agent is rewarded for its actions. For episodic experiments, the Task also
decides when an episode is over. Environments usually bring along their own
tasks. The Maze environment for example has a MDPMazeTask, that we will use.
MDP stands for "markov decision process" and means here, that the agent knows
its exact location in the maze. The task receives the environment as parameter.
"""

task = MDPMazeTask(environment)

"""
Finally, in order to learn something, we create an experiment, tell it both
task and agent (it knows the environment through the task) and let it run
for some number of steps or infinitely, like here:
"""

experiment = Experiment(task, agent)

while True:
    experiment.doInteractions(100)
    agent.learn()
    agent.reset()

    pylab.pcolor(controller.params.reshape(81,4).max(1).reshape(9,9))
    pylab.draw()

"""
Above, the experiment executes 100 interactions between agent and
environment, or, to be exact, between the agent and the task. The task
will process the agent's actions, possibly scale it and hand it over to
the environment. The environment responds, returns the new state back to
the task which decides what information should be given to the agent.
The task also gives a reward value for each step to the agent.
After 100 steps, we call the agent's .learn() method and then reset it.
This will make the agent forget the previously executed steps but of
course it won't undo the changes it learned.
Then the loop is repeated, until a desired behaviour is learned.
In order to observe the learning progress, we visualize the controller
with the last two code lines in the loop. The ActionValueTable consists
of a scalar value for each state/action pair, in this case 81x4 values.
A nice way to visualize learning is to only consider the maximum value
over all actions for each state. This value is called the state-value V
and is defined as V(s) = max_a Q(s, a).
We plot the new table after learning and resetting the agent, INSIDE the
while loop. Running this code, you should see the shape of the maze and
a change of colors for the free fields. During learning, colors may jump
and change back and forth, but eventually the learning should converge
to the true state values, having higher scores (brigher fields) the
closer they are to the goal.
"""

Is there any known way to fix it in order to get the example code working ?
Thanks !

I just modified to sources that raised the error.
In the file interface.py modify line 53 to:
values = self.params.reshape(self.numRows, self.numColumns)[int(state), :].flatten() #state appears to be float
In the file /pybrain/datasets/sequential.py modify line 46 to:
return self.getField(field)[int(seq[index]) : ] #appears to be float
That fixed the issue for me!

Thanks for the tip !

The problem still exists, alexf1991 solution didn't work (files must have changed).
Any hint?

Sorry, I´m not working with pybrain anymore...
You may need to debug the source files yourself. There could also be issues with different python versions.

Same issue here. I'm running PyBrain with Python 3.6, wild eyed guess is that's my issue.

Same error manifests for me off of clean installs of Python 2.7 and Python 3.6. Next I'll try seeing if PyBrain has a test suite to see if I can use that to verify an out-of-the-box install.

Any one can help on this issue?
Even if I have changed the codes accordingly, the issue still exists.

@QQ12657890 seems to work fine on Linux, I prefer Windows but just to run pybrain I set up a VM and then installed everything (pip3 install numpy scipy matplotlib ipython jupyter pandas sympy nose) but don't do pip3 install pybrain because it won't work. Instead, do:
git clone https://github.com/pybrain/pybrain.git
cd pybrain
sudo python3 setup.py install
Then it works like it should. :)

The problem remains if the environment grid is not square -- if the Maze command is passed a matrix whose row dim != col dim.


Colorful console outputs for passed and failed tests, assertions

We need colorful console outputs for passed and failed tests / assertions.
This makes it easier to find failed tests.
Passed tests and assertions should be green
Failed assertions should be orange
Failed tests should be red

This feature is implemented in version 0.2.7

#207