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

Group models by obs_id for steps that use grouping #1448

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Oct 10, 2024

Group by meta.observation.obs_id.

Fixes: #1259

Regression tests: https://github.com/spacetelescope/RegressionTests/actions/runs/11281421723
show 5 expected failures like the following:

   {'values_changed': {"root['roman']['meta']['group_id']": {'new_value': '0000201001001001001011010001',
                                                            'old_value': 'roman0000211_1101_1'}}}

Tasks

  • request a review from someone specific, to avoid making the maintainers review every PR
  • add a build milestone, i.e. 24Q4_B15 (use the latest build if not sure)
  • Does this PR change user-facing code / API? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see below for change types)
    • update or add relevant tests
    • update relevant docstrings and / or docs/ page
    • start a regression test and include a link to the running job (click here for instructions)
      • Do truth files need to be updated ("okified")?
        • after the reviewer has approved these changes, run okify_regtests to update the truth files
  • if a JIRA ticket exists, make sure it is resolved properly
news fragment change types...
  • changes/<PR#>.general.rst: infrastructure or miscellaneous change
  • changes/<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

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.15%. Comparing base (e215f87) to head (d139a4b).
Report is 185 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1448   +/-   ##
=======================================
  Coverage   76.15%   76.15%           
=======================================
  Files         115      115           
  Lines        7638     7638           
=======================================
  Hits         5817     5817           
  Misses       1821     1821           

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

@braingram braingram marked this pull request as ready for review October 11, 2024 12:31
@braingram braingram requested a review from a team as a code owner October 11, 2024 12:31
@braingram braingram changed the title Obs id grouping Group models by obs_id for steps that use grouping Oct 11, 2024
@braingram braingram requested a review from schlafly October 11, 2024 12:37
@schlafly
Copy link
Collaborator

Thanks, this looks good.

A separate issue, but I hadn't appreciated that we were storing group_id in the files. I guess that's okay? It's not in our schema, so it's an optional added thing. Apparently tweakreg adds it, even for grism data where it's not doing anything and the step gets skipped.

This test seems to imply some special structure is expected in group_id, but I think the test itself is the only thing that assumes that structure so it's probably fine.

img1.meta.observation["program"] = "-program_id1"
img2.meta.observation["program"] = "-program_id2"
img1.meta["filename"] = "file1.asdf"
img2.meta["filename"] = "file2.asdf"
res = trs.TweakRegStep.call([img1, img2])
assert len(res.group_names) == 2
with res:
for r, i in zip(res, [img1, img2]):
assert (
r.meta.group_id.split("-")[1]
== i.meta.observation.program.split("-")[1]
)
res.shelve(r, modify=False)

Anyway, this change looks good and I'll spin some group_id investigation into a separate issue. Can I ask you to handle the okifying? Thanks!

@schlafly
Copy link
Collaborator

FWIW, #1450 .

@braingram
Copy link
Collaborator Author

@schlafly I rebased this and resolved the conflict (2 lines in a unit test following #1445).

Any objection if I merge this?

@schlafly
Copy link
Collaborator

Go ahead. Please okify afterward, thanks! We've had a lot of other regtest-changing updates in the meantime, so it will require a fresh regtest to okify.

@braingram braingram merged commit 07d66cf into spacetelescope:main Oct 23, 2024
31 checks passed
@braingram braingram deleted the obs_id_grouping branch October 23, 2024 20:34
@braingram
Copy link
Collaborator Author

Regression tests for okifying started here: https://github.com/spacetelescope/RegressionTests/actions/runs/11487718465

I'll okify these when they finish.

@braingram
Copy link
Collaborator Author

Results okified, this should be a clean run: https://github.com/spacetelescope/RegressionTests/actions/runs/11488484303

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

Successfully merging this pull request may close these issues.

group_id in romancal
2 participants