Skip to content
Merged
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/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
publish:
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v4
with:
Expand Down
10 changes: 9 additions & 1 deletion TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ repo, removes the template banner from `README.md`, and finally deletes
- `src/pathsim_<name>/example_block.py` — replace `FirstOrderLag` with your
real blocks. Keep the structure: header comment, docstring documenting
math / parameters / ports, input validation, `*_port_labels`.
- `src/pathsim_<name>/icons/` — one SVG icon per block class, named
`<ClassName>.svg`. `Block.icon()` (pathsim 0.30 and later) reads it from
there and PathView shows it on the canvas. Follow the core icons in
[`pathsim/icons`](https://github.com/pathsim/pathsim/tree/master/src/pathsim/icons):
viewBox `0 0 96 64`, `fill="none" stroke="currentColor" stroke-width="1.6"`,
no colors, since the editor sets them. Blocks without a file have no icon,
and subclasses don't inherit the icon of their parent.
- `tests/` — mirror the structure of `src/`. Tests run with both `unittest`
and `pytest`; physics is verified through a full `Simulation`.
- `docs/source/examples/` — example notebooks. The placeholder is a copied
Expand Down Expand Up @@ -111,4 +118,5 @@ all rendering.
a GitHub Release is published. Versions come from git tags via `setuptools-scm`,
so tag releases as `vX.Y.Z`. Configure a
[PyPI trusted publisher](https://docs.pypi.org/trusted-publishers/) for the
project pointing at this repo and the `publish.yml` workflow.
project pointing at this repo, the `publish.yml` workflow and the `pypi`
environment.
1 change: 1 addition & 0 deletions src/pathsim_toolbox/icons/FirstOrderLag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions tests/test_example_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def test_invalid_params(self):
with self.assertRaises(ValueError):
FirstOrderLag(tau=-1.0)

def test_icon(self):
# read from src/pathsim_toolbox/icons by Block.icon()
self.assertTrue(FirstOrderLag.icon().startswith("<svg"))


class TestFirstOrderLagSimulation(unittest.TestCase):
"""Physics tests run via a full PathSim Simulation."""
Expand Down
Loading