SamplesToLoad#

class astropathdb.db_io._sample_utils.SamplesToLoad(sdata, sampleids, element_id, input_kwargs)#

A dataclass that can be used to determine which samples to load.

Loads samples based on input kwargs and sampleids passed to the constructor.

Parameters:
  • sdata (SpatialData) – The spatial data object.

  • sampleids (str | int | list[str | int]) – A list of sample IDs to load.

  • element_id (str) – The element ID to query.

  • input_kwargs (str | Mapping[str, Any]) – A dictionary of input kwargs for the element query.

SamplesToLoad Attributes#

SamplesToLoad Properties#

input_kwargs

Holds the input kwargs for the element query.

has_samples

Check if there are samples to load.

results_key

Returns the results key for the element query.

SamplesToLoad References#

Attribute Reference#

attribute sdata: InitVar[SpatialData]#
attribute sampleids: str | int | list[str | int]#
attribute element_id: str#

Property Reference#

property input_kwargs#
Type:

Mapping[str, Any]

Return type:

Mapping[str, Any]

Holds the input kwargs for the element query.

If the input_kwargs is a bool or str, it will be converted to an empty dict. If it is a Mapping, it will be returned as a dict. If it is not one of these types, a TypeError will be raised.

property has_samples#
Type:

bool

Return type:

bool

Check if there are samples to load.

property results_key#
Type:

str

Return type:

str

Returns the results key for the element query.

Private Attribute Reference#

attribute __input_kwargs: Mapping[str, Any]#