sbol3.om_unit

Module Contents

Classes

Measure

The purpose of the om:Measure class is to link a numerical value to

PrefixedUnit

The purpose of the om:PrefixedUnit class is to describe a unit of

SingularUnit

The purpose of the om:SingularUnit class is to describe a unit of

Unit

As adopted by SBOL, om:Unit is an abstract class that is extended

Functions

build_measure(→ SBOLObject)

build_prefixed_unit(→ SBOLObject)

build_singular_unit(→ SBOLObject)

class Measure(value: float, unit: str, *, types: Optional[str, list[str]] = None, name: str = None, description: str = None, derived_from: List[str] = None, generated_by: List[str] = None, measures: List[SBOLObject] = None, identity: str = None, type_uri: str = OM_MEASURE)

Bases: CustomIdentified

The purpose of the om:Measure class is to link a numerical value to a om:Unit.

accept(visitor: Any) Any

Invokes visit_measure on visitor with self as the only argument.

Parameters

visitor (Any) – The visitor instance

Raises

AttributeError – If visitor lacks a visit_measure method

Returns

Whatever visitor.visit_measure returns

Return type

Any

class PrefixedUnit(identity: str, symbol: str, label: str, unit: Union[Unit, str], prefix: Union[sbol3.om_prefix.Prefix, str], *, alternative_symbols: List[str] = None, alternative_labels: List[str] = None, comment: str = None, long_comment: str = None, namespace: str = None, attachments: List[str] = None, name: str = None, description: str = None, derived_from: List[str] = None, generated_by: List[str] = None, measures: List[SBOLObject] = None, type_uri: str = OM_PREFIXED_UNIT)

Bases: Unit

The purpose of the om:PrefixedUnit class is to describe a unit of measure that is the multiplication of another unit of measure and a factor represented by a standard prefix such as “milli,” “centi,” “kilo,” etc.

accept(visitor: Any) Any

Invokes visit_prefixed_unit on visitor with self as the only argument.

Parameters

visitor (Any) – The visitor instance

Raises

AttributeError – If visitor lacks a visit_prefixed_unit method

Returns

Whatever visitor.visit_prefixed_unit returns

Return type

Any

class SingularUnit(identity: str, symbol: str, label: str, *, unit: str = None, factor: float = None, alternative_symbols: List[str] = None, alternative_labels: List[str] = None, comment: str = None, long_comment: str = None, namespace: str = None, attachments: List[str] = None, name: str = None, description: str = None, derived_from: List[str] = None, generated_by: List[str] = None, measures: List[SBOLObject] = None, type_uri: str = OM_SINGULAR_UNIT)

Bases: Unit

The purpose of the om:SingularUnit class is to describe a unit of measure that is not explicitly represented as a combination of multiple units, but could be equivalent to such a representation. For example, a joule is considered to be a om:SingularUnit, but it is equivalent to the multiplication of a newton and a meter.

accept(visitor: Any) Any

Invokes visit_singular_unit on visitor with self as the only argument.

Parameters

visitor (Any) – The visitor instance

Raises

AttributeError – If visitor lacks a visit_singular_unit method

Returns

Whatever visitor.visit_singular_unit returns

Return type

Any

class Unit(identity: str, symbol: str, label: str, type_uri: str, *, alternative_symbols: List[str] = None, alternative_labels: List[str] = None, comment: str = None, long_comment: str = None, namespace: str = None, attachments: List[str] = None, name: str = None, description: str = None, derived_from: List[str] = None, generated_by: List[str] = None, measures: List[SBOLObject] = None)

Bases: CustomTopLevel, abc.ABC

As adopted by SBOL, om:Unit is an abstract class that is extended by other classes to describe units of measure using a shared set of properties.

See Appendix A Section A.2 of the SBOL 3.0 specificiation.

build_measure(identity: str, *, type_uri: str = OM_MEASURE) SBOLObject
build_prefixed_unit(identity: str, *, type_uri: str = OM_PREFIXED_UNIT) SBOLObject
build_singular_unit(identity: str, *, type_uri: str = OM_SINGULAR_UNIT) SBOLObject