Skip to content

Add B, UP and SIM linting rules#137

Merged
henrikjacobsenfys merged 9 commits intodevelopfrom
linting
Mar 20, 2026
Merged

Add B, UP and SIM linting rules#137
henrikjacobsenfys merged 9 commits intodevelopfrom
linting

Conversation

@henrikjacobsenfys
Copy link
Copy Markdown
Member

Added B, UP and SIM linting rules and fixed all errors

@henrikjacobsenfys henrikjacobsenfys added [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH) [priority] medium Normal/default priority labels Mar 18, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 88.57143% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.64%. Comparing base (f130380) to head (e62b24e).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...dynamics/sample_model/components/delta_function.py 0.00% 0 Missing and 2 partials ⚠️
src/easydynamics/utils/detailed_balance.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #137      +/-   ##
===========================================
+ Coverage    97.58%   97.64%   +0.05%     
===========================================
  Files           37       37              
  Lines         2482     2460      -22     
  Branches       421      413       -8     
===========================================
- Hits          2422     2402      -20     
+ Misses          36       34       -2     
  Partials        24       24              
Flag Coverage Δ
integration 0.00% <0.00%> (ø)
unittests 97.64% <88.57%> (+0.05%) ⬆️

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 issues only

from easydynamics.sample_model.component_collection import ComponentCollection
from easydynamics.sample_model.components.model_component import ModelComponent
from easydynamics.utils.detailed_balance import _detailed_balance_factor as detailed_balance_factor
from easydynamics.utils.detailed_balance import detailed_balance_factor as detailed_balance_factor
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.

the alias is now redundant...

Comment on lines +143 to +146
if i == 0:
left = x[1] - x[0] if x.size > 1 else 0.5
else:
left = x[i] - x[i - 1]
left = (x[1] - x[0] if x.size > 1 else 0.5) if i == 0 else x[i] - x[i - 1]

# right half-width
if i == x.size - 1:
right = x[-1] - x[-2] if x.size > 1 else 0.5
else:
right = x[i + 1] - x[i]
right = (x[-1] - x[-2] if x.size > 1 else 0.5) if i == x.size - 1 else x[i + 1] - x[i]
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.

Those are clever nested ternaries, but the readibility got significantly reduced.
We should aim at simplicity when available, I think.
I would propose reverting to the original if/else

"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.13"
"version": "3.12.12"
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.

Is this downgrade expected?

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.

Looks like I ran that notebook in a different environment.. I don't think it really matters?

@henrikjacobsenfys henrikjacobsenfys merged commit 860c3ca into develop Mar 20, 2026
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] medium Normal/default priority [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants