Skip to content

Commit

Permalink
update docs to reflect lack of assignment validation (#1504)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Nov 22, 2024
2 parents 78c7dc4 + df0ca76 commit 825ed17
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions changes/1504.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove assignment validation example from docs.
8 changes: 4 additions & 4 deletions docs/roman/datamodels/metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ observation was made::

print(model.meta.observation.start_time)

Metadata values are automatically type-checked against the schema when
they are set. Therefore, setting a attribute which expects a number to a
string will raise an exception.
Metadata values will be validated against the schema when ``validate``
is called, when the data model is saved or when a file is read.

.. code-block:: python
>>> from roman_datamodels import datamodels as rdm
>>> from roman_datamodels.maker_utils import mk_datamodel
>>> model = mk_datamodel(rdm.ImageModel)
>>> model.meta.pointing.target_ra = "foo" # doctest: +IGNORE_EXCEPTION_DETAIL
>>> model.meta.pointing.target_ra = "foo"
>>> model.validate() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/python/lib/python3.12/site-packages/roman_datamodels/stnode/_node.py", line 251, in __setattr__
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ dependencies = [
"photutils >=1.13.0",
"pyparsing >=2.4.7",
"requests >=2.26",
"roman_datamodels>=0.22.0,<0.23.0",
# "roman_datamodels @ git+https://github.com/spacetelescope/roman_datamodels.git",
# "roman_datamodels>=0.22.0,<0.23.0",
"roman_datamodels @ git+https://github.com/spacetelescope/roman_datamodels.git",
"scipy >=1.11",
"stcal>=1.10.0,<1.11.0",
"stcal>=1.10.0,<1.11.0",
# "stcal @ git+https://github.com/spacetelescope/stcal.git@main",
"stpipe >=0.7.0,<0.8.0",
# "stpipe @ git+https://github.com/spacetelescope/stpipe.git@main",
Expand Down

0 comments on commit 825ed17

Please sign in to comment.