-
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
base: main
Are you sure you want to change the base?
Conversation
schema_editor = "romancal.scripts.schema_editor:main" | ||
schemadoc = "romancal.scripts.schemadoc:main" |
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.
Neither of these exist and attempting to run schema_editor
or schemadoc
after installing romancal produces an error.
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.
@@ -20,11 +20,11 @@ | |||
logger.setLevel("INFO") | |||
|
|||
|
|||
def skycell_asn(self): | |||
"""Create the associaton from the list""" | |||
def skycell_asn(filelist, output_file_root, product_type, release_product): |
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 broke apart the def skycell_asn(self)
function definition here. A docstring improvement would also be worth doing as this is a documented function. I did not make major changes in this PR because:
- the splitting of
self
is already an improvement - I'm not sure what are the desired descriptions of these variables
A code suggestion for the docstring is appreciated.
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.
oldestdeps failure is addressed in #1539 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1538 +/- ##
==========================================
- Coverage 76.68% 76.67% -0.01%
==========================================
Files 120 120
Lines 7831 7829 -2
==========================================
- Hits 6005 6003 -2
Misses 1826 1826 ☔ View full report in Codecov by Sentry. |
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 running at: 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