diff --git a/cdci_data_analysis/analysis/parameters.py b/cdci_data_analysis/analysis/parameters.py index 41574002..bdaaee04 100644 --- a/cdci_data_analysis/analysis/parameters.py +++ b/cdci_data_analysis/analysis/parameters.py @@ -580,6 +580,9 @@ def __init__(self, value=None, name_format='str', name=None, allowed_values = No def check_name_value(value, units=None, name=None, par_format=None): pass +class LongString(String): + owl_uris = String.owl_uris + ("http://odahub.io/ontology#LongString",) + class Name(String): owl_uris = String.owl_uris + ("http://odahub.io/ontology#AstrophysicalObject",) diff --git a/tests/test_parameters.py b/tests/test_parameters.py index 552ea613..3eb47853 100644 --- a/tests/test_parameters.py +++ b/tests/test_parameters.py @@ -22,6 +22,7 @@ InputProdList, DetectionThreshold, String, + LongString, Boolean, StructuredParameter, PhosphorosFiltersTable, @@ -354,6 +355,7 @@ def test_parameter_bounds(): def test_parameter_meta_data(): bounded_parameter = Float(value = 1., name='bounded', min_value=0.1, max_value=2) choice_parameter = String(value = 'spam', name='choice', allowed_values=['spam', 'eggs', 'hams']) + long_choice_parameter = LongString(value='long_spam', name='choice') bool_parameter = Boolean(value = True, name = 'bool') assert bounded_parameter.reprJSONifiable() == [{'name': 'bounded', 'units': None, 'value': 1.0, @@ -364,6 +366,12 @@ def test_parameter_meta_data(): 'value': 'spam', 'restrictions': {'allowed_values': ['spam', 'eggs', 'hams']}, 'owl_uri': ["http://www.w3.org/2001/XMLSchema#str", "http://odahub.io/ontology#String"]}] + assert long_choice_parameter.reprJSONifiable() == [{'name': 'choice', + 'units': 'str', + 'value': 'long_spam', + 'owl_uri': ["http://www.w3.org/2001/XMLSchema#str", + "http://odahub.io/ontology#String", + "http://odahub.io/ontology#LongString"]}] assert bool_parameter.reprJSONifiable() == [{'name': 'bool', 'units': None, 'value': True,