Project Layout#
braincell is organized so that the public API is flat (everything is
re-exported through the top-level braincell namespace) while the
implementation is layered into underscore-prefixed internal packages. This
page maps the package tree onto the Architecture layers.
Naming convention#
Internal packages carry a leading underscore (
_base,_cv,_compute,_single_compartment,_multi_compartment,_misc) because their import paths are not part of the supported public API.Public re-exports flow through
braincell/__init__.py, plus the curated sub-namespacesbraincell.channel,braincell.ion,braincell.synapse,braincell.mech,braincell.quad,braincell.morph,braincell.filter,braincell.io, andbraincell.vis.Modules inside an internal package are unprefixed (
base.py,lower.py,runtime.py) because they are import targets for sibling code in the same package.
The map#
Package |
Layer |
Responsibility |
|---|---|---|
|
declaration |
|
|
declaration |
the |
|
declaration + runtime |
|
|
declaration |
the declarative mechanism specs ( |
|
declaration |
region & locset selection algebra |
|
geometry |
|
|
discretization |
control volumes and CV policies |
|
runtime |
the execution graph and |
|
integration |
the integrator protocol and solver registry |
|
library |
concrete, self-registering mechanism implementations |
|
IO |
SWC / ASC / NeuroML2 readers, NeuroMorpho client, checkpointing |
|
visualization |
2-D / 3-D rendering, morphometry, export |
Tests are co-located#
Test files live next to the source they cover and are named *_test.py
(e.g. braincell/io/neuromorpho/client.py →
braincell/io/neuromorpho/client_test.py). This is the only naming pytest
discovers reliably in this repo. See Testing.
See also#
Architecture — the conceptual layers this maps onto.