BreakingBytes / simkit

Model Simulation Framework
http://breakingbytes.github.io/simkit/
BSD 3-Clause "New" or "Revised" License
27 stars 16 forks source link

What is the best way to turn off the uncertainty wrapper for a formula? #118

Closed anomam closed 6 years ago

anomam commented 6 years ago

I'm implementing a formula that takes a very long time to run. As a consequence, I don't want it to be run multiple times in the uncertainty wrapper. I tried to prevent this by putting all of the FormulaParameter arguments into the isconstant input, but this breaks the uncertainty_wrapper package, I get a:

AttributeError: 'tuple' object has no attribute 'ndim'

at this line: https://github.com/SunPower/UncertaintyWrapper/blob/master/uncertainty_wrapper/core.py#L239 (my formula returns a tuple of size 2, not a numpy array). But no matter what I do it seems that the jacobian function will be run, which will run my formula multiple times.

What would be the (best) way to turn off the uncertainty wrapper for this formula?

anomam commented 6 years ago

Ok, found my answer! The best way is to set: isconstant to None in the FormulaParameter. Like my sensei used to say, RTD :)