Skip to content

Starting Materials

pydatalab.models.starting_materials

StartingMaterial

Bases: Item, HasSynthesisInfo

A model for representing an experimental sample, based on the connection with cheminventory.net, which mixes container-level and substance-level information.

Attributes:

Name Type Description
CAS str | None

The CAS Registry Number for the substance described by this entry.

GHS_codes str | None

A string describing any GHS hazard codes associated with this item. See https://pubchem.ncbi.nlm.nih.gov/ghs/ for code definitions.

barcode str | None

A unique barcode provided by an external source, e.g., cheminventory.

blocks_obj dict[str, Any]

A mapping from block ID to block data.

chemform str | None

A string representation of the chemical formula associated with this sample.

chemical_purity str | None

The chemical purity of this container with regards to the defined substance.

collections list[Collection]

Inlined info for the collections associated with this item.

comment str | None

Any additional comments or notes about the container.

creator_ids list[PyObjectId]

The database IDs of the user(s) who created the item.

creators list[Person] | None

Inlined info for the people associated with this item.

date IsoformatDateTime | None

The date the item was acquired

date_opened IsoformatDateTime | None

The date the item was opened

description str | None

A description of the item, either in plain-text or a markup language.

display_order list[str]

The order in which to display block data in the UI.

file_ObjectIds list[PyObjectId]

Links to object IDs of files stored within the database.

files list[File] | None

Any files attached to this sample.

full_percent str | None

The amount of the defined substance remaining in the container, expressed as a percentage.

immutable_id PyObjectId

The immutable database ID of the entry.

item_id HumanReadableIdentifier

A locally unique, human-readable identifier for the entry. This ID is mutable.

last_modified IsoformatDateTime | None

The timestamp at which the entry was last modified.

location str | None

The place where the container is located.

molar_mass float | None

Mass per formula unit, in g/mol.

name str | None

The name of the substance in the container.

refcode Refcode

A globally unique immutable ID comprised of the deployment prefix (e.g., grey)

relationships list[TypedRelationship] | None

A list of related entries and their types.

revision int

The revision number of the entry.

revisions dict[int, Any] | None

An optional mapping from old revision numbers to the model state at that revision.

size str | None

The total size of the container, in units of size_unit.

size_unit str | None

Units for the 'size' field.

smiles_representation str | None

A SMILES string representation of a chemical structure associated with this substance.

supplier str | None

Supplier or manufacturer of the chemical.

synthesis_constituents list[Constituent]

A list of references to constituent materials giving the amount and relevant inlined details of consituent items.

synthesis_description str | None

Free-text details of the procedure applied to synthesise the sample

type str

CAS: str | None = Field(alias='Substance CAS')

The CAS Registry Number for the substance described by this entry.

GHS_codes: str | None = Field(alias='GHS H-codes', examples=['H224', 'H303, H316, H319'])

A string describing any GHS hazard codes associated with this item. See https://pubchem.ncbi.nlm.nih.gov/ghs/ for code definitions.

barcode: str | None = Field(alias='Barcode')

A unique barcode provided by an external source, e.g., cheminventory.

blocks_obj: dict[str, Any] = Field({})

A mapping from block ID to block data.

chemform: str | None = Field(alias='Molecular Formula')

A string representation of the chemical formula associated with this sample.

chemical_purity: str | None = Field(alias='Chemical purity')

The chemical purity of this container with regards to the defined substance.

collections: list[Collection] = Field([])

Inlined info for the collections associated with this item.

comment: str | None = Field(alias='Comments')

Any additional comments or notes about the container.

creator_ids: list[PyObjectId] = Field([])

The database IDs of the user(s) who created the item.

creators: list[Person] | None = Field(None)

Inlined info for the people associated with this item.

date: IsoformatDateTime | None = Field(alias='Date Acquired')

The date the item was acquired

date_opened: IsoformatDateTime | None = Field(alias='Date opened')

The date the item was opened

description: str | None

A description of the item, either in plain-text or a markup language.

display_order: list[str] = Field([])

The order in which to display block data in the UI.

file_ObjectIds: list[PyObjectId] = Field([])

Links to object IDs of files stored within the database.

files: list[File] | None

Any files attached to this sample.

full_percent: str | None = Field(alias='Full %')

The amount of the defined substance remaining in the container, expressed as a percentage.

