Skip to content

Commit

Permalink
remove default values from docs (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Sep 23, 2024
2 parents cb99fba + da8ecf5 commit 574d9ae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
1 change: 1 addition & 0 deletions changes/1419.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update docs to not include default fake values.
37 changes: 21 additions & 16 deletions docs/roman/datamodels/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,23 @@ Reading a data model
If you have an existing data file it is straightforward to access the file
using python.

.. testsetup::
>>> from roman_datamodels import datamodels as rdm
>>> from roman_datamodels.maker_utils import mk_datamodel
>>> fn = 'r0019106003005004023_03203_0034_WFI01_cal.asdf'
>>> image_model = mk_datamodel(rdm.ImageModel)

# set some metadata for the below tests
>>> image_model.meta.filename = fn


.. code-block:: python
>>> from roman_datamodels import datamodels as rdm
>>> fn = 'r0019106003005004023_03203_0034_WFI01_cal.asdf'
>>> data_file = rdm.open(fn) # doctest: +SKIP
>>> type(data_file) # doctest: +SKIP
roman_datamodels.datamodels.ImageModel
>>> image_model = rdm.open(fn) # doctest: +SKIP
>>> type(image_model)
<class 'roman_datamodels.datamodels._datamodels.ImageModel'>
Where the output of the type command tells you that you have imported an
ImageModel from roman_datamodels,
Expand All @@ -54,13 +64,13 @@ To create a new `ImageModel`, you can just
>>> from roman_datamodels import datamodels as rdm
>>> from roman_datamodels.maker_utils import mk_datamodel
>>> image_model = mk_datamodel(rdm.ImageModel)
>>> type(image_model)
>>> new_model = mk_datamodel(rdm.ImageModel)
>>> type(new_model)
<class 'roman_datamodels.datamodels._datamodels.ImageModel'>
.. warning::

The values in the file generated by create_wfi_image are intended to be
The values in the file generated by mk_datamodel are intended to be
clearly incorrect and should be replaced if the file is intended to be used
for anything besides a demonstration.

Expand Down Expand Up @@ -134,7 +144,7 @@ You can examine the contents of your model from within python using
>>> print("\n".join("{: >20}\t{}".format(k, v) for k, v in image_model.items()), "\n") # doctest: +ELLIPSIS
meta.calibration_software_version 9.9.0
meta.sdf_software_version 7.7.7
meta.filename dummy value
meta.filename r0019106003005004023_03203_0034_WFI01_cal.asdf
meta.file_date 2020-01-01T00:00:00.000
meta.model_type ImageModel
meta.origin STSCI
Expand All @@ -148,15 +158,10 @@ or you can print specifics

.. code-block:: python
>>> print("\n".join("{: >20}\t{}".format(k, v) for k, v in image_model.meta.wcsinfo.items()), "\n")
v2_ref -999999
v3_ref -999999
vparity -999999
v3yangle -999999
ra_ref -999999
dec_ref -999999
roll_ref -999999
s_region dummy value
>>> print("\n".join("{: >20}\t{}".format(k, v) for k, v in image_model.meta.instrument.items()))
name WFI
detector WFI01
optical_element F158
.. note::

Expand Down

0 comments on commit 574d9ae

Please sign in to comment.