Hamilton¶
Full Hamilton integration. Touch-points are custom Hamilton actions. This is installed by default.
- burr.integrations.hamilton.Hamilton(
- inputs: Dict[str, StateSource | LiteralSource],
- outputs: Dict[str, Output],
- driver: Driver = None,
Interface to represent the ‘computing’ part of an action
- burr.integrations.hamilton.from_state(
- key: str,
- missing: Literal['drop', 'error'] = 'error',
Indicates that an input should come from state. Specify “missing” to allow for missing keys to be dropped or raise an error.
- Parameters:
key – Key in state to use
missing – What to do if the key is missing
- Returns:
A StateSource object – use by Hamilton(inputs=…)
- burr.integrations.hamilton.from_value(value: Any) LiteralSource ¶
Indicates that an input should come from a literal (variable/constant) value. Use this if you just want to fix a parameter into the Hamilton DAG.
- Parameters:
value – Value to use
- Returns:
A LiteralSource object – use by Hamilton(inputs=…)
- burr.integrations.hamilton.update_state(key: str) Output ¶
At the update step of a Hamilton Action, call state.update to the key field of state. Used with outputs= parameter of Hamilton(…)
- Parameters:
key – Field in state to udpate
- Returns:
An Output object
- burr.integrations.hamilton.append_state(key: str)¶
At the update state of a Hamilton Action, call state.append to the key field of state. Used with outputs= parameter of Hamilton(…)
- Parameters:
key – Field in state to append to
- Returns:
An Output object