Skip to content

model.model_resources

The source of a model, a file or the SBML itself.

Source dataclass

Source(source, path=None, content=None)

Class for keeping track of the resolved sources.

is_content

is_content()

Check if the source is Content.

to_dict

to_dict()

Convert to dict.

Used for serialization.

from_source classmethod

from_source(source, base_dir=None)

Resolve the source string.

Parameters:

Name Type Description Default
source Union[Source, str, Path]

path of the model or the SBML itself.

required
base_dir Path | None

directory a relative path is resolved against, the current working directory by default.

None

Returns:

Type Description
Source

The resolved source.

Raises:

Type Description
OSError

if the path of the source does not exist.