-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix return code for asn_from_list and skycell_asn, remove unused scripts, cleanup skycell_asn #1538
fix return code for asn_from_list and skycell_asn, remove unused scripts, cleanup skycell_asn #1538
Conversation
9648a5a
to
c1afe2a
Compare
@@ -43,7 +43,7 @@ def asn_from_list(items, rule=DMS_ELPP_Base, **kwargs): | |||
return asn | |||
|
|||
|
|||
class Main: | |||
def _cli(args=None): |
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.
Including a class as a script in pyproject.toml
as is done on main:
Line 95 in bee71ba
asn_from_list = "romancal.associations.asn_from_list:Main" |
results in an installed script containing the following line:
sys.exit(Main())
This is problematic because Main()
is "truthy" resulting in the script returning 1 on success. By switching this to a function (with no return value) the script becomes:
sys.exit(main())
and the no return value (None) is "falsey" leading to a return code of 0 (success) when the script succeeds.
help="The release product when creating the association", | ||
) | ||
|
||
parser.add_argument( |
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.
I believe this is unused both on main and with this PR.
"The rule to base the association structure on." ' Default: "%(default)s"' | ||
), | ||
) | ||
parser.add_argument( |
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.
I believe this is unused both on main and with this PR.
help="Root string for file to write association to", | ||
) | ||
|
||
parser.add_argument( |
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.
I believe this is unused both on main and with this PR.
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1538 +/- ##
=======================================
Coverage 78.10% 78.11%
=======================================
Files 117 117
Lines 7642 7639 -3
=======================================
- Hits 5969 5967 -2
+ Misses 1673 1672 -1 ☔ View full report in Codecov by Sentry. |
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.
Looks good to me!
c4dc053
to
7e026eb
Compare
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.
Looks good to me!
cdd9038
to
800fd01
Compare
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.
Still looks good to me!
This PR fixes the return code for
asn_from_list
andskycell_asn
when they succeed (see #1535).Which sorting out that fix I saw that:
I left a number of in-line comments with some important ones about unused command line arguments for "skycell_asn" (which are not modified in this PR).
Closes #1535
Regtests all pass: https://github.com/spacetelescope/RegressionTests/actions/runs/12018368084
Tasks
24Q4_B15
(use the latest build if not sure)no-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)docs/
pageokify_regtests
to update the truth filesnews fragment change types...
changes/<PR#>.general.rst
: infrastructure or miscellaneous changechanges/<PR#>.docs.rst
changes/<PR#>.stpipe.rst
changes/<PR#>.associations.rst
changes/<PR#>.scripts.rst
changes/<PR#>.mosaic_pipeline.rst
changes/<PR#>.patch_match.rst
steps
changes/<PR#>.dq_init.rst
changes/<PR#>.saturation.rst
changes/<PR#>.refpix.rst
changes/<PR#>.linearity.rst
changes/<PR#>.dark_current.rst
changes/<PR#>.jump_detection.rst
changes/<PR#>.ramp_fitting.rst
changes/<PR#>.assign_wcs.rst
changes/<PR#>.flatfield.rst
changes/<PR#>.photom.rst
changes/<PR#>.flux.rst
changes/<PR#>.source_detection.rst
changes/<PR#>.tweakreg.rst
changes/<PR#>.skymatch.rst
changes/<PR#>.outlier_detection.rst
changes/<PR#>.resample.rst
changes/<PR#>.source_catalog.rst