From f0952d54ca9070e289553dddecb7b9df641b1645 Mon Sep 17 00:00:00 2001 From: Denys SAVCHENKO Date: Fri, 2 Aug 2024 22:07:07 +0200 Subject: [PATCH] fix dummy --- cdci_data_analysis/analysis/parameters.py | 10 +++++++--- .../plugins/dummy_plugin/empty_instrument.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cdci_data_analysis/analysis/parameters.py b/cdci_data_analysis/analysis/parameters.py index 262d333c..905cbe05 100644 --- a/cdci_data_analysis/analysis/parameters.py +++ b/cdci_data_analysis/analysis/parameters.py @@ -191,7 +191,7 @@ class Parameter: TODO see through that this is implemented https://github.com/oda-hub/dispatcher-app/issues/339 """ def __init__(self, - value=None, + value, units=None, name: Union[str, None] = None, # TODO should we remove units/type/format knowledge from the Parameter class? @@ -1057,7 +1057,7 @@ def __init__(self, value=None, name_format='str', name=None): class Boolean(Parameter): owl_uris = ('http://www.w3.org/2001/XMLSchema#bool',"http://odahub.io/ontology#Boolean") - def __init__(self, value=None, name=None, is_optional=False): + def __init__(self, value, name=None, is_optional=False): self._true_rep = ['True', 'true', 'yes', '1', True] self._false_rep = ['False', 'false', 'no', '0', False] @@ -1083,7 +1083,11 @@ def value(self, v): class StructuredParameter(Parameter): owl_uris = ("http://odahub.io/ontology#StructuredParameter") - def __init__(self, value=None, name=None, schema={"oneOf": [{"type": "object"}, {"type": "array"}]}, is_optional=False): + def __init__(self, + value, + name=None, + schema={"oneOf": [{"type": "object"}, {"type": "array"}]}, + is_optional=False): self.schema = schema diff --git a/cdci_data_analysis/plugins/dummy_plugin/empty_instrument.py b/cdci_data_analysis/plugins/dummy_plugin/empty_instrument.py index fba7e758..05e6777b 100644 --- a/cdci_data_analysis/plugins/dummy_plugin/empty_instrument.py +++ b/cdci_data_analysis/plugins/dummy_plugin/empty_instrument.py @@ -82,7 +82,7 @@ def my_instr_factory(): numerical_query = DataServerNumericQuery('numerical_parameters_dummy_query', parameters_list=[p]) - f = FileURL(name='dummy_file') + f = FileURL(name='dummy_file', is_optional=False) file_query = FileParameterQuery('file_parameters_dummy_query', parameters_list=[p, f])