Skip to content

Add dr return mode to find_dynamic_range()#19

Open
Riz1Asif wants to merge 1 commit into
dotTHzTAG:mainfrom
Riz1Asif:main
Open

Add dr return mode to find_dynamic_range()#19
Riz1Asif wants to merge 1 commit into
dotTHzTAG:mainfrom
Riz1Asif:main

Conversation

@Riz1Asif
Copy link
Copy Markdown

This PR adds a mode="dr" option to find_dynamic_range() to return the frequency-dependent dynamic range spectrum directly.

Currently, the function name suggests that dynamic range itself is the main quantity of interest, but the exposed outputs are primarily derived quantities such as amax, amaxd, and boundaries. Returning the DR spectrum directly makes the function behavior more transparent and aligns the API more closely with the underlying implementation.
This PR:

  • adds mode="dr"
  • updates the docstring

Copilot AI review requested due to automatic review settings March 25, 2026 16:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an explicit mode="dr" return option to find_dynamic_range() so callers can obtain the frequency-dependent dynamic-range spectrum directly, aligning the public API more closely with the underlying DR-based computation.

Changes:

  • Add mode="dr" to return the computed dynamic-range spectrum (as a 2D array stacked with frequencies).
  • Update the find_dynamic_range() docstring to describe modes/returns more clearly.
  • Normalize frequencies, refractive_index, and (in boundaries mode) absorption_coefficient to NumPy arrays and raise on invalid mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread thzpy/frequencydomain/frequencydomain.py
Comment thread thzpy/frequencydomain/frequencydomain.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants