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

Rcal 596 Updates for association processing #241

Merged
merged 25 commits into from
Jul 27, 2023

Conversation

ddavis-stsci
Copy link
Collaborator

@ddavis-stsci ddavis-stsci commented Jul 18, 2023

Resolves RCAL-nnnn

Closes #242

This PR adds a method to identify an association file for processing in the Roman pipeline along a test.
Regresssion testing will be done for the rcal-596 ticket.

Checklist

pytest tests
=============================================================== test session starts ================================================================
platform darwin -- Python 3.11.0, pytest-7.4.0, pluggy-1.2.0
rootdir: /Users/ddavis/src/Roman/roman_datamodels
configfile: pyproject.toml
plugins: remotedata-0.4.0, asdf-2.15.0, hypothesis-6.82.0, doctestplus-0.13.0, cov-4.1.0, filter-subpackage-0.1.2, mock-3.11.1, astropy-header-0.2.2, astropy-0.10.0, ci-watson-0.6.1, openfiles-0.5.0, env-0.8.2, arraydiff-0.5.0
collected 1115 items

tests/test_maker_utils.py .................................................................................................................. [ 10%]
............................................................................................................................... [ 21%]
tests/test_models.py ....................................................................................................................... [ 32%]
............................................................................................................................................ [ 44%]
............................................................................................................................................ [ 57%]
............................................................................................................................................ [ 69%]
...................................................................... [ 76%]
tests/test_open.py ...................................................... [ 81%]
tests/test_stnode.py ....................................................................................................................... [ 91%]
............................................................................................ [100%]

============================================================== 1115 passed in 41.48s

@ddavis-stsci ddavis-stsci self-assigned this Jul 18, 2023
@ddavis-stsci ddavis-stsci added enhancement New feature or request associations labels Jul 18, 2023
@ddavis-stsci ddavis-stsci added this to the 23Q4_B11 milestone Jul 18, 2023
Copy link
Contributor

@WilliamJamieson WilliamJamieson left a comment

Choose a reason for hiding this comment

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

It is not clear to me why it is necessary to revert #219; however, in any case the current merge conflict will require a major change to the proposed rdm_open changes.

As the currently proposed changes are a bit overkill, I suggest replacing

# Temp fix to catch JWST args before being passed to asdf open
if "asn_n_members" in kwargs:
del kwargs["asn_n_members"]
with

        if isinstance(init, str):
            exts = Path(init).suffixes
            if not exts:
                raise ValueError(f"Input file path does not have an extension: {init}")

            # Assume json files are asn and return them
            if exts[0] == "json":
                return init

        # Temp fix to catch JWST args before being passed to asdf open
        if "asn_n_members" in kwargs:
            del kwargs["asn_n_members"]

(Additionally, add from pathlib import Path as part of the imports)

This effectively implements the same guarding logic and should return the file path in the asn (assumed when json is passed) as this code currently does.

@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Patch coverage: 28.57% and project coverage change: -0.20% ⚠️

Comparison is base (1773850) 96.87% compared to head (cb927e9) 96.67%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
- Coverage   96.87%   96.67%   -0.20%     
==========================================
  Files          28       28              
  Lines        2399     2406       +7     
==========================================
+ Hits         2324     2326       +2     
- Misses         75       80       +5     
Files Changed Coverage Δ
src/roman_datamodels/datamodels/_utils.py 82.05% <28.57%> (-11.70%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zacharyburnett
Copy link
Collaborator

docs build is failing with the following import error:

  File "/home/docs/checkouts/readthedocs.org/user_builds/roman-datamodels/conda/241/lib/python3.11/site-packages/roman_datamodels/datamodels/__init__.py", line 2, in <module>
    from ._datamodels import *  # noqa: F403
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/roman-datamodels/conda/241/lib/python3.11/site-packages/roman_datamodels/datamodels/_datamodels.py", line 147, in <module>
    class InverseLinearityRefModel(_DataModel):
  File "/home/docs/checkouts/readthedocs.org/user_builds/roman-datamodels/conda/241/lib/python3.11/site-packages/roman_datamodels/datamodels/_datamodels.py", line 148, in InverseLinearityRefModel
    _node_type = stnode.InverseLinearityRef
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'roman_datamodels.stnode' has no attribute 'InverseLinearityRef'

@ddavis-stsci ddavis-stsci marked this pull request as ready for review July 26, 2023 18:06
@ddavis-stsci ddavis-stsci requested a review from a team as a code owner July 26, 2023 18:06
@ddavis-stsci ddavis-stsci merged commit 7617c66 into spacetelescope:main Jul 27, 2023
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
associations enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updates to identify association files for processing
3 participants