Skip to content

Fix error function in ExpressionComponent#175

Merged
henrikjacobsenfys merged 10 commits into
developfrom
fix-expression-component
May 12, 2026
Merged

Fix error function in ExpressionComponent#175
henrikjacobsenfys merged 10 commits into
developfrom
fix-expression-component

Conversation

@henrikjacobsenfys
Copy link
Copy Markdown
Member

@henrikjacobsenfys henrikjacobsenfys commented May 5, 2026

It only worked for scalar input - the fix uses scipy instead.

Also fixes failures related to the EasyScience update.

@henrikjacobsenfys henrikjacobsenfys added [scope] bug Bug report or fix (major.minor.PATCH) [priority] highest Urgent. Needs attention ASAP labels May 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.12%. Comparing base (152c5a0) to head (61192ca).

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           
Flag Coverage Δ
integration 48.10% <12.50%> (-0.05%) ⬇️
unittests 98.12% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@rozyczko rozyczko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpicking only

Comment on lines +185 to +186
elif isinstance(value, dict) and value.get('@class') == 'Parameter':
self._parameters[name] = Parameter.from_dict(value)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part is missing test coverage and is important (deserialization from external data)

Copy link
Copy Markdown
Member Author

@henrikjacobsenfys henrikjacobsenfys May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you only use erf, maybe it's better to

from scipy.special import erf

instead?

@henrikjacobsenfys henrikjacobsenfys merged commit 28f0771 into develop May 12, 2026
31 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] highest Urgent. Needs attention ASAP [scope] bug Bug report or fix (major.minor.PATCH)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants