Data Modelsο
This module defines the core data models that represent mmCIF file structures. SLOTHβs data hierarchy mirrors the mmCIF format:
MMCIFDataContainerβ top-level container (one or more data blocks)DataBlockβ a named data block (e.g.,data_1ABC)Categoryβ a category within a block (e.g.,_atom_site)Rowβ a single record in a categoryItemβ a column/field in a category
Enumerationsο
Abstract Base Classesο
- class sloth.mmcif.models.DataNode[source]ο
Bases:
ABCAbstract base class for all data nodes in the hierarchy.
Top-level Containerο
- class sloth.mmcif.models.MMCIFDataContainer[source]ο
Bases:
DataContainerA class to represent an mmCIF data container.
- __init__(data_blocks=None, source_format=DataSourceFormat.MMCIF)[source]ο
- Parameters:
source_format (DataSourceFormat)
- property blocks: LazyKeyListο
Provides O(1) lazy list of data block names (prefixed names for consistency).
- property data: DataBlockCollectionο
Provides access to data blocks with both list and dict interfaces.
Data Blockο
- class sloth.mmcif.models.DataBlock[source]ο
Bases:
DataContainerA class to represent a data block in an mmCIF file.
- property categories: LazyKeyListο
Get names of contained categories (prefixed names for external API) - O(1) lazy.
- property data: CategoryCollectionο
Provides read-only access to the category objects.
Categoryο
- class sloth.mmcif.models.Category[source]ο
Bases:
DataContainerA class to represent a category in a data block.
- property items: LazyKeyListο
Get names of contained items - O(1) lazy list.
- property data: LazyItemDictο
Provides O(1) lazy read-only access to the data (loads items on-demand).
- property rows: LazyRowListο
Returns all rows in this category as a lazy list (O(1) creation, cached for performance).
Rowο
Itemο
Lazy Loading Internalsο
These classes provide efficient lazy-loading wrappers over gemmi data structures. They are used internally and typically not instantiated directly.
- class sloth.mmcif.models.LazyGemmiColumn[source]ο
Bases:
listLazy wrapper for gemmi loop columns - data extracted only when accessed. Behaves like a list but loads data from gemmi on first access.
- class sloth.mmcif.models.LazyRowList[source]ο
Bases:
objectA list-like object that creates Row objects only when accessed.
- class sloth.mmcif.models.LazyItemDict[source]ο
Bases:
objectA dict-like object that only loads Item values when accessed, providing O(1) creation.