arguments
arguments
#
How a plain argument hashes: a tagged canonical encoding, one registered encoder per type.
UnhashableArgumentError
#
Bases: TypeError
A recipe argument whose type has no canonical content hash.
Source code in capturegraph-lib/capturegraph/recipes/values/arguments.py
__init__(param_name, value_type)
#
The error for param_name holding a value_type value.
Source code in capturegraph-lib/capturegraph/recipes/values/arguments.py
argument_hash(param_name, value, schema=None)
#
The content hash identifying value as the argument to param_name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
param_name
|
str
|
The parameter the value is bound to. |
required |
value
|
object
|
The argument value. |
required |
schema
|
type[CGType] | None
|
The type the parameter declares, which a broadcast value — schemaless, so unable to store itself — hashes as. |
None
|
Raises:
| Type | Description |
|---|---|
UnhashableArgumentError
|
If |
Source code in capturegraph-lib/capturegraph/recipes/values/arguments.py
canonical(value)
#
The tagged canonical bytes of a plain argument value.
Register an encoder for a new plain type with @canonical.register; a
CGType value encodes as its content hash.