ComponentInfo#

class brainglobe_atlasapi.atlas_generation.atlas_packaging_data.ComponentInfo(name, version, use_existing=False, update_existing=False, existing_version=None, root_dir=None, file_name=None, existing_stub=None, stub=None, metadata=<factory>)[source]#

Bases: object

Container for information about a component of a BrainGlobe atlas (e.g., template, annotation).

This dataclass holds information about a specific component of a BrainGlobe atlas, such as a template or annotation. It includes fields for the component’s name, version, and metadata, as well as flags for whether to use an existing component or update an existing component.

name#

The name of the component (e.g., “allen-adult-mouse-stpt-template”).

Type:

str

version#

The version of the component (e.g., “0.1.0”).

Type:

str

use_existing#

Whether to use the existing component from with the same name and version from the remote (default is False).

Type:

bool, optional

update_existing#

Whether to update an existing component with the same name and version (default is False).

Type:

bool, optional

existing_version#

The version of the existing component to update (required if update_existing is True).

Type:

str, optional

root_dir#

The root directory for the component (e.g., “templates”).

Type:

str, optional

file_name#

The name of the component file (e.g., “anatomical_template.ome.zarr”).

Type:

str, optional

existing_stub#

The remote stub for the existing component (automatically generated if update_existing is True).

Type:

str, optional

stub#

The remote stub for the component (automatically generated if not provided).

Type:

str, optional

metadata#

A dictionary to hold the component metadata (automatically generated in __post_init__).

Type:

dict, optional

Methods

generate_metadata_dict()

Generate a dictionary containing metadata for this component.

Attributes

generate_metadata_dict()[source]#

Generate a dictionary containing metadata for this component.

The metadata dictionary includes the component’s name, version, and location stub.

Returns:

A dictionary containing the component metadata.

Return type:

Dict[str, str]