-
-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
In 3.x the AffineScalarFunc class has two attributes that tell users about the contribution of other Variables to the uncertainty: the derivatives property and the error_component method.
x = ufloat(1, 0.1)
y = x**2
y.derivatives
y.error_components()
One is a property, so it is accessed without the () parentheses, the other is a method so it needs the parentheses (). In 4.x the derivatives property is being removed from the UFloat class. error_components remains. This issue is asking if error_components should be changed to a property.
- The pro is that
error_components()is just returning something it reads off theUFloat._uncertainty(which is aUCombo) attribute. I would say semantically it is more like a property than a method. The simpler notation would reflect that. - The downside is that it would not be backwards compatible. Also I generally find it tricky to remember when an attribute is a property and whether or not I should use
(). This change in behavior will make that even worse.
I would take a weak preference towards changing error_components to be a property and will do so if no one pushes back. But I'm very open to pushback. If we want to change it we need to put in a deprecation/change coming warning in 3.2.x.
Metadata
Metadata
Assignees
Labels
No labels