Fix error function in ExpressionComponent#175
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #175 +/- ##
========================================
Coverage 98.12% 98.12%
========================================
Files 45 45
Lines 2874 2879 +5
Branches 511 513 +2
========================================
+ Hits 2820 2825 +5
Misses 34 34
Partials 20 20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| elif isinstance(value, dict) and value.get('@class') == 'Parameter': | ||
| self._parameters[name] = Parameter.from_dict(value) |
There was a problem hiding this comment.
this part is missing test coverage and is important (deserialization from external data)
There was a problem hiding this comment.
Is it not covered by the test of copy? Copy uses the to and from dict methods.
I added this line specifically because copy fails, which it does because I take parameters as a dict.
There was a problem hiding this comment.
For reference, this is what copy does
def __copy__(self) -> NewBase:
"""Return a copy of the object."""
temp = self.to_dict(skip=['unique_name'])
new_obj = self.__class__.from_dict(temp)
return new_obj
| from typing import TYPE_CHECKING | ||
| from typing import ClassVar | ||
|
|
||
| import scipy |
There was a problem hiding this comment.
since you only use erf, maybe it's better to
from scipy.special import erf
instead?
It only worked for scalar input - the fix uses scipy instead.
Also fixes failures related to the EasyScience update.