Raise on too few frequencies in frequency_dof - #87
Merged
Conversation
frequency_dof kept the top dof modes via negative indexing, which wrapped and silently duplicated modes when given fewer than dof frequencies. Raise TSValueError on underflow and simplify to a slice. check_frequency_length now validates the raw input count (it was checking the always-dof-length output, so it was always True). Closes #86
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
==========================================
- Coverage 96.92% 96.91% -0.01%
==========================================
Files 28 28
Lines 1689 1685 -4
==========================================
- Hits 1637 1633 -4
Misses 52 52
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
frequency_dofkept the topdoffrequencies viafrequency[N-1-i]; whenlen(frequency) < dofthe index wrapped and silently duplicated modes into the thermochemistry. It now raisesTSValueErroron underflow (and is simplified to a slice).check_frequency_lengthwas called on the output offrequency_dof(always lengthdof), so it always returnedTrue; it now validates the raw input count.Adds unit tests for keep-highest / identity / underflow-raises / input-count.
Closes #86