:py:mod:`salo` ============== .. py:module:: salo Subpackages ----------- .. toctree:: :titlesonly: :maxdepth: 3 events/index.rst outputs/index.rst stencils/index.rst Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 __main__/index.rst cadence/index.rst cli/index.rst salo/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: salo.Session salo.Sessions salo.Event salo.SaloEventModel salo.SaloStencilModel Attributes ~~~~~~~~~~ .. autoapisummary:: salo.fake salo.__version__ salo.__author__ .. py:class:: Session(model: Dict, cadence: salo.cadence.Cadence, defaults: Dict, saved_values: Optional[Dict] = None) .. py:method:: spawn(self, model: Dict, options: Dict) -> None Iterate over event objects in recipe, generate Event objects, and spawn additional child Event objects. .. py:method:: __repr__(self) Return repr(self). .. py:method:: generate(self, with_stencils: bool = False) -> Generator Iterate over Event objects for this Session .. py:method:: __len__(self) .. py:class:: Sessions(config: str, outputs: Optional[List] = None, output_config: Optional[str] = None) .. py:method:: load_config(self, config: pathlib.Path) -> Dict Load Salo configuration file for recipe or output .. py:method:: create_session(self, model: Dict) -> None Create a new Session object for this collection of Sessions .. py:method:: generate(self, with_stencils: bool = False) -> Generator Iterate over Event objects for each Session object .. py:method:: save(self) -> None Pass all Sessions to outputs for saving/post-processing .. py:method:: __repr__(self) Return repr(self). .. py:method:: __len__(self) .. py:class:: Event(model: Dict, session: Session, options: Dict, exclude_none: bool = True) .. py:method:: run(self) -> None Create log event .. py:method:: update_cadence(self) -> None Update the cadence and timestamp for this Event .. py:method:: update_saved_values(self, event: Union[salo.stencils.SaloStencilModel, salo.events.SaloEventModel]) -> None Ensure saved_values are updated if defined in the recipe .. py:method:: get_saved_value(self, key: str, index: Optional[int] = None, is_random: bool = False) -> Any Set the value of an attribute for the event if a saved_value exists and is defined .. py:method:: set_options(self) -> None Set Event options .. py:method:: save_value(self, key: str, value: str) -> None Update Session object with values if a saved_value is defined .. py:method:: _load_model(self, model_path: str) -> pydantic.main.ModelMetaclass Import model object defined in recipe .. py:data:: fake .. py:class:: SaloEventModel(__pydantic_self__, **data: Any) Bases: :py:obj:`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. .. py:class:: Config .. py:attribute:: allow_population_by_field_name :annotation: = True .. py:attribute:: underscore_attrs_are_private :annotation: = True .. py:attribute:: validate_assignment :annotation: = True .. py:attribute:: allow_reuse :annotation: = True .. py:method:: schema_extra(schema: Dict[str, Any], model) -> None :staticmethod: .. py:class:: SaloStencilModel(__pydantic_self__, **data: Any) Bases: :py:obj:`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. .. py:class:: Config .. py:attribute:: allow_population_by_field_name :annotation: = True .. py:attribute:: validate_assignment :annotation: = True .. py:attribute:: allow_reuse :annotation: = True .. py:data:: __version__ :annotation: = 0.1.1 .. py:data:: __author__ :annotation: = Marcus LaFerrera