Skip to content

Conversation

@SimonBuechner
Copy link

Which issue(s) are closed by this pull request?

Closes #111

Changes proposed in this pull request:

  • NaN at the end of EDC are clipped to last valid value
  • According test added.

@SimonBuechner SimonBuechner self-assigned this Jan 5, 2026
@SimonBuechner SimonBuechner added the bug Something isn't working label Jan 5, 2026
@SimonBuechner SimonBuechner moved this from Backlog to Require review in Weekly Planning Jan 5, 2026
@SimonBuechner SimonBuechner added this to the v1.0.0 milestone Jan 5, 2026
@SimonBuechner SimonBuechner linked an issue Jan 5, 2026 that may be closed by this pull request
1 task
Copy link
Member

@f-brinkmann f-brinkmann left a comment

Choose a reason for hiding this comment

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

Thanks for the effort. The code and behavior seems fine to me. I wonder, if and how we should describe this in the docs for already existing parameters. How about adding something like this to the description of the time limit in clarity (and other pull requests):
'If the value exceeds the duration of the EDC or coincides with a NaN-value, it is clipped to the last valid sample of the EDC.'

Comment on lines 308 to 310
last_valid_1)
limits_energy_decay_curve2_idx = np.minimum(limits_energy_decay_curve2_idx,
last_valid_2)
Copy link
Member

Choose a reason for hiding this comment

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

To much indention, I think:

Suggested change
last_valid_1)
limits_energy_decay_curve2_idx = np.minimum(limits_energy_decay_curve2_idx,
last_valid_2)
last_valid_1)
limits_energy_decay_curve2_idx = np.minimum(limits_energy_decay_curve2_idx,
last_valid_2)

Copy link
Author

Choose a reason for hiding this comment

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

I think I would keep it really brief, like you proposed, as this function would only be very rarely used by users without the surrounding energy-parameter function.

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

Labels

bug Something isn't working

Projects

Status: Require review

Development

Successfully merging this pull request may close these issues.

[BUG] _energy_ratio doesn't handle NaN's in the EDC correctly

3 participants