Skip to content

Conversation

henrikjacobsenfys
Copy link
Member

Utility function to calculate the detailed balance factor as discussed here: easyscience/dynamics#6

Includes the option to normalise by temperature. Takes various inputs and outputs a np array. I may want to later output a scipp array, but not yet.

Copy link

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 98.50746% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.50%. Comparing base (3d99faa) to head (c036a97).

Files with missing lines Patch % Lines
src/easydynamics/utils/utils.py 98.46% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop      #52       +/-   ##
============================================
+ Coverage     0.00%   98.50%   +98.50%     
============================================
  Files            1        2        +1     
  Lines            2       67       +65     
============================================
+ Hits             0       66       +66     
+ Misses           2        1        -1     
Flag Coverage Δ
unittests 98.50% <98.50%> (+98.50%) ⬆️

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.

Copilot AI added a commit that referenced this pull request Sep 23, 2025
@henrikjacobsenfys henrikjacobsenfys added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] medium Normal/default priority labels Sep 23, 2025
Copy link
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.

Good idea with separating utilities from the rest of the code.
A few points added on how to improve the code.
The rest looks good!

"""

# Input validation
if not isinstance(divide_by_temperature, bool):
Copy link
Member

Choose a reason for hiding this comment

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

Type checks already test the types. If we enforce those, these checks aren't necessary

@henrikjacobsenfys
Copy link
Member Author

@rozyczko Just double checking, is it OK to merge? :)

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] enhancement Adds/improves features (major.MINOR.patch)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants