DatasetModel

class glotaran.model.dataset_model.DatasetModel[source]

Bases: object

A DatasetModel describes a dataset in terms of a glotaran model. It contains references to model items which describe the physical model for a given dataset.

A general dataset descriptor assigns one or more megacomplexes and a scale parameter.

Methods Summary

ensure_unique_megacomplexes

Ensure that unique megacomplexes Are only used once per dataset.

finalize_data

get_coordinates

Gets the dataset model's coordinates.

get_data

Gets the dataset model's data.

get_global_axis

Gets the dataset model's global axis.

get_global_dimension

Returns the dataset model's global dimension.

get_model_axis

Gets the dataset model's model axis.

get_model_dimension

Returns the dataset model's model dimension.

get_weight

Gets the dataset model's weight.

has_global_model

Indicates if the dataset model can model the global dimension.

is_index_dependent

Indicates if the dataset model is index dependent.

iterate_global_megacomplexes

Iterates of der dataset model's global megacomplexes.

iterate_megacomplexes

Iterates of der dataset model's megacomplexes.

overwrite_global_dimension

Overwrites the dataset model's global dimension.

overwrite_index_dependent

Overrides the index dependency of the dataset

overwrite_model_dimension

Overwrites the dataset model's model dimension.

set_coordinates

Sets the dataset model's coordinates.

set_data

Sets the dataset model's data.

swap_dimensions

Swaps the dataset model's global and model dimension.

Methods Documentation

ensure_unique_megacomplexes(model: Model) list[str][source]

Ensure that unique megacomplexes Are only used once per dataset.

Parameters

model (Model) – Model object using this dataset model.

Returns

Error messages to be shown when the model gets validated.

Return type

list[str]

finalize_data(dataset: xarray.core.dataset.Dataset) None[source]
get_coordinates() dict[Hashable, np.ndarray][source]

Gets the dataset model’s coordinates.

get_data() numpy.ndarray[source]

Gets the dataset model’s data.

get_global_axis() numpy.ndarray[source]

Gets the dataset model’s global axis.

get_global_dimension() str[source]

Returns the dataset model’s global dimension.

get_model_axis() numpy.ndarray[source]

Gets the dataset model’s model axis.

get_model_dimension() str[source]

Returns the dataset model’s model dimension.

get_weight() np.ndarray | None[source]

Gets the dataset model’s weight.

has_global_model() bool[source]

Indicates if the dataset model can model the global dimension.

is_index_dependent() bool[source]

Indicates if the dataset model is index dependent.

iterate_global_megacomplexes() Generator[tuple[Parameter | int | None, Megacomplex | str], None, None][source]

Iterates of der dataset model’s global megacomplexes.

iterate_megacomplexes() Generator[tuple[Parameter | int | None, Megacomplex | str], None, None][source]

Iterates of der dataset model’s megacomplexes.

overwrite_global_dimension(global_dimension: str) None[source]

Overwrites the dataset model’s global dimension.

overwrite_index_dependent(index_dependent: bool)[source]

Overrides the index dependency of the dataset

overwrite_model_dimension(model_dimension: str) None[source]

Overwrites the dataset model’s model dimension.

set_coordinates(coords: dict[str, np.ndarray])[source]

Sets the dataset model’s coordinates.

set_data(dataset: xarray.core.dataset.Dataset) glotaran.model.dataset_model.DatasetModel[source]

Sets the dataset model’s data.

swap_dimensions() None[source]

Swaps the dataset model’s global and model dimension.