immutable_id: PyObjectId = Field(None, title='Immutable ID', alias='_id', format='uuid')

The immutable database ID of the entry.

item_id: HumanReadableIdentifier

A locally unique, human-readable identifier for the entry. This ID is mutable.

last_modified: IsoformatDateTime | None = None

The timestamp at which the entry was last modified.

location: str | None = Field(alias='Location')

The place where the container is located.

molar_mass: float | None = Field(alias='Molecular Weight')

Mass per formula unit, in g/mol.

name: str | None = Field(alias='Container Name')

The name of the substance in the container.

refcode: Refcode = None

A globally unique immutable ID comprised of the deployment prefix (e.g., grey) and a locally unique string, ideally created with some consistent scheme.

relationships: list[TypedRelationship] | None = None

A list of related entries and their types.

revision: int = 1

The revision number of the entry.

revisions: dict[int, Any] | None = None

An optional mapping from old revision numbers to the model state at that revision.

size: str | None = Field(alias='Container Size')

The total size of the container, in units of size_unit.

size_unit: str | None = Field(alias='Unit')

Units for the 'size' field.

smiles_representation: str | None = Field(alias='SMILES')

A SMILES string representation of a chemical structure associated with this substance.

supplier: str | None = Field(alias='Supplier')

Supplier or manufacturer of the chemical.

synthesis_constituents: list[Constituent] = Field([])

A list of references to constituent materials giving the amount and relevant inlined details of consituent items.

synthesis_description: str | None = None

Free-text details of the procedure applied to synthesise the sample

type: str = Field('starting_materials', const='starting_materials', pattern='^starting_materials$')

Collection

Bases: Entry, HasOwner, HasBlocks

Attributes:

Name Type Description
blocks_obj dict[str, Any]

A mapping from block ID to block data.

collection_id HumanReadableIdentifier

A short human-readable/usable name for the collection.

creator_ids list[PyObjectId]

The database IDs of the user(s) who created the item.

creators list[Person] | None

Inlined info for the people associated with this item.

description str | None

A description of the collection, either in plain-text or a markup language.

display_order list[str]

The order in which to display block data in the UI.

immutable_id PyObjectId

The immutable database ID of the entry.

last_modified IsoformatDateTime | None

The timestamp at which the entry was last modified.

num_items int | None

Inlined number of items associated with this collection.

relationships list[TypedRelationship] | None

A list of related entries and their types.

title str | None

A descriptive title for the collection.

type str
blocks_obj: dict[str, Any] = Field({})

A mapping from block ID to block data.

collection_id: HumanReadableIdentifier = Field(None)

A short human-readable/usable name for the collection.

creator_ids: list[PyObjectId] = Field([])

The database IDs of the user(s) who created the item.

creators: list[Person] | None = Field(None)

Inlined info for the people associated with this item.

description: str | None

A description of the collection, either in plain-text or a markup language.

display_order: list[str] = Field([])

The order in which to display block data in the UI.

immutable_id: PyObjectId = Field(None, title='Immutable ID', alias='_id', format='uuid')

The immutable database ID of the entry.

last_modified: IsoformatDateTime | None = None

The timestamp at which the entry was last modified.

num_items: int | None = Field(None)

Inlined number of items associated with this collection.

relationships: list[TypedRelationship] | None = None

A list of related entries and their types.

title: str | None

A descriptive title for the collection.

type: str = Field('collections', const='collections', pattern='^collections$')
check_id_names(values)

Slightly upsetting hack: this case should be covered by the pydantic setting for populating fields by alias names.

check_ids(values)
to_reference(additional_fields: list[str] | None = None) -> EntryReference

Populate an EntryReference model from this entry, selecting additional fields to inline.

Parameters:

Name Type Description Default
additional_fields list[str] | None

A list of fields to inline in the reference.

None

add_missing_collection_relationships(values)

add_missing_synthesis_relationships(values)

Add any missing sample synthesis constituents to parent relationships

add_molar_mass(v, values)

check_id_names(values)

Slightly upsetting hack: this case should be covered by the pydantic setting for populating fields by alias names.

refcode_validator(v)

Generate a refcode if not provided.

to_reference(additional_fields: list[str] | None = None) -> EntryReference

Populate an EntryReference model from this entry, selecting additional fields to inline.

Parameters:

Name Type Description Default
additional_fields list[str] | None

A list of fields to inline in the reference.

None