Architecture: package dependencies
Page kind: Explanation (C4 component level). This page shows which of the monorepo’s own top-level Python packages import which others, which dependency rules are enforced, and which are still open decisions. The context and container levels (lab users, SerialEM, storage servers, Viking, the build hosts) are on the umbrella site, https://connectomes.pitt.edu/. Package contents are in Packages.
Every edge below comes from the import graph, not from this page’s author. To check a statement here, regenerate the graph and the rule results with the monorepo’s Python:
venv\pyre314\Scripts\python.exe -I .cursor\skills\nornir-improve-loop\architecture.py graph <out.json>
venv\pyre314\Scripts\python.exe -I .cursor\skills\nornir-improve-loop\architecture.py check
The graph lists each edge with its import count and the files that make it; the counts are not repeated here.
Components
A component is a top-level package that sits directly in a nornir-* submodule folder (or dm4).
Package |
Folder |
Role |
|---|---|---|
|
|
Base library under every other package (logging, console output, MQTT telemetry helpers). |
|
|
Thread and process pools. |
|
|
Image registration, transforms, mosaics. |
|
|
Volume model library. |
|
|
DM4 image reader. |
|
|
Annotation crop export, shipped in the build manager’s folder as its own package. |
|
|
Application: |
|
|
Application: Pyre registration GUI. |
|
|
Application: web front end. |
|
|
CherryPy host, shipped in the web folder as its own package. |
|
|
Application: build dashboard. |
|
|
Application: volume controller. |
Dependencies
Each row is one package and the packages it imports, taken from the graph’s edges.
Package |
Imports |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
none of the other packages |
|
none of the other packages |
The applications are at the top, nornir_imageregistration and the other libraries sit in the middle, and
nornir_shared is the base.
Enforced rules
The contracts are in .importlinter at the monorepo root, each with a one-line reason. They run through
architecture.py check (not plain lint-imports, which needs every package installed). All four held when the
page was written.
Contract |
Meaning |
|---|---|
|
|
|
Applications above |
|
|
|
|
Open decisions
These rules fail against the code today, so they are not in .importlinter and carry no exemption. Each is waiting
for a decision (no decision records exist yet under docs/decisions/).
arch-pools-layer:nornir_poolsshould sit belownornir_imageregistration. One guarded lazy import innornir-pools/nornir_pools/__init__.py(ConfigureForkPoolWorker, for forked workers) points back up. It is the only package-level cycle (nornir_imageregistrationandnornir_pools). Options: an exemption cited by its decision record, a worker-init hook innornir_poolsthatnornir_imageregistrationregisters, or no rule.arch-acyclic-nornir_imageregistration,arch-acyclic-nornir_buildmanager,arch-acyclic-pyre,arch-acyclic-nornir_shared: each package has cycles between its own subpackages (the graph’ssubpackageCycles). Options per package: break the cycles first, then add theacyclic_siblingscontract, or no rule.