Skip to content

Commit

Permalink
is_optioanl=False by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dsavchenko committed Aug 2, 2024
1 parent 5417a87 commit 47aa8ee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions cdci_data_analysis/analysis/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def __init__(self,
allowed_values=None,
min_value=None,
max_value=None,
is_optional=True,
is_optional=False,
**kwargs
):

Expand Down Expand Up @@ -573,7 +573,7 @@ def from_owl_uri(cls,
class String(Parameter):
owl_uris = ("http://www.w3.org/2001/XMLSchema#str", "http://odahub.io/ontology#String")

def __init__(self, value=None, name_format='str', name=None, allowed_values = None, is_optional=True):
def __init__(self, value=None, name_format='str', name=None, allowed_values = None, is_optional=False):

_allowed_units = ['str']
super().__init__(value=value,
Expand Down Expand Up @@ -682,7 +682,7 @@ def __init__(self,
min_value= None,
max_value = None,
units_name = None,
is_optional=True):
is_optional=False):

super().__init__(value=value,
units=units,
Expand Down Expand Up @@ -713,7 +713,7 @@ def __init__(self,
units_name = None,
default_units = None,
allowed_units = None,
is_optional=True):
is_optional=False):

super().__init__(value=value,
units=units,
Expand Down Expand Up @@ -745,7 +745,7 @@ def __init__(self,
name=None,
Time_format_name='T_format',
par_default_format='isot',
is_optional=True):
is_optional=False):

super().__init__(value=value,
par_format=T_format,
Expand Down Expand Up @@ -851,7 +851,7 @@ def __init__(self,
min_value=None,
max_value=None,
units_name = None,
is_optional=True):
is_optional=False):

_allowed_units = ['s', 'minute', 'hour', 'day', 'year']
super().__init__(value=value,
Expand Down Expand Up @@ -879,7 +879,7 @@ def __init__(self, value=None, _format='names_list', name: str = None):
check_value=self.check_list_value,
name=name,
allowed_units=_allowed_units,
is_optional=True)
is_optional=False)

@staticmethod
def _split(str_list):
Expand Down Expand Up @@ -941,7 +941,7 @@ def __init__(self,
min_value = None,
max_value = None,
units_name = None,
is_optional=True):
is_optional=False):

super().__init__(value=value,
units=units,
Expand All @@ -968,7 +968,7 @@ def __init__(self,
min_value=None,
max_value=None,
units_name=None,
is_optional=True):
is_optional=False):

_allowed_units = ['keV', 'eV', 'MeV', 'GeV', 'TeV', 'Hz', 'MHz', 'GHz']

Expand All @@ -993,7 +993,7 @@ def __init__(self,
min_value=None,
max_value=None,
units_name=None,
is_optional=True):
is_optional=False):

# retro-compatibility with integral plugin
if check_value is None:
Expand Down Expand Up @@ -1022,7 +1022,7 @@ def __init__(self,
name=None,
min_value=None,
max_value=None,
is_optional=True):
is_optional=False):
_allowed_units = ['sigma']

super().__init__(value=value,
Expand Down Expand Up @@ -1052,12 +1052,12 @@ def __init__(self, value=None, name_format='str', name=None):
check_value=None,
name=name,
allowed_units=_allowed_units,
is_optional=True)
is_optional=False)

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=True):
def __init__(self, value=None, name=None, is_optional=False):

self._true_rep = ['True', 'true', 'yes', '1', True]
self._false_rep = ['False', 'false', 'no', '0', False]
Expand All @@ -1083,7 +1083,7 @@ 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=True):
def __init__(self, value=None, name=None, schema={"oneOf": [{"type": "object"}, {"type": "array"}]}, is_optional=False):

self.schema = schema

Expand Down
2 changes: 1 addition & 1 deletion cdci_data_analysis/analysis/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def __init__(self, name):

t_range = ParameterRange(t1, t2, 'time')

token = Name(name_format='str', name='token', value=None)
token = Name(name_format='str', name='token', value=None, is_optional=True)

#time_group = ParameterGroup([t_range_iso, t_range_mjd], 'time_range', selected='t_range_iso')
#time_group_selector = time_group.build_selector('time_group_selector')
Expand Down

0 comments on commit 47aa8ee

Please sign in to comment.