argdigest.contrib package#
Submodules#
argdigest.contrib.beartype_support module#
Optional beartype support.
Usage in a user library:
from argdigest.contrib.beartype_support import beartype_digest
@beartype_digest(map={…}) def fn(…):
…
argdigest.contrib.pydantic_support module#
Helpers to integrate ArgDigest with pydantic (v2-style).
argdigest.contrib.pyunitwizard_support module#
Integration with PyUnitWizard for physical quantity validation and standardization.
- argdigest.contrib.pyunitwizard_support.check(dimensionality=None, value_type=None, shape=None, unit=None)[source]#
Returns a pipeline function that uses puw.check() to validate the input.
- Parameters:
dimensionality (Dict[str, int] | None)
value_type (Any | None)
shape (tuple | None)
unit (str | None)
- Return type:
Callable[[Any, Any], Any]
- argdigest.contrib.pyunitwizard_support.context(**kwargs)[source]#
Context manager that delegates to pyunitwizard.context if available. If PUW is not installed, it yields without doing anything (unless kwargs are passed, then warning/error?). Assuming if user passes puw_context, they expect PUW to work.
- Parameters:
kwargs (Any)
- argdigest.contrib.pyunitwizard_support.convert(to_unit, to_form=None)[source]#
Returns a pipeline function that converts the quantity to a specific unit/form.
- Parameters:
to_unit (str)
to_form (str | None)
- Return type:
Callable[[Any, Any], Any]