-
Notifications
You must be signed in to change notification settings - Fork 67
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
Accept optional argument in ArrayValue.__array__ #159
Conversation
That's a pretty great github jinx! I've added the test. Testing this code path does require adding |
Maybe instead do:
so that it only installs numpy if the test is run? |
I guess that makes sense,(*) though it'll evidently alter the That I might even suggest that a call like that to (*) Except that it has to be |
PyCall has something like that with |
@@ -1,4 +1,7 @@ | |||
@testset "import" begin | |||
@test pymoduleexists("sys") | |||
@test pymoduleexists("os") | |||
@test !pymoduleexists(randstring(32)) |
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.
@test !pymoduleexists(randstring(32)) | |
@test !pymoduleexists("rDJb5uy3eTorFw4c7UbcGOC59FjVGcnB") # randstring(32) |
No reason to choose a different random string for each test run.
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.
(Then you can also remove the Random
dependency.)
Thanks for the PR! Could you revert all the changes except those to array.jl please? I'm happy to discuss pymoduleexists in another ticket, though my gut is to just let the user call find_spec themselves. I don't mind this not being tested right now, this clearly works, and there is a lot of test writing to be done anyway. |
I've just pushed the changes to |
I ran into a situation when passing an
SVector{4, Float64}
to a python function whereArrayValue.__array__
was called with the optionaldtype
argument, which is standard for numpy, but caused an error here. Adding this option to the call made the conversion work.