Skip to content

Use-Cases and Replication Studies#62

Open
leon-k-martin wants to merge 75 commits into
mainfrom
dev
Open

Use-Cases and Replication Studies#62
leon-k-martin wants to merge 75 commits into
mainfrom
dev

Conversation

@leon-k-martin

Copy link
Copy Markdown
Collaborator

No description provided.

feat: add warm-started sweep functionality and enhance coupling evaluation in tvboptim templates
…w execution for Slurm, Snakemake, and Nextflow
- Added new analysis observables to the ontology, including Lyapunov, Gradient, and Finite-Difference analyses.
- Updated the `pyproject.toml` to include `h5netcdf` as a dependency.
- Enhanced the `tvbo_datamodel.yaml` to clarify the extensibility of analysis types.
- Implemented result handling in the BIDS format within the `bids.py` adapter.
- Introduced a method to generate result stems in the `experiment.py` class.
- Updated workflow emission to support Slurm gather jobs, ensuring results are reassembled correctly.
- Added a new `finalize.sbatch` template for gathering results from Slurm jobs.
- Created a new Lyapunov analysis template for dynamic analysis in experiments.
…ckends

Replace the process-wide `logging.disable(CRITICAL)` and scattered bare
`print()`s with a single `tvbo` logger hierarchy and one central switch,
shared by `tvbo run`, `SimulationExperiment.run()`, and the generated
tvboptim/jax backend scripts, so logging is consistent no matter the entry
point and can be turned off centrally.

- tvbo/log.py: NullHandler by default (silent as a library); public API
  configure_logging / ensure_configured / set_log_level / get_log_level /
  get_logger / silence / log_level, plus the TVBO_LOG_LEVEL env switch. An
  explicitly set level sticks across repeated runs.
- __init__: drop the global logging.disable; re-export the public API.
- CLI: a global --log-level/--verbose/--quiet callback configures every verb;
  _common.info/die route through the logger (machine-readable emit_json stays
  on stdout).
- run(): ensure_configured() so scripts/notebooks surface progress like the CLI
  without clobbering an app's own logging.
- Hot-path print() -> logger in classes/, codegen/, data/, adapters/julia.
- Generated code: logging.getLogger("tvbo.run"); drop the _quiet/_log/print
  banner scheme; the standalone __main__ configures from TVBO_LOG_LEVEL.
  Generated output is byte-identical apart from logging lines.
- log.py: drop the unused get_logger() helper; trim the OFF-level aliases to
  OFF/NONE (the two documented spellings).
- experiment.py: hoist `from tvbo.log import ensure_configured` to module scope
  (was a per-call function-local import).
- cli: emit user-facing output through a bare formatter (no "LEVEL [name]"
  diagnostic prefix), matching the plain lines the CLI printed before.
- generated tvboptim: simplify the _log() helper to a single-arg form; guard the
  per-iteration algorithm progress with logger.isEnabledFor(INFO) so the float()
  device->host syncs are skipped when INFO is suppressed.
- codegen/templater._log_source: skip building the numbered listing when INFO is off.
- normalize stray blank lines after the added module loggers.
…52 Nlin 2009c space

- Introduced new text files containing ranked center coordinates for the Desikan-Killiany and Destrieux atlases.
- The files are formatted for compatibility with existing atlas data structures.
…pace definition and add FSLMNI152 coordinate space file
… HermiT

- streaming_reducers: skip a registered streaming reducer whose factory does
  not resolve in the installed backend (e.g. tvboptim 0.2.4 without
  windowed_cov), falling back to the byte-identical recompute path instead of
  emitting a call that raises AttributeError at runtime.
- postprocess_struct_owl: re-type float datatype-restriction facet literals to
  xsd:float so HermiT accepts min_coverage's 0.0-1.0 bounds (owlgen emits them
  in xsd:double notation, which HermiT rejects on an xsd:float datatype; ELK
  does not check facets, so only HermiT surfaced it).
Lyapunov and gradient analysis diagnostics reused the experiment's
differentiation-truncation window (grad_horizon/block_size). For the Benettin
JVP Lyapunov this stop_gradient-truncates the segment, so the initial-state
tangent never reaches the segment end -> leading exponent = log(0) = -inf
(test_tbptt_lyapunov: max|Δ|=inf). Strip the truncation kwargs from analysis
solves via _analysis_solver_kwargs (keeping coupling-evaluation config), matching
the reference diagnostics which build a plain Heun(). Also pre-empts the same
failure in the AD/FD gradient analyses (they would fail next after lyapunov).
- Introduced a new `dynamics` field in the observation schema to allow for online reduction and monitoring of auxiliary state systems.
- Updated the test suite to enhance the validation of hemisphere-consistent atlas aliases, refactoring the test structure for clarity and reusability.
- Documented the motivation and scope for transitioning to codegen-emit streaming reducers, emphasizing the need for backend independence and integration with the new `Observation.dynamics` mechanism.
- Modified the experiment template to ensure proper handling of network and dataset observations as external inputs during algorithm execution.
Review fixes on the central-logging work:

