Skip to content

Commit

Permalink
Downcase FWHM, STD to fwhm, std: non-breaking change
Browse files Browse the repository at this point in the history
The implementation is case-insensitive, this just makes the code more
consistent to read. Existing scripts and tests should be unaffected
  • Loading branch information
ajjackson committed Sep 6, 2023
1 parent ecc5a3f commit 67a8bd0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion doc/source/spectra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ apply this resolution function to a Spectrum1D we package the polynomial into a
def tosca_resolution(energy):
poly_in_wavenumber = Polynomial([2.5, 0.005, 1e-7])
return poly_in_wavenumber(energy.to('1/cm').magnitude) * ureg('1/cm')
dos_tosca = dos.broaden(tosca_resolution, shape='gauss', width_convention='STD')
dos_tosca = dos.broaden(tosca_resolution, shape='gauss', width_convention='std')

Plotting
--------
Expand Down
2 changes: 1 addition & 1 deletion euphonic/broadening.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def variable_width_broadening(
width_function: Callable[[Quantity], Quantity],
weights: Union[np.ndarray, Quantity],
width_lower_limit: Quantity = None,
width_convention: Literal['FWHM', 'STD'] = 'FWHM',
width_convention: Literal['fwhm', 'std'] = 'fwhm',
adaptive_error: float = 1e-2,
shape: KernelShape = 'gauss',
fit: ErrorFit = 'cheby-log'
Expand Down
24 changes: 12 additions & 12 deletions euphonic/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def broaden(self: T, x_width: CallableQuantity,
shape: KernelShape = 'gauss',
method: Optional[Literal['convolve']] = None,
width_lower_limit: Optional[Quantity] = None,
width_convention: Literal['FWHM', 'STD'] = 'FWHM',
width_convention: Literal['fwhm', 'std'] = 'fwhm',
width_interpolation_error: float = 0.01,
width_fit: ErrorFit = 'cheby-log'
) -> T: # noqa: F811
Expand All @@ -587,7 +587,7 @@ def broaden(self: T, x_width,
shape='gauss',
method=None,
width_lower_limit=None,
width_convention='FWHM',
width_convention='fwhm',
width_interpolation_error=0.01,
width_fit='cheby-log'
) -> T: # noqa: F811
Expand All @@ -613,8 +613,8 @@ def broaden(self: T, x_width,
Set a lower bound to width obtained calling x_width function. By
default, this is equal to bin width. To disable, set to -Inf.
width_convention
By default ('FWHM'), x_width is interpreted as full-width
half-maximum. Set to 'STD' to instead define standard deviation.
By default ('fwhm'), x_width is interpreted as full-width
half-maximum. Set to 'std' to instead define standard deviation.
width_interpolation_error
When x_width is a callable function, variable-width broadening is
implemented by an approximate kernel-interpolation scheme. This
Expand Down Expand Up @@ -1046,7 +1046,7 @@ def broaden(self: T, x_width: CallableQuantity,
shape: KernelShape = 'gauss',
method: Optional[Literal['convolve']] = None,
width_lower_limit: Optional[Quantity] = None,
width_convention: Literal['FWHM', 'STD'] = 'FWHM',
width_convention: Literal['fwhm', 'std'] = 'fwhm',
width_interpolation_error: float = 0.01,
width_fit: ErrorFit = 'cheby-log'
) -> T: # noqa: F811
Expand All @@ -1057,7 +1057,7 @@ def broaden(self: T,
shape='gauss',
method=None,
width_lower_limit=None,
width_convention='FWHM',
width_convention='fwhm',
width_interpolation_error=0.01,
width_fit='cheby-log'
) -> T: # noqa: F811
Expand All @@ -1084,8 +1084,8 @@ def broaden(self: T,
Set a lower bound to width obtained calling x_width function. By
default, this is equal to bin width. To disable, set to -Inf.
width_convention
By default ('FWHM'), x_width is interpreted as full-width
half-maximum. Set to 'STD' to instead define standard deviation.
By default ('fwhm'), x_width is interpreted as full-width
half-maximum. Set to 'std' to instead define standard deviation.
width_interpolation_error
When x_width is a callable function, variable-width broadening is
implemented by an approximate kernel-interpolation scheme. This
Expand Down Expand Up @@ -1355,7 +1355,7 @@ def broaden(self: T,
method: Optional[Literal['convolve']] = None,
x_width_lower_limit: Quantity = None,
y_width_lower_limit: Quantity = None,
width_convention: Literal['FWHM', 'STD'] = 'FWHM',
width_convention: Literal['fwhm', 'std'] = 'fwhm',
width_interpolation_error: float = 0.01,
width_fit: ErrorFit = 'cheby-log'
) -> T:
Expand Down Expand Up @@ -1391,8 +1391,8 @@ def broaden(self: T,
Set a lower bound to width obtained calling y_width function. By
default, this is equal to y bin width. To disable, set to -Inf.
width_convention
By default ('FWHM'), widths are interpreted as full-width
half-maximum. Set to 'STD' to instead define standard deviation.
By default ('fwhm'), widths are interpreted as full-width
half-maximum. Set to 'std' to instead define standard deviation.
width_interpolation_error
When x_width is a callable function, variable-width broadening is
implemented by an approximate kernel-interpolation scheme. This
Expand Down Expand Up @@ -1463,7 +1463,7 @@ def _broaden_spectrum2d_with_function(
width_function: Callable[[Quantity], Quantity],
axis: Literal['x', 'y'] = 'y',
width_lower_limit: Quantity = None,
width_convention: Literal['FWHM', 'STD'] = 'FWHM',
width_convention: Literal['fwhm', 'std'] = 'fwhm',
width_interpolation_error: float = 1e-2,
shape: KernelShape = 'gauss',
width_fit: ErrorFit = 'cheby-log'
Expand Down

0 comments on commit 67a8bd0

Please sign in to comment.