diff --git a/glotaran/analysis/problem_ungrouped.py b/glotaran/analysis/problem_ungrouped.py index 32ee4c58e..38a8d522b 100644 --- a/glotaran/analysis/problem_ungrouped.py +++ b/glotaran/analysis/problem_ungrouped.py @@ -207,7 +207,7 @@ def _add_index_dependent_matrix_to_dataset(self, label: str, dataset: xr.Dataset (model_dimension), ("clp_label"), ), - matrix, + matrix.data, ) def _add_index_independent_matrix_to_dataset(self, label: str, dataset: xr.Dataset): @@ -218,7 +218,7 @@ def _add_index_independent_matrix_to_dataset(self, label: str, dataset: xr.Datas (model_dimension), ("clp_label"), ), - self.matrices[label], + self.matrices[label].data, ) def _add_residual_and_full_clp_to_dataset(self, label: str, dataset: xr.Dataset): @@ -230,14 +230,14 @@ def _add_residual_and_full_clp_to_dataset(self, label: str, dataset: xr.Dataset) (model_dimension), (global_dimension), ), - xr.concat(self.weighted_residuals[label], dim=global_dimension).T, + xr.concat(self.weighted_residuals[label], dim=global_dimension).T.data, ) dataset["residual"] = ( ( (model_dimension), (global_dimension), ), - xr.concat(self.residuals[label], dim=global_dimension).T, + xr.concat(self.residuals[label], dim=global_dimension).T.data, ) @property diff --git a/glotaran/analysis/simulation.py b/glotaran/analysis/simulation.py index 6edf40e67..c8efb3492 100644 --- a/glotaran/analysis/simulation.py +++ b/glotaran/analysis/simulation.py @@ -63,8 +63,8 @@ def simulate( result = xr.DataArray( data=0.0, coords=[ - (model_dimension, model_axis), - (global_dimension, global_axis), + (model_dimension, model_axis.data), + (global_dimension, global_axis.data), ], ) result = result.to_dataset(name="data") diff --git a/glotaran/analysis/test/models.py b/glotaran/analysis/test/models.py index a0dc47709..5d9d409b1 100644 --- a/glotaran/analysis/test/models.py +++ b/glotaran/analysis/test/models.py @@ -43,7 +43,7 @@ def calculate_matrix(self, dataset_model, indices, **kwargs): r_compartments.append(compartments[i]) for j in range(axis.shape[0]): array[j, i] = (i + j) * axis[j] - return xr.DataArray(array, coords=(("c", axis), ("clp_label", r_compartments))) + return xr.DataArray(array, coords=(("c", axis.data), ("clp_label", r_compartments))) def index_dependent(self, dataset_model): return self.is_index_dependent @@ -75,7 +75,7 @@ def calculate_matrix(self, dataset_model, indices, **kwargs): else: compartments = [f"s{i+1}" for i in range(len(kinpar))] array = np.exp(np.outer(axis, kinpar)) - return xr.DataArray(array, coords=(("c", axis), ("clp_label", compartments))) + return xr.DataArray(array, coords=(("c", axis.data), ("clp_label", compartments))) def index_dependent(self, dataset_model): return self.is_index_dependent diff --git a/glotaran/builtin/models/kinetic_image/kinetic_baseline_megacomplex.py b/glotaran/builtin/models/kinetic_image/kinetic_baseline_megacomplex.py index b6af03aac..4021cb0b5 100644 --- a/glotaran/builtin/models/kinetic_image/kinetic_baseline_megacomplex.py +++ b/glotaran/builtin/models/kinetic_image/kinetic_baseline_megacomplex.py @@ -22,7 +22,7 @@ def calculate_matrix( compartments = [f"{dataset_model.label}_baseline"] matrix = np.ones((model_axis.size, 1), dtype=np.float64) return xr.DataArray( - matrix, coords=((model_dimension, model_axis), ("clp_label", compartments)) + matrix, coords=((model_dimension, model_axis.data), ("clp_label", compartments)) ) def index_dependent(self, dataset: DatasetDescriptor) -> bool: diff --git a/glotaran/builtin/models/spectral/spectral_megacomplex.py b/glotaran/builtin/models/spectral/spectral_megacomplex.py index a59fb65a0..7e3603552 100644 --- a/glotaran/builtin/models/spectral/spectral_megacomplex.py +++ b/glotaran/builtin/models/spectral/spectral_megacomplex.py @@ -41,7 +41,7 @@ def calculate_matrix( for i, shape in enumerate(self.shape.values()): matrix[:, i] += shape.calculate(model_axis.values) return xr.DataArray( - matrix, coords=((model_dimension, model_axis), ("clp_label", compartments)) + matrix, coords=((model_dimension, model_axis.data), ("clp_label", compartments)) ) def index_dependent(self, dataset: DatasetDescriptor) -> bool: diff --git a/tox.ini b/tox.ini index b769ec467..6fe9c651c 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,10 @@ envlist = py{38}, pre-commit, docs, docs-notebooks, docs-links ; Uncomment the following lines to deactivate pyglotaran all plugins ; env = ; DEACTIVATE_GTA_PLUGINS=1 +; Uncomment to ignore deprecation warnings coming from pyglotaran +; (this helps to see the warnings from dependencies) +; filterwarnings = +; ignore:.+glotaran:DeprecationWarning [flake8] extend-ignore = E231, E203