Skip to content

Commit

Permalink
🩹 Fix deprecation warning for using xr.Dataset.dim (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-weigand authored Jun 22, 2024
1 parent 291774e commit c53418c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyglotaran_extras/plotting/plot_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def plot_overview(
irf_location = extract_irf_location(res, center_λ, main_irf_nr)

if center_λ is None: # center wavelength (λ in nm)
center_λ = min(res.dims["spectral"], round(res.dims["spectral"] / 2))
center_λ = min(res.sizes["spectral"], round(res.sizes["spectral"] / 2))

# First and second row: concentrations - SAS/EAS - DAS
plot_concentrations(
Expand Down
2 changes: 1 addition & 1 deletion pyglotaran_extras/plotting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def extract_irf_location(
)
if isinstance(irf_dispersion_center, xr.DataArray):
if center_λ is None: # center wavelength (λ in nm)
center_λ = min(res.dims["spectral"], round(res.dims["spectral"] / 2))
center_λ = min(res.sizes["spectral"], round(res.sizes["spectral"] / 2))
return irf_dispersion_center.sel(spectral=center_λ, method="nearest").item()

return irf_dispersion_center
Expand Down

0 comments on commit c53418c

Please sign in to comment.