pymoose.LocalMooseRuntime#

class pymoose.LocalMooseRuntime(identities: List[str], storage_mapping: Optional[Dict[str, Dict]] = None)[source]#

Locally-simulated Moose runtime.

Creates a local runtime with several virtual hosts and optional storage for each.

Example

runtime = LocalMooseRuntime(
    ["alice", "bob", "carole"],
    storage_mapping={
        "alice": {
            "alice_array": np.ones((3, 3)),
            "alice_string": "hello i'm alice",
            "alice_number": 42,
        },
    },
)
Parameters
  • identities – A list of names of identities for virtual hosts.

  • storage_mapping – A dictionary mapping Identities to storage dictionaries. Storage dictionaries are dicts/named tuples of Python objects that correspond to valid PyMoose Values (e.g. native Python numbers, ndarrays, strings, etc.).

__init__()#

Methods

__init__()

evaluate_compiled(comp_bin[, arguments])

evaluate_computation(computation[, ...])

read_value_from_storage(identity, key)

set_default()

write_value_to_storage(identity, key, value)