Add B, UP and SIM linting rules#137
Merged
henrikjacobsenfys merged 9 commits intodevelopfrom Mar 20, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
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
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:
|
rozyczko
approved these changes
Mar 19, 2026
| 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 |
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] |
Member
There was a problem hiding this comment.
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" |
Member
Author
There was a problem hiding this comment.
Looks like I ran that notebook in a different environment.. I don't think it really matters?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added B, UP and SIM linting rules and fixed all errors