Skip to content
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

convert FromCommandLine to str before building Step #78

Merged
merged 2 commits into from Dec 23, 2022

Conversation

braingram
Copy link
Collaborator

When string arguments are passed in via the command line they are converted to FromCommandLine instances. Convert them back to strings before providing them as keyword arguments while building the step.

It appears this conversion is only needed to resolve the path of input and output files provided to the step

if not isinstance(path, cmdline.FromCommandLine):
try:
path = str(path)
except ValueError:
pass
path = os.path.join(root_dir, path)
path = os.path.abspath(path)

This will hopefully fix the failing regression tests for spacetelescope/jwst#7403 and other instances of similar failures.

When string arguments are passed in via the command line
they are converted to FromCommandLine instances. Convert them
back to strings before providing them as keyword arguments
while building the step.
@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Base: 0.00% // Head: 0.00% // No change to project coverage 👍

Coverage data is based on head (dac38ef) compared to base (454314b).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@          Coverage Diff           @@
##           master     #78   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          25      25           
  Lines        3060    3066    +6     
======================================
- Misses       3060    3066    +6     
Impacted Files Coverage Δ
src/stpipe/step.py 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hbushouse
Copy link
Collaborator

Regtest run using this PR branch shows no errors for the niriss_soss tests that previously crashed!
https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/518/
(other failures are expected, due to other mergers)

Copy link
Collaborator

@hbushouse hbushouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it's the right change to make, but it seems to work!

@nden
Copy link
Collaborator

nden commented Dec 23, 2022

This looks reasonable to me. I think the problem started when list arguments were enabled again in #73.
Is it possible to come up with a test for this case?

@nden
Copy link
Collaborator

nden commented Dec 23, 2022

I tested manually running a step with list parameters and confirmed this works. Writing a formal test can be done later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants