Skip to content

Comments

Transition to hip-cargo format#176

Open
landmanbester wants to merge 64 commits intomainfrom
typer
Open

Transition to hip-cargo format#176
landmanbester wants to merge 64 commits intomainfrom
typer

Conversation

@landmanbester
Copy link
Collaborator

This is a fairly major refactor which should obviate the need to maintain pfb in cult-cargo by transitioning to the hip-cargo format`. Some of the highlights:

  1. Use uv for package management (good riddance poetry)
  2. Enforce code quality checks with ruff
  3. Use Typer instead of Click for the CLI (no more clickify_parameters)
  4. Automatically generate cabs from the CLI definitions in pre-commit-hooks. This was one of the main reasons for the migration. I used to "generate" the CLI from the cab schema which is a bit backwards
  5. Separate lightweight installation with lazy imports which only installs the CLI and provides cabs and recipes (the default). Heavy imports only happen in the core implementation which is now a simple python function with standard types (no more passing opts around, all parameters should be explicit). The
  6. Automatically publish a linked container image tagged with:
    • {branch-name} on PR to main
    • {latest} on main
    • semantic version on tag

This is still a bit of WIP but at least the old test suite is passing. I suspect the merge will take a while to sort out. I also still need to add a few more tests for the new functionality

Copilot AI review requested due to automatic review settings January 27, 2026 09:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Transitions pfb-imaging to the new hip-cargo cab format and a Typer-based lightweight CLI, enabling auto-generated cab definitions and a uv/ruff-driven toolchain.

Changes:

  • Added Typer CLI wrappers with lazy core imports for imaging commands.
  • Added hip-cargo cab YAMLs (and a generator script) to replace the previous Stimela/Click schema approach.
  • Migrated packaging/CI/container setup to uv + ruff and updated GitHub Actions workflows.

Reviewed changes

Copilot reviewed 87 out of 153 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/pfb_imaging/cli/sara.py New Typer CLI wrapper for sara with lazy core import
src/pfb_imaging/cli/restore.py New Typer CLI wrapper for restore with argument parsing
src/pfb_imaging/cli/model2comps.py New Typer CLI wrapper for model2comps
src/pfb_imaging/cli/kclean.py New Typer CLI wrapper for kclean
src/pfb_imaging/cli/init.py New Typer CLI wrapper for init with list-parsing helpers
src/pfb_imaging/cli/grid.py New Typer CLI wrapper for grid
src/pfb_imaging/cli/fluxtractor.py New Typer CLI wrapper for fluxtractor
src/pfb_imaging/cli/degrid.py New Typer CLI wrapper for degrid
src/pfb_imaging/cli/init.py Registers Typer subcommands and exposes app entrypoint
src/pfb_imaging/cabs/sara.yaml New hip-cargo cab definition for sara
src/pfb_imaging/cabs/restore.yaml New hip-cargo cab definition for restore
src/pfb_imaging/cabs/model2comps.yaml New hip-cargo cab definition for model2comps
src/pfb_imaging/cabs/kclean.yaml New hip-cargo cab definition for kclean
src/pfb_imaging/cabs/init.yaml New hip-cargo cab definition for init
src/pfb_imaging/cabs/hci.yaml New hip-cargo cab definition for hci
src/pfb_imaging/cabs/grid.yaml New hip-cargo cab definition for grid
src/pfb_imaging/cabs/fluxtractor.yaml New hip-cargo cab definition for fluxtractor
src/pfb_imaging/cabs/degrid.yaml New hip-cargo cab definition for degrid
src/pfb_imaging/cabs/init.py Convenience helpers for locating cab files
src/pfb_imaging/init.py Project utilities (env/dask helpers, logos) moved under pfb_imaging
scripts/generate_cabs.py Script to auto-generate cab YAMLs from CLI functions
pyproject.toml Migrates from Poetry to PEP 621 + uv build backend; adds ruff/pytest config
README.rst Updates Stimela usage examples to new recipe reference format
Dockerfile Switches base image and installs via uv
.rayignore Adds Ray ignore rules for large data & project artifacts
.pre-commit-config.yaml Adds ruff hooks and a local cab-generation hook
.github/workflows/ci.yml Reworks CI to use uv and adds ruff formatting/lint steps
MANIFEST.in Removes Poetry-era packaging includes
pfb/workers/smoovie.py Removes legacy Click-based worker CLI
pfb/workers/restore.py Removes legacy Click-based worker CLI
pfb/workers/main.py Removes legacy Click-based CLI entrypoint
pfb/workers/fluxtractor.py Removes legacy Click-based worker CLI
pfb/workers/degrid.py Removes legacy Click-based worker CLI
pfb/utils/restoration.py Removes legacy restoration utility (migrated/refactored elsewhere)
pfb/stimela_cabs.yml Removes old Stimela cab include file
pfb/prox/prox2.py Removes unused/legacy prox helper
pfb/parser/uncabbedcabs.yml Removes legacy scabha/stimela cab wiring
pfb/parser/spotless.yaml Removes legacy schema
pfb/parser/smoovie.yaml Removes legacy schema
pfb/parser/schemas.py Removes legacy schema loader
pfb/parser/sara.yaml Removes legacy schema
pfb/parser/restore.yaml Removes legacy schema
pfb/parser/pmopts.yml Removes legacy schema include
pfb/parser/pdopts.yml Removes legacy schema include
pfb/parser/out.yml Removes legacy schema include
pfb/parser/model2comps.yaml Removes legacy schema
pfb/parser/kclean.yaml Removes legacy schema
pfb/parser/init.yaml Removes legacy schema
pfb/parser/hci.yaml Removes legacy schema
pfb/parser/gridding.yml Removes legacy schema include
pfb/parser/grid.yaml Removes legacy schema
pfb/parser/fluxtractor.yaml Removes legacy schema
pfb/parser/dist.yml Removes legacy schema include
pfb/parser/degrid.yaml Removes legacy schema
pfb/parser/cgopts.yml Removes legacy schema include
pfb/parser/init.py Removes legacy parser package module
pfb/opt/fista.py Removes legacy optimization implementation
pfb/operators/psi2.py Removes legacy operator implementation
pfb/operators/psi.py Removes legacy operator implementation
pfb/operators/psf.py Removes legacy operator implementation
pfb/operators/gauss.py Removes legacy operator implementation
pfb/operators/fft.py Removes legacy operator implementation
pfb/operators/energy.py Removes legacy experimental operator implementation
pfb/deconv/hogbom.py Removes legacy deconvolution implementation
pfb/deconv/clark.py Removes legacy deconvolution implementation
pfb/init.py Removes legacy top-level package init (functionality moved to pfb_imaging)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…=1.5 by default. Apply beam at full frequency resolution to injected transient spectra
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