Skip to content

Allow adjusting convolution settings for accuracy#159

Merged
henrikjacobsenfys merged 13 commits intodevelopfrom
add-convolution-settings
Apr 20, 2026
Merged

Allow adjusting convolution settings for accuracy#159
henrikjacobsenfys merged 13 commits intodevelopfrom
add-convolution-settings

Conversation

@henrikjacobsenfys
Copy link
Copy Markdown
Member

@henrikjacobsenfys henrikjacobsenfys commented Apr 17, 2026

E.g.

analysis=Analysis()
analysis.convolution_settings.upsample_factor=10

Missing a few unit tests, but ready for review

@henrikjacobsenfys henrikjacobsenfys added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] medium Normal/default priority labels Apr 17, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.93%. Comparing base (113b4d9) to head (57e1111).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #159      +/-   ##
===========================================
+ Coverage    97.86%   97.93%   +0.07%     
===========================================
  Files           42       43       +1     
  Lines         2621     2715      +94     
  Branches       453      472      +19     
===========================================
+ Hits          2565     2659      +94     
  Misses          33       33              
  Partials        23       23              
Flag Coverage Δ
integration 49.02% <52.63%> (+0.11%) ⬆️
unittests 97.93% <100.00%> (+0.07%) ⬆️

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.

Ready for merge with minor suggestions for refactoring.

Comment on lines +92 to +93
if not self.convolution_settings.convolution_plan_is_valid:
self._energy_grid = self._create_energy_grid()
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.

After recreating the energy grid, convolution_plan_is_valid is never set back to True.
This means every subsequent call to convolution() will unnecessarily recreate the energy grid. This is a performance issue.

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.

Good point

Comment on lines 46 to 49
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.

'_upsample_factor',
'_extension_factor',
'_normalize_detailed_balance',

These attributes no longer exist on Convolution- they live inside ConvolutionSettings. The __setattr__ hook will never match these names. They are dead code.

from easydynamics.utils.utils import Numeric


class ConvolutionSettings(EasyDynamicsBase):
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.

Do we want to export ConvolutionSettings in the convolution __init__ file? Or dynamics __init__?

Comment on lines +18 to +19
upsample_factor: Numeric | None = 5,
extension_factor: Numeric | None = 0.2,
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.

extension_factor and upsample_factor are stored directly without float() conversion, but the setters convert to float(). Consider standardizing.

Comment on lines +5 to +6
# from dataclasses import dataclass

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.

remove line

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.

remove line

@henrikjacobsenfys henrikjacobsenfys linked an issue Apr 20, 2026 that may be closed by this pull request
@henrikjacobsenfys henrikjacobsenfys merged commit 5b06f1e into develop Apr 20, 2026
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] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow settings to be passed to convolution

2 participants