config¶
One home for constants that more than one notebook reads.
collect writes the files named here, load reads them,
and analysis notebooks import Cfg instead of restating a path.
A knob that only one analysis uses stays in that analysis.
class Cfg:
"""Shared paths. Each line is a choice."""
# Paths are anchored to the repo root,
# so notebooks work from any working directory.
ROOT = Path(__file__).resolve().parents[1]
# Codex cell-type census, written by collect.download_codex.
CENSUS = ROOT / "data" / "cell_types.csv.gz"
# Other Codex tables, one <product>.csv.gz each,
# written on demand by collect.download_codex.
CODEX = ROOT / "data" / "codex"
# Every pair of cells with at least one proofread end,
# weighted by synapse count and sorted by presynaptic cell;
# written by collect.collect_connections.
# Read it lazily with load.scan_connections
# and filter before collecting.
CONNECTIONS = ROOT / "data" / "connections.parquet"
# One file per batch of proofread cells while
# collect.collect_connections runs;
# a rerun skips the batches that are there,
# and the merge deletes the folder.
CONNECTIONS_PARTS = ROOT / "data" / "connections_parts"
# One SWC file per root id, written by collect.collect_skeletons.
SKELETONS = ROOT / "data" / "skeletons"
# Codex side and column tables already under CODEX;
# load reads them, and collect.download_codex writes them on demand.
VISUAL_TYPES = CODEX / "visual_neuron_types.csv.gz"
COLUMNS = CODEX / "column_assignment.csv.gz"
# One row per proofread neuron,
# the list that separates neurons from unproofread fragments.
CLASSIFICATION = CODEX / "classification.csv.gz"
FIGURES = ROOT / "figures"
pl.DataFrame(
{
"name": [_k for _k in vars(Cfg) if _k.isupper()],
"value": [str(_v) for _k, _v in vars(Cfg).items() if _k.isupper()],
}
)
shape: (10, 2)
| name | value |
|---|---|
| str | str |
| "ROOT" | "/home/jaeho/projects/champalim… |
| "CENSUS" | "/home/jaeho/projects/champalim… |
| "CODEX" | "/home/jaeho/projects/champalim… |
| "CONNECTIONS" | "/home/jaeho/projects/champalim… |
| "CONNECTIONS_PARTS" | "/home/jaeho/projects/champalim… |
| "SKELETONS" | "/home/jaeho/projects/champalim… |
| "VISUAL_TYPES" | "/home/jaeho/projects/champalim… |
| "COLUMNS" | "/home/jaeho/projects/champalim… |
| "CLASSIFICATION" | "/home/jaeho/projects/champalim… |
| "FIGURES" | "/home/jaeho/projects/champalim… |