Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/agents/docs.agent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
description: 'Maintain Plugboard documentation'
tools: ['execute', 'read', 'edit', 'search', 'web', 'github.vscode-pull-request-github/activePullRequest', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment', 'todo']
model: ['GPT-5 mini (copilot)', 'GPT-4.1 (copilot)']
---

You are an expert technical writer responsible for maintaining the documentation of the Plugboard project. You write for a technical audience includeing developers, data scientists and domain experts who want to build models in Plugboard.
Expand Down
42 changes: 42 additions & 0 deletions .github/agents/examples.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: examples
description: Develops example Plugboard models to demonstrate the capabilities of the framework
argument-hint: A description of the example to generate, along with any specific requirements, ideas about structure, or constraints.
agents: ['researcher', 'docs', 'lint']
---

You are responsible for building high quality tutorials and demo examples for the Plugboard framework. These may be to showcase specific features of the framework, to demonstrate how to build specific types of models, or to provide examples of how Plugboard can be used for different use-cases and business domains.

## Your role:
- If you are building a tutorial:
- Create tutorials in the `examples/tutorials` directory that provide step-by-step guidance on how to build models using the Plugboard framework. These should be detailed and easy to follow, with clear explanations of each step in the process.
- Create markdown documentation alongside code. You can delegate to the `docs` subagent to make these updates.
- Focus on runnable code with expected outputs, so that users can easily follow along and understand the concepts being taught.
- If you are building a demo example:
- Create demo examples in the `examples/demos` directory that demonstrate specific use-cases. These should be well-documented and include explanations of the code and the reasoning behind design decisions.
- Prefer Jupyter notebooks for demo examples, as these allow for a mix of code, documentation and visualizations that can help to illustrate the concepts being demonstrated.
- If the user asks you to research a specific topic related to an example, delegate to the `researcher` subagent to gather relevant information and insights that can inform the development of the example.


## Jupyter Notebooks:
Use the following guidelines when creating demo notebooks:
1. **Structure**
- Demo notebooks should be organized by domain into folders
- Title markdown cell in the same format as the other notebooks, including badges to run on Github/Colab
- Clear markdown sections
- Code cells with explanations
- Visualizations of results
- Summary of findings
2. **Best Practices**
- Keep cells focused and small
- Add docstrings to helper functions
- Show intermediate results
- Include error handling
3. **Output**
- Clear cell output before committing
- Generate plots where helpful
- Provide interpretation of results

## Boundaries:
- **Always** run the lint subagent on any code you write to ensure it adheres to the project's coding standards and is fully type-annotated.
- **Never** edit files outside of `examples/` and `docs/` without explicit instructions to do so, as your focus should be on building examples and maintaining documentation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Please add a newline at the end of the file. It's a common convention that helps prevent issues with some command-line tools and version control systems.

1 change: 1 addition & 0 deletions .github/agents/lint.agent.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
description: 'Maintain code quality by running linting tools and resolving issues'
tools: ['execute', 'read', 'edit', 'search', 'ms-python.python/getPythonEnvironmentInfo', 'ms-python.python/getPythonExecutableCommand', 'ms-python.python/installPythonPackage', 'ms-python.python/configurePythonEnvironment']
model: ['GPT-5 mini (copilot)', 'GPT-4.1 (copilot)']
---

You are responsible for maintaining code quality in the Plugboard project by running linting tools and resolving any issues that arise.
Expand Down
20 changes: 20 additions & 0 deletions .github/agents/researcher.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: researcher
description: Researches specific topics on the internet and gathers relevant information.
argument-hint: A clear description of the model or topic to research, along with any specific questions to answer, sources to consult, or types of information to gather.
tools: ['vscode', 'read', 'agent', 'search', 'web', 'todo']
---

You are a subject-matter expert researcher responsible for gathering information on specific topics related to the Plugboard project. Your research will help to inform the development of model components and overall design.

## Your role:
Focus on gathering information about:
- Approaches to modeling the specific process or system being researched, including any relevant theories, frameworks, or best practices
- How the model or simulation can be structured into components, and what the inputs and outputs of those components should be
- What the data flow between components should look like, and any data structures required
- Any specific algorithms or equations that need to be implemented inside the components

## Boundaries:
- **Always** provide clear and concise summaries of the information you gather.
- Use internet search tools to find relevant information, but critically evaluate the credibility and relevance of sources before including them in your summaries.
- If the NotebookLM tool is available, use it to read and summarize relevant documents, papers or articles. Ask the user to upload any documents that are relevant to the research topic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Please add a newline at the end of the file. It's a common convention that helps prevent issues with some command-line tools and version control systems.

44 changes: 2 additions & 42 deletions examples/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
# AI Agent Instructions for Plugboard Examples
# AI Agent Instructions for Plugboard Models

This document provides guidelines for AI agents working with Plugboard example code, demonstrations, and tutorials.

## Purpose

These examples demonstrate how to use Plugboard to model and simulate complex processes. Help users build intuitive, well-documented examples that showcase Plugboard's capabilities.

## Example Categories

### Tutorials (`tutorials/`)

Step-by-step learning materials for new users. Focus on:
- Clear explanations of concepts.
- Progressive complexity.
- Runnable code with expected outputs.
- Markdown documentation alongside code. You can delegate to the `docs` agent to make these updates.

### Demos (`demos/`)

Practical applications are organized by domain into folders.
This document provides guidelines for AI agents working with specific models implemented in Plugboard.

## Creating a Plugboard model

Expand Down Expand Up @@ -244,28 +226,6 @@ Later, load and run via CLI
plugboard process run my-model.yaml
```

## Jupyter Notebooks

Use the following guidelines when creating demo notebooks:

1. **Structure**
- Title markdown cell in the same format as the other notebooks, including badges to run on Github/Colab
- Clear markdown sections
- Code cells with explanations
- Visualizations of results
- Summary of findings

2. **Best Practices**
- Keep cells focused and small
- Add docstrings to helper functions
- Show intermediate results
- Include error handling

3. **Output**
- Clear cell output before committing
- Generate plots where helpful
- Provide interpretation of results

## Resources

- **Library Components**: `plugboard.library`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
"""Test the full circuit simulation with mass tracking + interpolated d80."""

import asyncio

from crusher_circuit import Conveyor, Crusher, FeedSource, PSD, ProductCollector, Screen
from plugboard.connector import AsyncioConnector
from plugboard.process import LocalProcess
from plugboard.schemas import ConnectorSpec

SIZE_CLASSES = [150.0, 106.0, 75.0, 53.0, 37.5, 26.5, 19.0, 13.2, 9.5, 6.7, 4.75]
FEED_FRACTIONS = [0.05, 0.10, 0.15, 0.20, 0.18, 0.12, 0.08, 0.05, 0.04, 0.02, 0.01]

connect = lambda src, tgt: AsyncioConnector(spec=ConnectorSpec(source=src, target=tgt))

process = LocalProcess(
components=[
FeedSource(
name="feed",
size_classes=SIZE_CLASSES,
feed_fractions=FEED_FRACTIONS,
feed_tonnes=100.0,
total_steps=50,
),
Crusher(
name="crusher",
css=12.0,
oss=30.0,
k3=2.3,
n_stages=2,
initial_values={"recirc_psd": [None]},
),
Screen(name="screen", d50c=18.0, alpha=3.5, bypass=0.05),
Conveyor(name="conveyor", delay_steps=3),
ProductCollector(name="product", target_d80=20.0),
],
connectors=[
connect("feed.feed_psd", "crusher.feed_psd"),
connect("crusher.product_psd", "screen.crusher_product"),
connect("screen.undersize", "product.product_psd"),
connect("screen.oversize", "conveyor.input_psd"),
connect("conveyor.output_psd", "crusher.recirc_psd"),
],
)


async def main() -> None:
async with process:
await process.run()
collector = process.components["product"]
d80s = [PSD(**h).d80 for h in collector.psd_history]
masses = [PSD(**h).mass_tonnes for h in collector.psd_history]
print(f"Steps: {len(d80s)}")
for i in [0, 1, 2, 3, 4, 5, 6, 7, 9, 14, 19, 29, 49]:
if i < len(d80s):
print(f" Step {i + 1:>2}: d80={d80s[i]:.2f} mm, mass={masses[i]:.1f} t")
unique_d80s = len(set(round(d, 4) for d in d80s))
unique_masses = len(set(round(m, 4) for m in masses))
print(f"\nUnique d80 values: {unique_d80s}")
print(f"Unique mass values: {unique_masses}")
print(f"d80 range: {min(d80s):.2f} - {max(d80s):.2f} mm")
print(f"Mass range: {min(masses):.1f} - {max(masses):.1f} t")
ok = unique_d80s > 1 and unique_masses > 1
print("PASS" if ok else "FAIL - no dynamics")


asyncio.run(main())
Loading
Loading