Skip to content

Each example in examples/<name>/, and init --example - #56

Merged
shimoura merged 8 commits into
mainfrom
examples-folder
Nov 20, 2026
Merged

shimoura merged 8 commits into
mainfrom
examples-folder

Conversation

@shimoura

@shimoura shimoura commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Each example now lives in its own folder, laid out like a project, so everything of one model is in one place and runs from there. Part of #45.

  • examples/<name>/ for toy, toy_two_areas, pd14, jiang24 and humam: builder, networks, simulation and analysis settings, plots, experiments and the Brian2 models it uses, with its README. Run it from its folder: cd examples/pd14 && microcircuit-lab run --network pd14_downscaled. No core change was needed for that; every builder writes the same files as before.
  • init --example <name> copies an example into a project's folders (builders/pd14, configs/network/pd14, ...); it can be given several times. If the project has a different version of one of its items (e.g. its own builders/pd14), the example is not copied and init says which item.
  • init again changes nothing and says nothing about what the project already has the same; a toy you changed is kept.
  • init --with-core copies only the core, no longer every example. Plain init still gives the folders and the toy.
  • Outside a project, run and generate say where to run from, or to make a project with init.
  • Shared Brian2 models (e.g. iaf_psc_exp.py) are copied into each example that uses them; a test checks the copies stay the same.
  • Tests run from examples/toy/ (tests/conftest.py); the other examples via run_from(...).
  • Docs: the builder READMEs are now the examples' READMEs; links to the examples point to GitHub, so they also work in a project's copy of the core.

Breaking: init --with-core no longer copies the examples; add them with --example <name>.

@shimoura
shimoura merged commit c67bbf4 into main Nov 20, 2026
3 checks passed
@shimoura
shimoura deleted the examples-folder branch November 20, 2026 14:33
@shimoura shimoura mentioned this pull request Nov 20, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant