Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,35 @@ Full detail: `docs/source/installation.md` and `docs/source/container.md`.

- `src/shapepipe/` — the package (src-layout). `modules/` holds the pipeline
modules and their `*_runner.py` wrappers; `pipeline/` is execution and file
I/O; `utilities/`; `canfar/` is CANFAR/cluster job orchestration. Console entry
points (`shapepipe_run`, `summary_run`, `canfar_*`) are defined under
I/O; `utilities/`; `canfar/` monitors CANFAR sessions. Console entry
points (`shapepipe_run`, `canfar_*`, `plot_coverage_map`) are defined under
`[project.scripts]`.
- `tests/` — the whole test suite, one discovery root: `module/` (per-module
unit/property/integration tests), `unit/` (structural), `science/` (fast
guardrails), `cluster/` (candide-only), `helpers/` (shared library code).
See `tests/README.md`.
- `workflow/` — **the production orchestration**: a Snakemake workflow over the
same `shapepipe_run` calls. `bin/sp` is the entry point (`run`, `report`,
`container`, `cancel`); `Snakefile` plus `rules/{prepare,exposure,tile}.smk`
are the rule graph; `scripts/` holds the plain Python each rule
shells out to; `config.yaml` declares one run (tile list, the scratch and
persistent roots, the container); `config/cfis/` holds the committed ini
chain; `profiles/nibi/config.yaml` is the SLURM executor profile. Deep
reference: `workflow/README.md`. User-facing: `docs/source/workflow.md`.
- `example/` — a runnable example pipeline (`example/config.ini`) on a single
CFIS tile; doubles as the CI smoke test.
- `scripts/` — shell / Python / notebook helpers (`sh/`, `python/`, `jupyter/`),
symlinked onto `$PATH` inside the image.
- `docs/` — Sphinx sources; the API docs are generated from docstrings.

**There is no concept of a catalogue version in the code.** Nothing branches on
`v1.3`..`v1.6` or `v2.0`, and there are no sky patches (`P1`..`P9`): a campaign
is a tile list, and the version of a catalogue is the git tag of the code that
produced it. The pre-Snakemake bash job
layer (`scripts/sh/run_job_sp_canfar_v2.0.bash`, `job_sp_canfar_v2.0.bash`,
`job_list_help.bash`, `functions.sh`) stays — it is version-free, and
sp_validation's image-simulation workflow calls it.

## Development workflow

**We are in rapid iteration.** Changes that require re-running the pipeline are fine; a PR that changes science defaults (detection parameters, cuts, module options) does not need a completed rerun to be accepted — state what we expect the rerun to show, and do the rerun when it comes up.
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
--disable-dlopen --disable-sphinx && \
make -j"$(nproc)" && make install && \
cd / && rm -rf /tmp/openmpi-*
ENV PATH="/opt/ompi/bin:${PATH}" \

Check warning on line 89 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-publish

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 89 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-publish

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 89 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-publish

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 89 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-publish

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 89 in Dockerfile

View workflow job for this annotation

GitHub Actions / Deploy API Documentation

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/

Check warning on line 89 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-publish

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
LD_LIBRARY_PATH="/opt/ompi/lib:${LD_LIBRARY_PATH}"

