-
Notifications
You must be signed in to change notification settings - Fork 18
Fix the use of Pset arguments when calling a task in PyRAF CL #193
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
base: main
Are you sure you want to change the base?
Conversation
|
My suggestion was certainly a bit of a hack, as |
|
I wonder about something like this? if tail:
# is pset parameter - get parameter object from its task
p = p.get().getParObject(tail)
try:
p = self.getParObject(p.name)
except KeyError:
p = copy.deepcopy(p)
self.addParam(p)Some thoughts:
|
|
Ideally, we'd have a test for this, of course (I'd need to look at that later if you want me to add one). Sorry, I messed up slightly above (the deepcopy was a last-minute addition); let me just fix that [done]. |
Also, this does not try to re-establish a broken link between the main list and the pset; avoiding potential problems with that. The try..excep clause is added for more robustness; the parameter should already exist in the main list.
|
I think the parameter is guaranteed to exist because it was added during init by So, I added a new commit (and set you as the author to both to make clear who gets the merits :-) ). Ofcourse a test would be great so that we can catch a regression if the needs to be changed again. Do you mind to be added as maintainer so that you could modify the PR yourself? Hidden thought is that it is better to have more people with access to the repository to reduce the bus factor 🚌 |
|
Sure, thank you! |
This implements the suggestion by @jehturner in #192 to explicitly propagate Pset arguments to the main dictionary.
Closes: #192