API reference
griddler
ParameterSet
Bases: dict
A simple extension of the dict
class, requiring that:
- all keys are strings, and
- all values are valid. Valid values are integers, floats, or strings, or lists (or tuples) composed of valid values.
Source code in griddler/__init__.py
stable_hash(hash_length=10)
Create a stable hash of this parameter set. Implemented as a BLAKE2 digest of the JSON representation of the parameter set:
Examples:
>>> ParameterSet({"gamma": 1.0, "R0": 0.9}).stable_hash()
'544601bc1dbb3346faff' # pragma: allowlist secret
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hash_length
|
int
|
Number of characters in the hash |
10
|
Returns:
Type | Description |
---|---|
str
|
hash |
Source code in griddler/__init__.py
griddler.run_squash(func, parameter_sets, add_parameters=True, parameter_columns=None, add_hash=True, hash_column='hash')
Source code in griddler/__init__.py
griddler.replicated(func, n_replicates_key='n_replicates', seed_key='seed', replicate_var='replicate', replicate_type=pl.Int64)
Source code in griddler/__init__.py
griddler.griddle
parse(griddle)
Convert a griddle into a list of parameter sets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
griddle
|
dict
|
griddle |
required |
Returns:
Type | Description |
---|---|
list[dict]
|
list of parameter sets |
Source code in griddler/griddle.py
read(path)
Read a griddle file, and convert to parameter sets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
path to griddle |
required |
Returns:
Type | Description |
---|---|
list[dict]
|
list of parameter sets |
validate(griddle)
Validate that a griddle is well-formed
Parameters:
Name | Type | Description | Default |
---|---|---|---|
griddle
|
dict
|
dictionary |
required |
Raises:
Type | Description |
---|---|
AssertionError
|
if not valid |