Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHuwe committed Mar 1, 2024
2 parents 8deb17f + 5f7cb8b commit d9fd901
Show file tree
Hide file tree
Showing 100 changed files with 648 additions and 482 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/roman_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
pytest-results-summary: true
- linux: py39-webbpsf
pytest-results-summary: true
- linux: py310-webbpsf
- linux: py310-webbpsf-nolegacypath
pytest-results-summary: true
- linux: py311-ddtrace-webbpsf
pytest-results-summary: true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests_devdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ jobs:
pytest-results-summary: true
- macos: py3-devdeps-webbpsf
pytest-results-summary: true
- linux: py312-devdeps
python_version: "3.12-dev"
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ repos:
- id: text-unicode-replacement-char

- repo: https://github.com/asottile/pyupgrade
rev: 'v3.15.0'
rev: 'v3.15.1'
hooks:
- id: pyupgrade
args: ["--py38-plus"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.13'
rev: 'v0.2.2'
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -43,12 +43,12 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.2.0
hooks:
- id: black

- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
rev: 1.7.7
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
Expand Down
42 changes: 38 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
0.13.1 (unreleased)
0.14.1 (unreleased)
==================

general
-------

- Update the ``dqflags`` to use the ones stored in ``roman_datamodels`` [#1099]

documentation
-------------

- Fixed datamodels documentation to use correct API. [#1112]

dq_init
-------

- Copy reference pixels during ``dq_init`` to avoid larger files in later
processing steps [#1121]


0.14.0 (2024-02-12)
===================

general
-------

- Updated the ``compare_asdf`` diff reports to include descriptive information
about what is being compared. [#1044]

dq_init
-------

- Add the ability to copy resultantdq from a SDF science raw model to the new rampmodel created by dq_init [#1085]

outlier_detection
-----------------

Expand All @@ -14,7 +45,6 @@ jump detection

- Added uneven ramp-jump detection docs. [#1035]


documentation
-------------

Expand All @@ -24,12 +54,15 @@ documentation

- added user documentation for ``roman_static_preview`` script [#1046]


ramp_fitting
------------

- Add default WCS when constructing image model from ramp model [#1072]

resample
--------

- Update resample step to handle the L3 meta data [#1057]

general
-------
Expand All @@ -38,7 +71,6 @@ general

- Fix bug where ``compare_asdf`` failed to detect ``DataModel`` type differences. [#1066]


0.13.0 (2023-11-28)
===================

Expand Down Expand Up @@ -113,6 +145,8 @@ refpix

- Update cal_step, add suffix and add to the exposure pipeline [#890]

- Enable apodized FFT interpolation by default. [#1017]

resample
--------

Expand Down
4 changes: 2 additions & 2 deletions JenkinsfileRT
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def pip_install_args = "--index-url ${pip_index} --progress-bar=off"
// Define environment variables needed for the regression tests
env_vars = [
"TEST_BIGDATA=https://bytesalad.stsci.edu/artifactory",
"CRDS_CONTEXT=roman_0052.pmap",
"CRDS_SERVER_URL=https://serverless",
"CRDS_CONTEXT=roman_0056.pmap",
"CRDS_SERVER_URL=https://roman-serverless",
'CRDS_PATH=/grp/crds/roman/test/',
'DD_ENV=ci',
'DD_SERVICE=romancal',
Expand Down
4 changes: 2 additions & 2 deletions JenkinsfileRT_dev
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def pip_install_args = "--index-url ${pip_index} --progress-bar=off"
// Define environment variables needed for the regression tests
env_vars = [
"TEST_BIGDATA=https://bytesalad.stsci.edu/artifactory",
"CRDS_CONTEXT=roman_0052.pmap",
"CRDS_SERVER_URL=https://serverless",
"CRDS_CONTEXT=roman_0056.pmap",
"CRDS_SERVER_URL=https://roman-serverless",
'CRDS_PATH=/grp/crds/roman/test/',
'WEBBPSF_PATH=/grp/jwst/ote/webbpsf-data',
'PYSYN_CDBS=/grp/hst/cdbs',
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ an [issue](https://github.com/spacetelescope/romancal/issues).
| 0.11.0 | 23Q3_B10 | 047 | May 2023 | Release for Build 23Q3_B10 (Build 10) |
| 0.12.0 | 23Q4_B11 | 051 | Aug 2023 | Release for Build 23Q4_B11 (Build 11) |
| 0.13.0 | 24Q1_B12 | 052 | Nov 2023 | Release for Build 24Q1_B12 (Build 12) |
| 0.14.0 | 24Q2_B13 | 056 | Feb 2024 | Release for Build 24Q2_B13 (Build 13) |


Note: CRDS_CONTEXT values flagged with an asterisk in the above table are estimates
Expand Down
Binary file modified docs/_static/roman_logo_black_w200px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/roman_logo_white_w100px.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 20 additions & 2 deletions docs/conftest.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
import os
from contextlib import contextmanager

import pytest

# chdir contextmanager was added with Python 3.11
try:
from contextlib import chdir
except ImportError:

@contextmanager
def chdir(path):
old_path = os.getcwd()

try:
os.chdir(path)
yield
finally:
os.chdir(old_path)


@pytest.fixture(autouse=True)
def _docdir(request):
# Trigger ONLY for doctestplus.
doctest_plugin = request.config.pluginmanager.getplugin("doctestplus")
if isinstance(request.node.parent, doctest_plugin._doctest_textfile_item_cls):
tmpdir = request.getfixturevalue("tmpdir")
with tmpdir.as_cwd():
tmp_path = request.getfixturevalue("tmp_path")
with chdir(tmp_path):
yield
else:
yield
6 changes: 3 additions & 3 deletions docs/roman/datamodels/datamodels_asdf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ The ASDF equivalent is
120.05
.. HINT::

If you trigger an error,
"ValueError: assignment destination is read-only"
make sure the asdf file was opened with copy_arrays=True, or
Expand Down Expand Up @@ -199,16 +200,15 @@ Or you can use the asdf.info method to view the contents of the tree

.. code:: python
import asdf
asdf.info(d_uncal)
>> asdf.info(d_uncal)
Will print the same information as the above `d_uncal.info` command but also
gives you enhanced capabilities. For instance you can display the first three
lines for each of the meta entries,

.. code:: python
>>> asdf.info(d_uncal.meta,max_rows=(None, 3)) # doctest: +SKIP
>>> asdf.info(d_uncal.meta, max_rows=(None, 3)) # doctest: +SKIP
root (DNode)
├─aperture (Aperture)
│ ├─name (str): WFI_CEN
Expand Down
48 changes: 25 additions & 23 deletions docs/roman/datamodels/metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ string will raise an exception.

.. code-block:: python
from roman_datamodels.testing.factories import create_wfi_image
from roman_datamodels import datamodels as rdmfrom romancal.datamodels import ImageModel
model = rdm.ImageModel(create_wfi_image())
model.meta.target.ra = "foo"
>>> from roman_datamodels import datamodels as rdm
>>> from roman_datamodels.maker_utils import mk_datamodel
>>> model = mk_datamodel(rdm.ImageModel)
>>> model.meta.target.ra = "foo" # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ddavis/miniconda3/envs/rcal_dev/lib/python3.9/site-packages/roman_datamodels/stnode.py", line 183, in __setattr__
Expand Down Expand Up @@ -53,31 +54,32 @@ model.

.. code-block:: python
from roman_datamodels import datamodels as rdm
from roman_datamodels.testing.factories import create_wfi_science_raw
# Create a model of the desired type
raw = create_wfi_science_raw()
raw_science = rdm.ScienceRawModel(raw)
# find the associated Schema
raw_science.schema_uri
'asdf://stsci.edu/datamodels/roman/schemas/wfi_science_raw-1.0.0'
>>> raw_science = mk_datamodel(rdm.ScienceRawModel) # Create a model of the desired type
>>> print(raw_science.schema_uri) # find the associated Schema
asdf://stsci.edu/datamodels/roman/schemas/wfi_science_raw-1.0.0
An alternative method to get and set metadata values is to use a
dot-separated name as a dictionary lookup. This is useful for
databases, such as CRDS, where the path to the metadata element is
most conveniently stored as a string. The following two lines are
equivalent::
equivalent

.. code-block:: python
print(raw_science.meta['observation']['start_time'])
print(raw_science.meta.observation.start_time)
>>> print(raw_science.meta['visit']['start_time'])
2020-01-01T00:00:00.000
>>> print(raw_science.meta.visit.start_time)
2020-01-01T00:00:00.000
In addtion the times are stored as Astropy time objects and so the date can be
displayed using various formats::
In addition the times are stored as Astropy time objects and so the date can be
displayed using various formats

.. code-block:: python
print(raw_science.meta.observation.start_time.iso)
2028-12-22 05:17:56.203
print(raw_science.meta.observation.start_time.mjd)
62127.22078938165
print(raw_science.meta.observation.start_time.yday)
2028:357:05:17:56.203
>>> print(raw_science.meta.visit.start_time.iso)
2020-01-01 00:00:00.000
>>> print(raw_science.meta.visit.start_time.mjd)
58849.0
>>> print(raw_science.meta.visit.start_time.yday)
2020:001:00:00:00.000
Loading

0 comments on commit d9fd901

Please sign in to comment.