mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 11:33:38 +00:00
handle numeric simpleValue (#5376)
The input value can be a string or number, but 1.0 schema only accepts strings. The processing of int and float was missing. The casting to string might no longer be needed in IDS 1.1. https://github.com/buildingSMART/IDS/issues/342
This commit is contained in:
@@ -149,8 +149,8 @@ class Facet:
|
|||||||
return "This facet cannot be interpreted"
|
return "This facet cannot be interpreted"
|
||||||
|
|
||||||
def to_ids_value(self, parameter: Union[str, Restriction, list]) -> dict[str, Any]:
|
def to_ids_value(self, parameter: Union[str, Restriction, list]) -> dict[str, Any]:
|
||||||
if isinstance(parameter, str):
|
if isinstance(parameter, (int, float, str)):
|
||||||
parameter_dict = {"simpleValue": parameter}
|
parameter_dict = {"simpleValue": str(parameter)}
|
||||||
elif isinstance(parameter, Restriction):
|
elif isinstance(parameter, Restriction):
|
||||||
parameter_dict = {"xs:restriction": [parameter.asdict()]}
|
parameter_dict = {"xs:restriction": [parameter.asdict()]}
|
||||||
elif isinstance(parameter, list):
|
elif isinstance(parameter, list):
|
||||||
|
|||||||
Reference in New Issue
Block a user