When I try to mark an empty single-value point attribute as Not Applicable by setting is_applicable = False, the whole session.update() call fails, along with every other record in that batch.
The issue seems to be on line 1119 of mi_attribute_value_classes.py, in AttributePointSingle._create_value().
Currently the line reads as
value = float(self.value)
which runs before is_applicable is checked, so when self.value is None it raises
TypeError: float() argument must be a string or a real number, not 'NoneType'
I believe it should skip building the point when the attribute isn't applicable, similar to how the integer attribute type handles a None value:
if not self.is_applicable:
return gdl.PointDataType(is_applicable=False)
Here is a minimal example (STK 5.0.0, Python 3.14):
record = table.search_for_records_by_name("...")[0]
attribute = record.attributes["Density"]
assert attribute.value is None
attribute.is_applicable = False
record.set_attributes([attribute])
session.update([record])
Is this the intended behavior?
For now I'm setting the value to 0.0 before setting is_applicable = False, since the value is cleared once the attribute is Not Applicable, but this feels like something that should not be happening.
Happy to answer any follow up questions about this issue.
Thanks,
Noah