### Run a Mycorrhizal Example Source: https://mycorrhizal.readthedocs.io Execute a specific example script using the uv runner. ```bash uv run python examples/septum/septum_decorator_basic.py ``` -------------------------------- ### Install Mycorrhizal Source: https://mycorrhizal.readthedocs.io Commands for installing the library via pip or uv, including a development mode setup. ```bash # Standard installation pip install mycorrhizal # With uv (recommended) uv pip install mycorrhizal # Development installation git clone https://github.com/Jeff-Ciesielski/mycorrhizal cd mycorrhizal uv pip install -e ".[dev]" ``` -------------------------------- ### Install Mycorrhizal Source: https://mycorrhizal.readthedocs.io Installation commands for the Mycorrhizal library using pip or uv. ```bash # Install pip install mycorrhizal # Or with uv uv pip install mycorrhizal ``` -------------------------------- ### Model Workflows with Hypha Petri Nets Source: https://mycorrhizal.readthedocs.io Define a Petri net using the @pn.net decorator and execute it with a Runner. ```python from mycorrhizal.hypha.core import pn, Runner @pn.net def ProcessingNet(builder: pn.NetBuilder): @builder.place def tasks(bb): ... @builder.transition() async def process(tasks: List, bb): ... runner = Runner(ProcessingNet) await runner.run(blackboard) ``` -------------------------------- ### Define a Finite State Machine with Septum Source: https://mycorrhizal.readthedocs.io Create an asyncio-friendly FSM using the @septum.state decorator and StateMachine class. ```python from mycorrhizal.septum import septum, StateMachine @septum.state(config=StateConfiguration(timeout=5.0)) def ProcessingState(): @septum.on_state async def process(ctx): return ProcessingState.Events.COMPLETE fsm = StateMachine(initial_state=ProcessingState) await fsm.initialize() await fsm.run() ``` -------------------------------- ### Implement Behavior Trees with Rhizomorph Source: https://mycorrhizal.readthedocs.io Construct decision logic using the @bt.tree decorator and composable nodes. ```python from mycorrhizal.rhizomorph import bt, Runner, Status @bt.tree def ThreatResponse(): @bt.root @bt.sequence def root(): yield threat_detected yield engage_threat yield return_to_base runner = Runner(ThreatResponse()) await runner.run(blackboard) ``` -------------------------------- ### Export State Machine to Mermaid Source: https://mycorrhizal.readthedocs.io Generates a Mermaid diagram string from a initialized state machine for visualization in external tools. ```python # Export to Mermaid for visualization fsm = StateMachine(initial_state=MyState) await fsm.initialize() mermaid = to_mermaid(fsm) # Septum FSM print(mermaid) # Copy-paste into Mermaid Live Editor or docs ``` -------------------------------- ### Log Events with Spores Source: https://mycorrhizal.readthedocs.io Configure OCEL-compatible event logging and use the @spore.log_event decorator for auditing. ```python from mycorrhizal.spores import configure, get_spore_sync from mycorrhizal.spores.models import SporesAttr configure(transport=SyncFileTransport("logs/ocel.jsonl")) spore = get_spore_sync(__name__) @spore.log_event( event_type="OrderCreated", relationships={"order": ("return", "Order")}, ) def create_order(items): return Order(items=items) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.