scitacean.model.construct#

scitacean.model.construct(model, *, _strict_validation=True, _quiet=False, **fields)[source]#

Instantiate a SciCat model.

Warning

If the model is created without validation, no fields will be converted to their proper type but will simply be whatever arguments are passed. See model_construct or pydantic.BaseModel for more information.

A warning will be emitted in this case.

Parameters:
  • model (type[TypeVar(PydanticModelType, bound= BaseModel)]) – Class of the model to create.

  • _strict_validation (bool, default: True) – If True, the model must pass validation. If False, a model is still returned if validation fails.

  • _quiet (bool, default: False) – If False, logs a warning on validation failure.

  • fields (Any) – Field values to pass to the model initializer.

Returns:

TypeVar(PydanticModelType, bound= BaseModel) – An initialized model.