From 7030febb9efe476118faaba3b20bd76dc52f8a55 Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 20 Sep 2024 18:05:21 -0400 Subject: [PATCH] Use different value for filename --- src/roman_datamodels/maker_utils/_base.py | 1 + src/roman_datamodels/maker_utils/_basic_meta.py | 4 ++-- tests/test_stnode.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/roman_datamodels/maker_utils/_base.py b/src/roman_datamodels/maker_utils/_base.py index 70c7aecf..77193ad8 100644 --- a/src/roman_datamodels/maker_utils/_base.py +++ b/src/roman_datamodels/maker_utils/_base.py @@ -2,6 +2,7 @@ NONUM = -999999 NOSTR = "?" +NOFN = "none" MESSAGE = "This function assumes shape is 2D, but it was given at least 3 dimensions" diff --git a/src/roman_datamodels/maker_utils/_basic_meta.py b/src/roman_datamodels/maker_utils/_basic_meta.py index b4d8d0bc..4aa395f7 100644 --- a/src/roman_datamodels/maker_utils/_basic_meta.py +++ b/src/roman_datamodels/maker_utils/_basic_meta.py @@ -2,7 +2,7 @@ from roman_datamodels import stnode -from ._base import NOSTR +from ._base import NOFN, NOSTR def mk_calibration_software_version(**kwargs): @@ -36,7 +36,7 @@ def mk_filename(**kwargs): ------- roman_datamodels.stnode.Filename """ - return stnode.Filename(kwargs.get("filename", NOSTR)) + return stnode.Filename(kwargs.get("filename", NOFN)) def mk_file_date(**kwargs): diff --git a/tests/test_stnode.py b/tests/test_stnode.py index 0cf72022..c2e3906b 100644 --- a/tests/test_stnode.py +++ b/tests/test_stnode.py @@ -10,7 +10,7 @@ from roman_datamodels import maker_utils from roman_datamodels import maker_utils as utils from roman_datamodels import stnode, validate -from roman_datamodels.maker_utils._base import NONUM, NOSTR +from roman_datamodels.maker_utils._base import NOFN, NONUM, NOSTR from roman_datamodels.testing import assert_node_equal, assert_node_is_copy, wraps_hashable from .conftest import MANIFEST @@ -375,7 +375,7 @@ def test_node_representation(model): } assert mdl.meta.model_type == model_types[type(mdl)] assert mdl.meta.telescope == "ROMAN" - assert mdl.meta.filename == NOSTR + assert mdl.meta.filename == NOFN elif isinstance(mdl, (datamodels.SegmentationMapModel, datamodels.SourceCatalogModel)): assert mdl.meta.optical_element == "F158" else: