-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tweak include/exclude args to be lists of ints as needed #184
Conversation
@taldcroft Should be able to come up with something nicer that works with the attribute syntax. I just didn't see a good way to deal with this on the Matlab side, and also did not want to write Python subroutines to munge the kwargs as lambda functions in the Matlab. |
for name, val in kwargs.items(): | ||
if name in self.allowed_kwargs: | ||
setattr(self, name, val) | ||
else: | ||
raise ValueError(f'unexpected keyword argument "{name}"') | ||
|
||
|
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.
Oops.
I think you can do the transform in one line:
|
And then make a subclass for those attributes:
|
Yes, np.atleast_1d seems to help just fine. Per my comment in the email thread, I think this can just go in the updated Matlab file and doesn't need a proseco edit. |
Er. I'd prefer to make the Python accept different args in a generalized way rather than hacking the Matlab Python calls. I'm guessing you are going to end up with a lot of repetition in the Matlab/Python calls? |
OK. I didn't see much value added on the Python side and was just trying to avoid yet another release. On the matlab side it was just looking like:
So yeah, you repeat np.atleast_1d 5 times. |
That's not fixing the type to int. I suspect that getting floats will break things, though maybe you've already tested? |
Yes, I was live testing the np.atleast_1d idea. I think the "or floats" was a mistake on my part in reading a stack trace and they were still coming through as numpy ints. |
Though now failing in a different area.
So temporarily fixing on Matlab side with
|
Right, so do we care about this for 4.3 or is the matlab sufficient
|
See #187. |
If we get in a time crunch then the above makes me unhappy but works. |
Define "time crunch". |
Tweak include/exclude args to be lists of ints as needed
The include_, exclude_ kwargs seems to end up as either empty numpy arrays, numpy arrays of floats, or single numpy ints when passed to Python from Matlab with pyexec. I think none of those work in get_aca_catalog. This PR is intended to cast all of them to lists of ints.