salo

Subpackages

Submodules

Package Contents

Classes

Session

Sessions

Event

SaloEventModel

Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details.

SaloStencilModel

Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details.

Attributes

fake

__version__

__author__

class salo.Session(model: Dict, cadence: salo.cadence.Cadence, defaults: Dict, saved_values: Optional[Dict] = None)[source]
spawn(self, model: Dict, options: Dict) None[source]

Iterate over event objects in recipe, generate Event objects, and spawn additional child Event objects.

__repr__(self)[source]

Return repr(self).

generate(self, with_stencils: bool = False) Generator[source]

Iterate over Event objects for this Session

__len__(self)[source]
class salo.Sessions(config: str, outputs: Optional[List] = None, output_config: Optional[str] = None)[source]
load_config(self, config: pathlib.Path) Dict[source]

Load Salo configuration file for recipe or output

create_session(self, model: Dict) None[source]

Create a new Session object for this collection of Sessions

generate(self, with_stencils: bool = False) Generator[source]

Iterate over Event objects for each Session object

save(self) None[source]

Pass all Sessions to outputs for saving/post-processing

__repr__(self)[source]

Return repr(self).

__len__(self)[source]
class salo.Event(model: Dict, session: Session, options: Dict, exclude_none: bool = True)[source]
run(self) None[source]

Create log event

update_cadence(self) None[source]

Update the cadence and timestamp for this Event

update_saved_values(self, event: Union[salo.stencils.SaloStencilModel, salo.events.SaloEventModel]) None[source]

Ensure saved_values are updated if defined in the recipe

get_saved_value(self, key: str, index: Optional[int] = None, is_random: bool = False) Any[source]

Set the value of an attribute for the event if a saved_value exists and is defined

set_options(self) None[source]

Set Event options

save_value(self, key: str, value: str) None[source]

Update Session object with values if a saved_value is defined

_load_model(self, model_path: str) pydantic.main.ModelMetaclass[source]

Import model object defined in recipe

salo.fake
class salo.SaloEventModel(__pydantic_self__, **data: Any)[source]

Bases: pydantic.BaseModel

Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details.

__pretty__ is used by [devtools](https://python-devtools.helpmanual.io/) to provide human readable representations of objects.

class Config[source]
allow_population_by_field_name = True
underscore_attrs_are_private = True
validate_assignment = True
allow_reuse = True
static schema_extra(schema: Dict[str, Any], model) None[source]
class salo.SaloStencilModel(__pydantic_self__, **data: Any)[source]

Bases: pydantic.BaseModel

Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details.

__pretty__ is used by [devtools](https://python-devtools.helpmanual.io/) to provide human readable representations of objects.

class Config[source]
allow_population_by_field_name = True
validate_assignment = True
allow_reuse = True
salo.__version__ = 0.1.1
salo.__author__ = Marcus LaFerrera