Commit 11279451 authored by Klaus Zimmermann's avatar Klaus Zimmermann
Browse files

Add flag parameter type to index function metadata (closes #188)

parent 58561908
......@@ -86,14 +86,53 @@ def build_variable(name, variable, path):
class ParameterKind(Enum):
QUANTITY = 'quantity'
FLAG = 'flag'
OPERATOR = 'operator'
QUANTITY = 'quantity'
REDUCER = 'reducer'
PARAMETER_KINDS = {}
@dataclass
class ParameterFlag:
name: str
flag: bool
kind: ParameterKind = ParameterKind.FLAG
@property
def parameter(self):
return self.flag
def instantiate(self, parameters):
return ParameterFlag(
ParameterKind.FLAG,
self.flag)
PARAMETER_KINDS['flag'] = ParameterFlag
@dataclass
class ParameterOperator:
name: str
operator: str
kind: ParameterKind = ParameterKind.OPERATOR
@property
def parameter(self):
return self.operator
def instantiate(self, parameters):
return ParameterOperator(
ParameterKind.OPERATOR,
self.operator)
PARAMETER_KINDS['operator'] = ParameterOperator
@dataclass
class ParameterQuantity:
var_name: str
......@@ -132,25 +171,6 @@ class ParameterQuantity:
PARAMETER_KINDS['quantity'] = ParameterQuantity
@dataclass
class ParameterOperator:
name: str
operator: str
kind: ParameterKind = ParameterKind.OPERATOR
@property
def parameter(self):
return self.operator
def instantiate(self, parameters):
return ParameterOperator(
ParameterKind.OPERATOR,
self.operator)
PARAMETER_KINDS['operator'] = ParameterOperator
@dataclass
class ParameterReducer:
name: str
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment