-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix perferred_lib #283
Closed
+4
−5
Closed
Fix perferred_lib #283
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kwargs
are needed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to remove
**kwargs
the doc string for_numpy_multi_dispatch
should be updated to explicitly state that the dispatching is only impacted by the type ofargs
.What issue did you run into that made you want to remove this? The only downside then is if for some reason we need to dispatch on one of the
kwargs
. At the moment though I guess we don't need this, so we could re-add it later if necessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you further explain the list recursion problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for confusing you. It was not accurate. I looked into it in more detail. I guess it is an edge case when it occurs when registering
list
type to alias.At
DYNAMICS_NUMPY_ALIAS.infer_libs(args[0])
for second argument,args[0] is interpreted as list because
libs
is not None at https://github.com/Qiskit-Extensions/arraylias/blob/275315c2244f4d1c6351642ed7f6ecad0bf7f847/arraylias/alias.py#L343.if
list
type is not registered,libs
is None andlibs
is defined at https://github.com/Qiskit-Extensions/arraylias/blob/275315c2244f4d1c6351642ed7f6ecad0bf7f847/arraylias/alias.py#L345 .This error doesn't occur if we don't register
list
as type to alias.My PR could fix this issue by deleting
kwargs
and changingargs[1:]
to*args[1:]
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I understand now. The follow up questions/comments I have are:
list
again? Was it just forto_dense
andto_sparse
?"scipy_sparse"
and"jax_sparse"
(and"list"
if necessary)? Maybe this change to_preferred_lib
, as well as discussions about how to registerlist
can be included in that PR. It might be beneficial to separate the type registering from the update to themodels
module.