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

roman_datamodels compatibility, move romandeps test to CI workflows #3353

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .github/workflows/ci_cron_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,3 @@ jobs:
python -m pip install tox
- name: Test with tox
run: tox -e py311-test-devdeps-romandeps

ci_cron_tests_stable_roman:
name: Python 3.10 with stable versions of dependencies and Roman
runs-on: ubuntu-latest
if: (github.repository == 'spacetelescope/jdaviz' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Extra CI')))
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.10'
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Test with tox
run: tox -e py310-test-romandeps
7 changes: 7 additions & 0 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ jobs:
toxposargs: --remote-data --run-slow
allow_failure: true

- name: Python 3.11 with stable versions of dependencies and Roman
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-romandeps
toxposargs: --remote-data
allow_failure: true
pllim marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
6 changes: 6 additions & 0 deletions jdaviz/configs/rampviz/plugins/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@
data_reshaped = move_group_axis_last(data)
diff_data_reshaped = move_group_axis_last(diff_data)

# if the ramp cube has no units, assume DN:
if getattr(data_reshaped, 'unit', None) is None:
pllim marked this conversation as resolved.
Show resolved Hide resolved
assumed_unit = u.DN
data_reshaped <<= assumed_unit
diff_data_reshaped <<= assumed_unit

Check warning on line 203 in jdaviz/configs/rampviz/plugins/parsers.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/configs/rampviz/plugins/parsers.py#L200-L203

Added lines #L200 - L203 were not covered by tests

# load these cubes into the cache:
app._jdaviz_helper.cube_cache[ramp_cube_data_label] = NDDataArray(
data_reshaped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ def _extract_from_aperture(self, **kwargs):
# after the fancy indexing above, axis=1 corresponds to groups, and
# operations over axis=0 corresponds to individual pixels:
axis=0
) << nddata.unit
)
if nddata.unit is not None:
collapsed <<= nddata.unit

def expand(x):
# put the resulting 1D profile (counts vs. groups) into the
Expand Down
4 changes: 1 addition & 3 deletions jdaviz/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ def roman_level_1_ramp():
shape = (10, 25, 25)
data_model = mk_datamodel(RampModel, shape=shape, dq=False)

data_model.data = u.Quantity(
100 + 3 * np.cumsum(rng.uniform(size=shape), axis=0), u.DN
)
data_model.data = 100 + 3 * np.cumsum(rng.uniform(size=shape), axis=0)
return data_model


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ docs = [
"sphinx_design"
]
roman = [
"roman_datamodels>=0.17.1",
"roman_datamodels>=0.22.0",
]

[build-system]
Expand Down
Loading