Skip to content

Reference

An example of a custom item plugin.

Attributes:

Name Type Description
__version__

__version__

__version__ = version('datalab_item_plugin_example')

Solution

Bases: Sample

A solution of a single solute at a stated concentration.

Attributes:

Name Type Description
concentration float | None
concentration_unit Literal['mol/L', 'mmol/L']
model_config
solute EntryReference | None
solvent EntryReference | None
type Literal['solutions']

concentration

concentration: float | None = Field(None, ge=0, json_schema_extra={'datalab_include_field_in_summary': True, 'datalab_units': ['mol/L', 'mmol/L'], 'datalab_default_unit': 'mol/L', 'datalab_unit_field': 'concentration_unit'})

concentration_unit

concentration_unit: Literal['mol/L', 'mmol/L'] = Field('mol/L', json_schema_extra={'datalab_hidden': True})

model_config

model_config = ConfigDict(title='Solution', json_schema_extra={'datalab_ui_color': '#3a7ca5', 'datalab_ui_hidden_fields': ['synthesis_information'], 'datalab_section_title': 'Solution'})

solute

solute: EntryReference | None = Field(None, json_schema_extra={'datalab_ref_types': _SUBSTANCE_REF_TYPES})

solvent

solvent: EntryReference | None = Field(None, json_schema_extra={'datalab_ref_types': _SUBSTANCE_REF_TYPES})

type

type: Literal['solutions'] = 'solutions'