esrf_pathlib._schemas.fields.concept#

Classes

PathConcept(name, description, ...[, ...])

Concept that is part of an ESRF path.

class esrf_pathlib._schemas.fields.concept.PathConcept(name, description, schema_identifier, regex, deserializer=<class 'str'>, serializer=<class 'str'>, score=1, default_value=None, examples=None)[source]#

Bases: Field

Concept that is part of an ESRF path. For example beamline, proposal, collection, etc.

Parameters:
  • name (str)

  • description (str)

  • schema_identifier (SchemaIdentifier)

  • regex (str)

  • deserializer (Union[Callable[[str], Union[str, date, DataType, TomoResultType, None]], Type[Any]])

  • serializer (Union[Callable[[Union[str, date, DataType, TomoResultType, None]], str], Type[Any]])

  • score (int)

  • default_value (Any)

  • examples (Optional[List[str]])

deserialize(string_value)[source]#

String value used in the path to Python object.

Raises:

PathConceptMatchError

Parameters:

string_value (Optional[str])

Return type:

Union[str, date, DataType, TomoResultType, None]

serialize(py_value, raise_on_missing=True)[source]#

Python object to string value used in the path. When missing and raise_on_missing=False the value "*" is returned.

Raises:

PathConceptValueError

Parameters:
Return type:

str

property regex: str#
property score: int#