Commit 2bce8047 authored by Klaus Zimmermann's avatar Klaus Zimmermann
Browse files

Deal with missing long_name in quantity parameters (closes #127)

parent 04577bd8
......@@ -90,10 +90,10 @@ PARAMETER_KINDS = {}
@dataclass
class ParameterQuantity(Parameter):
long_name: str
standard_name: str
data: Any
units: str
long_name: str = None
@property
def parameter(self):
......@@ -107,12 +107,16 @@ class ParameterQuantity(Parameter):
if isinstance(data, dict) and len(data) == 1:
key, value = data.popitem()
data = parameters[key]
return ParameterQuantity(
ln = self.long_name
if ln is not None:
ln = ln.format(**parameters)
param = ParameterQuantity(
ParameterKind.QUANTITY,
self.long_name.format(**parameters),
self.standard_name.format(**parameters),
data,
self.units)
self.units,
ln)
return param
PARAMETER_KINDS['quantity'] = ParameterQuantity
......
Supports Markdown
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