# uv — fast reproducible Python deps installer. pyproject.toml + uv.lock
Expand Down Expand Up @@ -139,6 +139,7 @@
uv pip install --no-deps -e . && \
for ext in .py .sh .bash; do \
for script in /app/scripts/*/*$ext; do \
[ -e "$script" ] || continue; \
link_name=$(basename $script $ext); \
ln -s $script /usr/local/bin/$link_name; \
done; \
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ to start:
- `Installation <https://cosmostat.github.io/shapepipe/installation.html>`_ — getting ShapePipe onto your machine or cluster.
- `Basic execution <https://cosmostat.github.io/shapepipe/basic_execution.html>`_ and `configuration <https://cosmostat.github.io/shapepipe/configuration.html>`_ — running ``shapepipe_run`` and writing pipeline configs.
- `Container workflow <https://cosmostat.github.io/shapepipe/container.html>`_ — what's in the image and the ``pyproject.toml`` / ``uv.lock`` / ``Dockerfile`` layers.
- `Running on a cluster <https://cosmostat.github.io/shapepipe/clusters.html>`_ — pulling the image and submitting jobs, with worked candide (SLURM) and CANFAR examples.
- `Running on a cluster <https://cosmostat.github.io/shapepipe/clusters.html>`_ — pulling the image and submitting jobs, with a worked candide (SLURM) example.
- `The Snakemake workflow <https://cosmostat.github.io/shapepipe/workflow.html>`_ — the production orchestration for a whole tile list, driven by ``workflow/bin/sp``.

If you use ShapePipe in academic work, please cite Guinot et al. (2022) and
Farrens et al. (2022).
3 changes: 0 additions & 3 deletions bin/canfar_submit_job.py

This file was deleted.

3 changes: 0 additions & 3 deletions bin/summary_run.py

This file was deleted.

37 changes: 8 additions & 29 deletions docs/source/clusters.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Running on a Cluster

ShapePipe runs the same way on every cluster: **through the container**. You
pull the image once, bind-mount your clone, and run `shapepipe_run` (or the
CANFAR submission tooling) inside it — there is no environment to install or
activate on the host. This page covers the shared pattern, then the specifics
for each supported machine.
pull the image once, bind-mount your clone, and run `shapepipe_run` inside it —
there is no environment to install or activate on the host. This page covers
the shared pattern, then the specifics for each supported machine.

For what is *inside* the image and how it is built, see
[Container Workflow](container.md).
Expand Down Expand Up @@ -67,32 +66,12 @@ over unchanged.

## CANFAR

CANFAR submission does not go through a batch scheduler. Instead you submit
container jobs to CANFAR's headless system with the `canfar_submit_job` console
script (backed by the `canfar` library), and watch them with `canfar_monitor` /
`canfar_monitor_log`. Pipeline steps are **bit-coded** through `-j` (the same
scheme as `scripts/sh/job_sp_canfar.bash`), the PSF model is chosen with
`-p psfex|mccd`, and `-V` selects the image version:
ShapePipe has no CANFAR submission path. Production orchestration is the
Snakemake workflow in `workflow/` — see `workflow/README.md`. It is SLURM-only and has no CANFAR execution mode, so a
CANFAR campaign means moving to a SLURM site (nibi, candide).

```bash
# Submit pipeline step(s) for the configured tiles (bit-coded -j).
canfar_submit_job -j 1 -p psfex -V 1.1

# Monitor sessions/jobs and stream logs.
canfar_monitor
canfar_monitor_log
```

The full production run — input preparation, the per-step `-j` table, and
post-processing — is documented in the
[CANFAR production walkthrough](pipeline_canfar.md).

```{note}
The CANFAR production submission scripts (`scripts/sh/job_sp_canfar*.bash`) still
run under the pre-container environment and are slated for the same
container-first cleanup the candide scripts received. Treat the walkthrough as
the current-but-evolving production procedure.
```
`canfar_monitor` and `canfar_monitor_log` stay: they list, filter and destroy
CANFAR sessions, independently of how those sessions were started.

## ccin2p3

Expand Down
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@

myst_enable_extensions = ["html_image"]

# Generate slug anchors for h1-h3 so in-page links like
# `[Mask images](#mask-images)` resolve instead of warning.
myst_heading_anchors = 3

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down
3 changes: 1 addition & 2 deletions docs/source/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ Data access &amp; infrastructure (CANFAR / UNIONS):
| Package | Purpose |
|---------|---------|
| [vos](https://github.com/opencadc/vostools) | CADC / CANFAR VOSpace access |
| [skaha](https://github.com/shinybrar/skaha) | CANFAR Science Platform sessions |
| canfar | CANFAR container-job submission |
| canfar | CANFAR session monitoring |
| [astroquery](https://astroquery.readthedocs.io/) | external catalogue queries |
| [cs_util](https://github.com/CosmoStat/cs_util) | shared CosmoStat utilities |
| [sqlitedict](https://github.com/RaRe-Technologies/sqlitedict) | on-disk pipeline state |
Expand Down
Loading
Loading