Closed Davide-sd closed 1 year ago
is this still up for taking?
Sure, go ahead!
Small update: i wrote a really simple fix (just casting to complex any parameter that is either float
or int
in the InteractiveSeries
constructor) and the warning is gone, but test_complex_adaptive_false
(line 3014) fails (because some elements are not in np.allclose()
's default range ). Is this expected?
I've been able to replicate the error.
Within InteractiveSeries
class (and its subclasses), the self._params
attribute receives data whenever a widget changes state (a slider gets moved, ...). So, I would probably do the casting inside the _evaluate
method, or inside the param
property getter.
Now to the error. The x
symbol represents the discretized range. Apparently, I decided to evaluate the function using a real discretized range, instead of a complex one (at the moment, the reason eludes me...). Which means that inside test_complex_adaptive_false
, s1
will produces wrong data.
That's another bug: #19 .
Feel free to apply a PR for this, even if it raises errors it doesn't matter, because the main issue is #19.
During evaluation of interactive series classes, all parameters should use a complex number instead of float. For example, the following is going to fail:
Here, the problem is the
xi
uses a float value, butxi < 1
, thussqrt(xi**2 - 1)
will evaluate to NaN. Using complex numbers fixes the problem.