- cli/_common.py: die() falls back to stderr when the configured level would
  suppress ERROR (e.g. --log-level OFF / TVBO_LOG_LEVEL=OFF), so a fatal abort
  never exits non-zero in silence; restores the 'error:' prefix on that path.
- cli/__init__.py: the callback configures logging with force=True so the bare
  CLI format wins even when 'import tvbo' already installed the default
  diagnostic handler because TVBO_LOG_LEVEL was set in the environment.
- tvbo-tvboptim-algorithm.py.mako: split the progress if so the config-guard
  ValueError fires on 'verbose' alone; only the info() progress line stays
  gated behind isEnabledFor(INFO) (unchanged generated code bar a comment).
- Introduced `runtime_sized` attribute in `SweepAxis` to handle axes whose cell count is determined at runtime from a source branch.
- Updated `WorkflowPlan` to accommodate runtime-sized axes, ensuring they do not contribute to static cell counts during planning.
- Enhanced `extract_axes` to identify and set axes as runtime-sized based on the experiment's initial state configuration.
- Modified `_run_one` to handle sharding for runtime-sized branches, logging appropriate messages for task execution.
- Adjusted Snakemake emission to resolve dependencies correctly for experiments using branch-restart.
- Updated `ExplorationResult` to support observations from branch-restart analyses, ensuring proper handling of per-cell analysis.
- Enhanced templates for `tvbo-tvboptim-experiment.py.mako` and `tvbo-tvboptim-sweep.py.mako` to support new branch analysis features.
- Added support for noise-seed axes and network-scope parameters in the experiment workflow.
The generated optimizer used tvboptim's DefaultPrintCallback, which prints to
stdout and bypasses the central tvbo logger — so optimization progress could
not be silenced or redirected through the one switch the rest of the run uses.

Add a minimal, logging-native LoggingProgressCallback (a tvboptim
AbstractCallback that emits 'step i/total: loss=...' on the tvbo.run logger)
and wire it into the experiment and optim templates in place of
DefaultPrintCallback. TVBO_LOG_LEVEL / tvbo.set_log_level / the CLI --quiet now
govern optimizer progress exactly as they govern everything else.

max_steps is threaded into the multi-stage create_optimizer call so the
'i/total' count matches the actual run length.
# Conflicts:
#	tvbo/templates/tvboptim/tvbo-tvboptim-experiment.py.mako
Central, switchable logging across CLI, run(), and generated backends
…nsforms

- lengths_matrix now applies name:length/lengths transforms, mirroring
  weights_matrix (add_transform already documents "length" as a valid target)
- callable transforms import modules beside the study YAML via a shared
  _source_dir_on_path context manager (also used by the graph_generator
  builder); inject L/network lazily, and pass M as L for length-target
  transforms so a callable naming L cannot re-enter lengths_matrix (recursion)
- get_normative_connectome_data(with_nodes=True): _resolve_from_parcellation
  preserves the sidecar's per-node region labels + MNI positions so cortical
  networks are keyed by region (align by label, never by node position)
- Reframe as 'one specification, two payoffs' (reproducible + comparable)
- Runnable quickstart on the core JAX backend; from_db, iri, and report examples
- Accurate capabilities, 14-backend table, platform section, and curated-library counts
- Add graphical abstract (real Fig 1), nested anatomy (SVG), and tool-coverage figures
- Refresh the docs homepage intro and hero figure
… metadata

Lower windowed reducers (sliding-window FC) to backend source from a
declarative spec instead of a hardcoded backend factory. The recipe lives in
database/reducers/*.yaml (state + add/evict/resync/emit assignment strings); a
general resolver (tvbo/codegen/reducers.py) sympifies each RHS and prints it via
the target backend printer, so the same spec emits jax/numpy/julia. The
algorithm template emits the resolved assignments into backend-shaped
scaffolding, with no reducer-specifics in the template.

- tvbo/codegen/reducers.py: general resolve_streaming_reducer(spec, fmt)
- tvbo/database/reducers/windowed_fc.yaml: declarative co-moment FC recipe
- tvbo/codegen/streaming_reducers.py: StreamingReducerSpec + YAML loader/registry
- tvbo/codegen/code.py: backend-abstracted outer/diag/zero_diagonal/matmul printers
- tvbo/parse/expression.py: linear-algebra array-function vocab
- tvbo-tvboptim-algorithm.py.mako: general windowed-reducer emission
- tvbo/codegen/reducers_unification.md: design note for folding into resolve_reduction

Verified byte-identical to compute_fc (incl. DC baseline) on EI_Tuning; the same
spec lowers cleanly to julia.
- AggregationType.median + Observation.histogram (lo/hi/n): a per-node
  histogram is folded into the integrator carry and the 0.5 quantile read at
  finalize (O(bins) memory, no trajectory). resolve_reduction requires the
  histogram slot for median (raises otherwise) rather than assuming a range;
  render_reduction emits the histogram-median reducer (mean path unchanged).
- StateVariable.evict_equation + resolve_reduction windowed/evict fields carry
  sliding-window (add/evict/resync) metadata for a dynamics observer.
… + n/step)

Fall back to the axis domain when explored_values is absent; n==1 yields a
single point [lo] rather than the 11-point default.
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