Scheme

class glotaran.project.scheme.Scheme(model: Model, parameters: ParameterGroup, data: Mapping[str, xr.Dataset], clp_link_tolerance: float = 0.0, maximum_number_function_evaluations: int | None = None, non_negative_least_squares: bool | None = None, group_tolerance: float | None = None, group: bool | None = None, add_svd: bool = True, ftol: float = 1e-08, gtol: float = 1e-08, xtol: float = 1e-08, optimization_method: Literal['TrustRegionReflection', 'Dogbox', 'Levenberg-Marquardt'] = 'TrustRegionReflection', result_path: str | None = None)[source]

Bases: object

A scheme is a collection of a model, parameters and a dataset.

A scheme also holds options for optimization.

Attributes Summary

add_svd

clp_link_tolerance

ftol

global_dimensions

Return the dataset model's global dimension.

group

group_tolerance

gtol

maximum_number_function_evaluations

model_dimensions

Return the dataset model's model dimension.

non_negative_least_squares

optimization_method

result_path

source_path

xtol

model

parameters

data

Methods Summary

from_yaml_file

Create Scheme from specs in yaml file.

loader

Create a Scheme instance from the specs defined in a file.

markdown

Format the Scheme as markdown string.

problem_list

Return a list with all problems in the model and missing parameters.

valid

Check if there are no problems with the model or the parameters.

validate

Return a string listing all problems in the model and missing parameters.

Methods Documentation

add_svd: bool = True
data: Mapping[str, xr.Dataset]
static from_yaml_file(filename: str) glotaran.project.scheme.Scheme[source]

Create Scheme from specs in yaml file.

Warning

Deprecated use glotaran.io.load_scheme(filename) instead.

Parameters

filename (str) – Path to the spec file.

Returns

Analysis schmeme

Return type

Scheme

ftol: float = 1e-08
property global_dimensions: dict[str, str]

Return the dataset model’s global dimension.

Returns

A dictionary with the dataset labels as key and the global dimension of the dataset as value.

Return type

dict[str, str]

group: bool | None = None
group_tolerance: float | None = None
gtol: float = 1e-08
loader(format_name: str = None, **kwargs: Any) Scheme

Create a Scheme instance from the specs defined in a file.

Parameters
  • file_name (StrOrPath) – File containing the parameter specs.

  • format_name (str) – Format the file is in, if not provided it will be inferred from the file extension.

  • **kwargs (Any) – Additional keyword arguments passes to the load_scheme implementation of the project io plugin.

Returns

Scheme instance created from the file.

Return type

Scheme

markdown()[source]

Format the Scheme as markdown string.

Returns

The scheme as markdown string.

Return type

MarkdownStr

maximum_number_function_evaluations: int | None = None
model: Model
property model_dimensions: dict[str, str]

Return the dataset model’s model dimension.

Returns

A dictionary with the dataset labels as key and the model dimension of the dataset as value.

Return type

dict[str, str]

non_negative_least_squares: bool | None = None
optimization_method: Literal['TrustRegionReflection', 'Dogbox', 'Levenberg-Marquardt'] = 'TrustRegionReflection'
parameters: ParameterGroup
problem_list() list[str][source]

Return a list with all problems in the model and missing parameters.

Returns

A list of all problems found in the scheme’s model.

Return type

list[str]

result_path: str | None = None
source_path: StrOrPath = 'scheme.yml'
valid() bool[source]

Check if there are no problems with the model or the parameters.

Returns

Whether the scheme is valid.

Return type

bool

validate() str[source]

Return a string listing all problems in the model and missing parameters.

Returns

A user-friendly string containing all the problems of a model if any. Defaults to ‘Your model is valid.’ if no problems are found.

Return type

str

xtol: float = 1e-08