Skip to content

Fix filter_lambda minimum and infinite loop with small/zero current step - #261

Open
maroba wants to merge 1 commit into
ECSIM:developfrom
maroba:fix/lambda-and-precision
Open

maroba wants to merge 1 commit into
ECSIM:developfrom
maroba:fix/lambda-and-precision

Conversation

@maroba

@maroba maroba commented Oct 22, 2026

Copy link
Copy Markdown

Reference Issues/PRs

Fixes #260

What does this implement/fix? Explain your changes.

  • filter_lambda: values below 14 are now set to 14 (previously 23).
  • get_precision: handles scientific notation (1e-05 → 5, 1.5e-05 → 6), so small current steps no longer cause an infinite loop.
  • filter_range: raises ValueError for a zero step, so the simulation fails with the usual "Check Your Inputs" message instead of hanging.
  • Doctests added/updated in test/test_Functions.py (the existing filter_lambda({"lambda":13}) test expected the buggy result).
  • CHANGELOG.md and AUTHORS.md updated.

Any other comments?

All tests pass locally.

@sepandhaghighi sepandhaghighi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@maroba

Thank you for your contributions. Please take a look at my comments.

Comment thread opem/Functions.py
:type IStep: float
:return: filtered range as list
"""
if IStep == 0:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remove this section

Comment thread test/test_Functions.py
[0, 500, 0.1]
>>> filter_range(500,0,-0.1)
[0, 500, 0.1]
>>> filter_range(0,100,0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remove this section

Comment thread CHANGELOG.md
- `Python 3.13` added to `test.yml`
- `Python 3.14` added to `test.yml`
- Restart mode updated
### Fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move these lines under the ### Changed section.

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.81%. Comparing base (5b30daf) to head (c029acf).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #261      +/-   ##
===========================================
+ Coverage    92.78%   92.81%   +0.03%     
===========================================
  Files           11       11              
  Lines         1648     1653       +5     
===========================================
+ Hits          1529     1534       +5     
  Misses         119      119              

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants