Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Bump numpy from 1.26.4 to 2.0.1 #1523

Merged
merged 6 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions glotaran/optimization/objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy as np
import xarray as xr

from glotaran.io.prepare_dataset import add_svd_to_dataset
from glotaran.model.data_model import iterate_data_model_elements
from glotaran.model.data_model import iterate_data_model_global_elements
from glotaran.optimization.data import LinkedOptimizationData
Expand Down Expand Up @@ -256,18 +257,7 @@ def finalize_result_dataset(self, dataset: xr.Dataset, data: OptimizationData, a

if add_svd:
for name in ["data", "residual"]:
if f"{name}_singular_values" in dataset:
continue
lsv, sv, rsv = np.linalg.svd(dataset[name], full_matrices=False)
dataset[f"{name}_left_singular_vectors"] = (
(data.model_dimension, "left_singular_value_index"),
lsv,
)
dataset[f"{name}_singular_values"] = (("singular_value_index"), sv)
dataset[f"{name}_right_singular_vectors"] = (
(data.global_dimension, "right_singular_value_index"),
rsv.T,
)
add_svd_to_dataset(dataset, name, data.model_dimension, data.global_dimension)
for _, model in iterate_data_model_elements(data.model):
model.add_to_result_data( # type:ignore[union-attr]
data.model, dataset, False
Expand Down
2 changes: 1 addition & 1 deletion glotaran/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def create_clp_guide_dataset(
if clp_label not in dataset.clp_label:
raise ValueError(
f"Unknown clp_label {clp_label!r}. "
f"Known clp_labels are:\n {list(dataset.clp_label.values)}"
f"Known clp_labels are:\n {[str(label) for label in dataset.clp_label.to_numpy()]}"
)
if "model_dimension" not in dataset.attrs:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies = [
"asteval!=0.9.28,>=0.9.22",
"netCDF4>=1.5.7",
"numba>=0.55",
"numpy<1.27,>=1.21.2",
"numpy<2.1,>=1.21.2",
"odfpy>=1.4.1",
"openpyxl>=3.0.10",
"pandas>=1.3.4",
Expand Down
2 changes: 1 addition & 1 deletion requirements_pinned.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
asteval==1.0.2
netCDF4==1.7.1.post1
numba==0.60.0
numpy==1.26.4
numpy==2.0.1
odfpy==1.4.1
openpyxl==3.1.5
pandas==2.2.2
Expand Down
Loading