-
Notifications
You must be signed in to change notification settings - Fork 43
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
Rory/ab13md #171
Rory/ab13md #171
Conversation
I don't understand the MacOS failures. From one of the the failing runs, there's something that looks weird, though it may be unrelated: https://github.com/python-control/Slycot/runs/6246110913?check_suite_focus=true#step:4:1970
I assume this is a mistake -- we don't want to download slycot 0.4.0 from PyPI for testing, do we? I don't follow the final error message; I guess it failed, but why?
|
Some do, some don't. See e.g.
Not sure if this would by better to apply in one wrapper layer further up (python-control). The docstring says, give by an array, so it expects an array.
If I understand correctly, it only makes a difference in the optimal size for performance.
Agreed. |
slycot/analysis.py
Outdated
arg_list = ['fact' + hidden, 'n' + hidden, 'z', 'ldz' + hidden, | ||
'm' + hidden, 'nblock', 'itype', 'x', 'bound', 'd', 'g', |
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.
fact
and n
are not hidden
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.
So "hidden" here is not arguments hidden from the caller of slycot.ab13md?
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.
Those are the arguments of the Fortran subroutine hidden in the Python call signature of _wrapper.ab13md()
. The arg_list
is used for the error message handler which references the argument count and order of the Fortran routine.
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.
OK, will fix.
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.
Hm, what about m
and info
? m
is apparently optional, despite my attempts to make it required in analysis.pyf, and info
is hidden in ab13ed
.
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.
Not sure about m
. Maybe f2py is confused by the dimension(m)
and depend(m)
stuff.
info
shouldn't be hidden. It is in the output and you need it for the error handler.
It is building 0.4.0(.0) something and the conda can't resolve the requirement. I assume some conda or scikit-build related regression. Definitely not relevant to this PR |
Great, in that case I'll remove
Fair enough. Also, I feel like if I do it here I'll be expected to change the whole of Slycot to match!
Yes, pretty sure that's what it's for.
That would probably be easiest. I don't think we can easily wrap ILAENV -- it's in LAPACK, not SLICOT. I guess we could access via ctypes? I don't want to do that as part of this PR, though; I'll leave it for when someone is working with big enough systems that it makes a difference. I think this could be added in a backward-compatible way: add keyword-only arguments for optimal parameters as a tuple, and add a separate Python function ( |
Make n a hidden argument for ab13md in analysis.pyf. Remove hidden qualifier for fact, m, and info.
You can provide f2py with a Fortran wrapper routine calling ILAENV. See e.g. the XERBLA override. |
Co-authored-by: Ben Greiner <code@bnavigator.de>
Co-authored-by: Ben Greiner <code@bnavigator.de>
Thanks @bnavigator . |
Unless you want to also hide |
Good idea. |
I think this is fine as-is; some remarks (or, depending on your point of view, gripes):
n
? Why don't we get it fromZ.shape[0]
? I followed the convention of other Slycot routines, but I don't see why we do this.np.atleast_1d
andnp.atleast_2d
as necessary on Slycot function args? This would improve caller-friendliness, and, IMO, match expectations for Numpy-associated code.scipy.linalg.lapack
. I didn't investigate the option of callingAB13MD
to query optimal size parameters. I don't know if this is a major issue.