Skip to content

Commit 0fa417b

Browse files
Rasmus-M-Cmarcomelloniprasadtalasila
authored
Adds Simul8 Agent (#26)
Adds dedicated agent for Simul8 software. This agent supports only batch mode simulation and works only on Windows. The code also contains one example. --------- Co-authored-by: Marco Melloni <[email protected]> Co-authored-by: prasadtalasila <[email protected]>
1 parent c211204 commit 0fa417b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+9396
-5
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: SIMUL8 Agent CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "agents/simul8/**"
7+
- ".github/workflows/simul8-agent-ci.yml"
8+
9+
jobs:
10+
ci:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [windows-latest]
15+
16+
# All commands run inside the agent directory
17+
defaults:
18+
run:
19+
working-directory: agents/simul8
20+
21+
steps:
22+
# ───── 1. Checkout ─────
23+
- uses: actions/checkout@v4
24+
25+
# ───── 2. Python + Poetry ─────
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.12"
29+
30+
- name: Install Poetry
31+
env:
32+
POETRY_HOME: ${{ runner.temp }}/poetry
33+
run: |
34+
python -m pip install --upgrade pip
35+
curl -sSL https://install.python-poetry.org | python -
36+
37+
- name: Add Poetry to PATH (Windows)
38+
if: runner.os == 'Windows'
39+
shell: pwsh
40+
run: echo "${{ runner.temp }}\poetry\bin" |
41+
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
42+
43+
# ───── 3. Install dev deps once ─────
44+
- name: Install dev dependencies
45+
run: poetry install --with dev
46+
47+
# ───── 4. Format check ─────
48+
- name: Check formatting (non-blocking)
49+
continue-on-error: true
50+
run: poetry run autopep8 --recursive --diff simul8_agent
51+
52+
# ───── 5. Lint ─────
53+
- name: Run pylint (min score 9.0)
54+
run: poetry run pylint simul8_agent --fail-under=9
55+
56+
# ───── 6. Tests ─────
57+
- name: Run pytest (with coverage)
58+
run: poetry run pytest --cov=simul8_agent --cov-report=xml
59+
60+
- name: Upload coverage to Codecov
61+
uses: codecov/codecov-action@v5
62+
with:
63+
files: coverage.xml
64+
fail_ci_if_error: true
65+
token: ${{ secrets.CODECOV_TOKEN }}
66+
67+
# ───── 7. Build + dist artefacts ─────
68+
- name: Install runtime dependencies
69+
run: poetry install --only main
70+
71+
- name: Build wheel and sdist
72+
run: |
73+
poetry build --format wheel
74+
poetry build --format sdist
75+
76+
- name: Upload dist artefacts
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: simul8-agent-dist
80+
path: |
81+
agents/simul8/dist/*.whl
82+
agents/simul8/dist/*.tar.gz
83+
retention-days: 1 # minimum allowed (≈24 h)

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,26 @@ agents/matlab/dist/
195195
**/resources/*.yml
196196
**/matlab/*.yaml
197197
**/matlab/*.yml
198+
**/simul8/*.yml
199+
**/simul8/*.yaml
198200
config*.yaml
199201
simulation*.yaml
200202
*.csv
203+
interactive.py
204+
*_interactive.py
205+
**/examples/interactive-simulation/*
206+
# SIMUL8 agent
207+
agents/simul8/client
208+
agents/simul8/logs
209+
*.bk8
210+
# Ignore any .s8 files in agents/simul8 (including subdirectories)
211+
agents/simul8/*.s8
201212
#SIMULATION BRIDGE
202213
/logs
203214
/certs
204215
*.pem
205216
*_use.yaml
206217
client/
207-
dist/
208218
/certs
209219
*.pem
210220
*_use.yaml

.vscode/settings.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2+
"python.testing.pytestArgs": ["."],
23
"python.testing.pytestEnabled": true,
3-
"python.testing.pytestArgs": ["simulation_bridge/test"],
4-
"python.testing.autoTestDiscoverOnSaveEnabled": true,
5-
"python.testing.promptToConfigure": false
6-
}
4+
"python.testing.unittestEnabled": false,
5+
"python.testing.cwd": "${workspaceFolder}/agents/simul8",
6+
"python.testing.autoTestDiscoverOnSaveEnabled": true
7+
}

agents/simul8/.coveragerc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[run]
2+
omit =
3+
*/tests/*
4+
*/venv/*
5+
*/.venv/*
6+
*/__init__.py
7+
*/simul8_agent/docs/*
8+
*/simul8_agent/resources/*
9+
10+
[report]
11+
exclude_lines =
12+
if __name__ == .__main__.:
13+
pragma: no cover

agents/simul8/.markdownlint.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"default": true,
3+
"MD003": { "style": "atx" },
4+
"MD007": { "indent": 4 },
5+
"no-hard-tabs": false,
6+
"whitespace": true,
7+
"line-length": true,
8+
"MD033": { "allowed_elements": [ "div", "img" , "p", "i"] }
9+
}

agents/simul8/.pep8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pycodestyle]
2+
max_line_length = 80

0 commit comments

Comments
 (0)