Behavior-machine

Latest version: v0.4.0

Safety actively analyzes 688775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

0.3.0

- **[Added]** The **`flow`** machenism that allows you to push information from the current state directly to the next state. The variable `self.flow_in` contains the information from the previous state and you set `self.flow_out` to hold information that goes to the next state. The flow is not carried over unless specified by the state. For `machine`,`sequential states`, `flow` are passed into low-level states.
- **[Changed]** Restructure the code, such that core is in a sperate module instead of using the same file. `Board` is now in `core` instead of it's own namespace.
- **[Added]** Other tests that check for consistency of implementation.

0.2.4

- **[Added]** Ability to load a python dictionary straight into the board. `board.load`
- **[Added]** A shorthand method to transition when the run_thread is done.
- **[Added]** `is_interrupted` for states to check if it is being interrupted.

0.2.3

- **[Fixed]** Changed `isAlive` to `is_alive` -- by Schwarzbaer
- **[Changed]** Change the logging framework to use the python built-in-logger.
- **[Fixed]** Typo of `EXCEPTIION`
- **[Changed]** Minor tweaks to tests.

0.2.2

- **[Added]** Boards can now check if a key already exist using the `exist` method.
- **[Added]** You can specify whether a deep copy or shallow copy of an object is saved in the board using the `deep_copy` flag in the set/get methods. By default, the flag is set to true.
- **[Added]** Additional tests to check the new board functionalities and validate end state runs completely before the machine consider it complete.

0.2.1

Added
- `get_debug_info` that returns a dict that contains debugging informations
- debug flag and callback for `Machine` that quaries all child states for information. This provide snapshot of the current states. It doesn't give the full graph due to transitions
- Tests for all those info
- Name of threads now reflect the name of the state running it. This ease debugging.

Changed
- Reformat the code to follow PEP8 Standard.

Fixed
- Bug where the `interrupt` function in the `machine` has a different method parameter than the base.
- Bug where when interrupting a machine type, nothing is returned.

0.2.0

Added
- API to print debugging information.
- More docstrings for common methods.
- Interruption handling in both parallel and sequential states. Included test for them
- Tested performance of the system
- new status called `NOT_SPECIFIED` for cases where no status is returned.
- README and basic example

Changed
- Changed `interupted` from a boolean to `threading.Event` allow easy cross thread timeout.
- `WaitState` now immediately stops when wait timedout instead of relying on a polling at 10Hz.
- Added class decerator for Enum to make sure `StateStatus` has unique numbers.
- Renamed package to `behavior_machine` & StandardStateLibrary to just `library`

Fixed
- Bug where `StateStatus.UNKNOWN` and `StateStatus.INTERRUPTED` had the same number.
- Bug where threads were not cleaned up when transitioned out of parallel and sequential.
- Race condition in Sequential State where when the Sequential State gets transitioned out, the child thread was asked to join before initialized.
- Exception when checking transitions is now handled correctly and call interupts for internal states.

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.