Skip to content

fix(cli): use read-only mode for operators in convolve subcommand (#124) - #272

Open
ashishsoni-ai wants to merge 2 commits into
NNPDF:mainfrom
ashishsoni-ai:fix/convolve-operator-read-only
Open

ashishsoni-ai wants to merge 2 commits into
NNPDF:mainfrom
ashishsoni-ai:fix/convolve-operator-read-only

Conversation

@ashishsoni-ai

Copy link
Copy Markdown
Contributor

Closes #124

Summary

  • Replaced eko.EKO.edit with eko.EKO.read using contextlib.ExitStack in pineko convolve CLI so operator tar archives are opened strictly read-only and automatically closed upon completion without mutating disk files.
  • Fixed the multi-operator loop (if len(operators) > 1: bug) so multiple operator paths are properly loaded and convolved.
  • Marked op_paths as required=True in Click to provide a clear error message when no operator is passed.
  • Added unit tests in tests/test_cli_convolve.py testing read-only operator loading, multi-operator support, and missing operator handling.
  • Added changelog entry.

Verification

  • pytest -k "not test_nnpdf_grids" tests/: 22 passed, 2 deselected.
  • black --check: clean (0 issues).
  • flake8 --max-line-length=88: clean (0 issues).
  • git diff --check: clean (0 issues).

AI usage

  • Harness: Antigravity IDE
  • Model: Gemini 4 Hydrogen

@felixhekhorn felixhekhorn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good to know such a Python feature exists! Below some minor comments to make "dummy" a bit more verbose

Comment thread tests/test_cli_convolve.py Resolved
Comment thread tests/test_cli_convolve.py Resolved
Comment thread tests/test_cli_convolve.py Resolved
@felixhekhorn felixhekhorn added the enhancement New feature or request label Nov 25, 2026
@ashishsoni-ai

ashishsoni-ai commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @felixhekhorn! Applied your suggestions in tests/test_cli_convolve.py and re-verified with pytest, black, and flake8.

@felixhekhorn

Copy link
Copy Markdown
Contributor

Thanks @felixhekhorn! Applied your suggestions in \ ests/test_cli_convolve.py\ and re-verified with \pytest\ and \�lack/\ lake8.

your shell is still broken 🙃

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

convolute side-effect

2 participants