Skip to content

Conversation

@Gautzilla
Copy link
Contributor

We just found a bug with @PaulCarvaillo @PCarvaillo, where computing a spectrogram with a Scale that has incorrect parameters (e.g. a ScalePart with p_max = 100) would lead to a huuuuuuuuge explosion in RAM usage.

This PR prevents the user from instantiating ScalePart instances with incorrect values. The enforced conditions are:

  • p_min >= 0
  • p_max >= 0
  • p_min <= 1
  • p_max <= 1
  • p_min < p_max
  • f_min >= 0
  • f_max >= 0
  • f_min < f_max

With these checks in ScalePart.__post_init__(), there should be no way of reproducing the RAM explosion experienced before.

@Gautzilla Gautzilla self-assigned this Jan 12, 2026
@Gautzilla Gautzilla added the bug Something isn't working label Jan 12, 2026
@Gautzilla Gautzilla merged commit 889f044 into Project-OSmOSE:main Jan 13, 2026
2 checks passed
@Gautzilla Gautzilla deleted the scalepart-value-checking branch January 13, 2026 08:48
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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants