-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eliminate the Variable
class
#262
base: master
Are you sure you want to change the base?
Eliminate the Variable
class
#262
Conversation
Variable
class
@@ -104,9 +105,6 @@ def test_ufloat_fromstr(): | |||
"3.4(nan)e10": (3.4e10, float("nan")), | |||
# NaN value: | |||
"nan+/-3.14e2": (float("nan"), 314), | |||
# "Double-floats" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These floats are too large to work with. Prior to this PR the large float value could be saved into the AffineScalarFunc
object and displayed, but any arithmetic with such large values would result in an OverflowError
. In the new framework even displaying a UFloat
the first time requires a calculation, even if it's as simple as sqrt(x**2)
. So in the new framework the OverflowError
appears immediately.
pre-commit run --all-files
with no errorsThis PR:
Variable
class and eliminates theAffineScalarFunc.derivatives
property.AffineScalarFunc
class is renamed toUFloat
withAffineScalarFunc
left as a legacy name.LinearCombo
class is refactored into theUCombo
class but the architectural role is similar: track the uncertainties ofUFloat
objects as a lazily expanded combination of objects with uncertaintyUAtom
object is introduced as the fundamental element which captures uncertainty. EachUAtom
models a random variable with zero mean and unity standard deviation/variance. EachUAtom
has auuid
and allUAtom
are mutually statistically independent. The expanded version of theUCombo
mapsdict[UAtom, float]
.For more detail/discussion see #251 (comment)
Note that as of the time opening this PR the PR is still a work in progress. Not all elements in the bullet list above are implemented and a good handful of tests are still failing.