From 31b1294cbbcb07a3778e3d6355b82afa9d0aefd3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 24 Aug 2026 22:04:46 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20publish=20as=20`pyautoreduce`=20?= =?UTF-8?q?=E2=80=94=20`autoreduce`=20on=20PyPI=20is=20not=20ours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `autoreduce` on PyPI belongs to github.com/ayush9pandey/AutoReduce, an unrelated and actively maintained project (0.1.0 in 2020 through 0.9 on 2026-08-12). We claimed that distribution name in pyproject.toml and our README told users to `pip install autoreduce` — which installs a stranger's package. The `[hst]`/`[psf]` extras do not exist there, so pip warns about unknown extras and installs it anyway. The distribution becomes `pyautoreduce` (free on PyPI, matches the repo name and the org prefix). The IMPORT package stays `autoreduce`, so no source renaming: `target.py`, `psf/starred_epsf.py`, `scripts/reduce_cosmos_web_ring.py` and `docs/design/hst_acs_pipeline.md:253` were already writing `pyautoreduce[starred]`, so this resolves that drift rather than creating it. - pyproject.toml: name, with the reason recorded in place - autoreduce/__init__.py: resolve __version__ against the distribution. Left alone, the rename degrades __version__ to the PackageNotFoundError fallback "0.0.dev0" — or picks up the foreign project's version when it happens to be installed, and package/provenance.py writes that into every reduction.json as ours. - README.md, docs/design/hst_acs_pipeline.md:479, and the two ImportError install hints (psf/stpsf_model.py, package/cosmic_rays.py) Deliberately unchanged: package/provenance.py's tuple (fed to `__import__(package).__version__` — import names, and the import package is unchanged) and .github/workflows/main.yml's `package: autoreduce` input (Heart's lib-tests.yml uses it as the import package for `pytest --cov` and as a repo-mapping key, not as a distribution name). Verified on a 3.12 venv: wheel METADATA is `Name: pyautoreduce` / `Requires-Python: >=3.12` with `top_level.txt` still `autoreduce`; `autoreduce.__version__` and the provenance record resolve; 302 tests pass. Closes #71 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01V19RfJbExKP4hsT5c6LttV --- README.md | 6 +++--- autoreduce/__init__.py | 6 +++++- autoreduce/package/cosmic_rays.py | 2 +- autoreduce/psf/stpsf_model.py | 2 +- docs/design/hst_acs_pipeline.md | 2 +- pyproject.toml | 8 +++++++- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 02e6795..930e5a5 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ longer-term roadmap (WFC3, JWST, per-exposure frame products) in ## Installation ```bash -pip install autoreduce # core (outputs + packaging only) -pip install "autoreduce[hst]" # + the STScI HST reduction stack (drizzlepac) -pip install "autoreduce[psf]" # + high-fidelity PSF reconstruction back-ends +pip install pyautoreduce # core (outputs + packaging only) +pip install "pyautoreduce[hst]" # + the STScI HST reduction stack (drizzlepac) +pip install "pyautoreduce[psf]" # + high-fidelity PSF reconstruction back-ends ``` diff --git a/autoreduce/__init__.py b/autoreduce/__init__.py index 97c7429..85a9143 100644 --- a/autoreduce/__init__.py +++ b/autoreduce/__init__.py @@ -13,7 +13,11 @@ from importlib.metadata import version as _version, PackageNotFoundError try: - __version__ = _version("autoreduce") + # The distribution is `pyautoreduce`; the import package is `autoreduce` + # (PyAutoReduce#71). Looking up "autoreduce" here would resolve to the + # unrelated PyPI project of that name when it happens to be installed, and + # fall back to "0.0.dev0" when it is not. + __version__ = _version("pyautoreduce") except PackageNotFoundError: __version__ = "0.0.dev0" diff --git a/autoreduce/package/cosmic_rays.py b/autoreduce/package/cosmic_rays.py index a139504..9c6d290 100644 --- a/autoreduce/package/cosmic_rays.py +++ b/autoreduce/package/cosmic_rays.py @@ -50,7 +50,7 @@ def masker_for(adapter_key: str) -> Callable[[np.ndarray], np.ndarray]: except ImportError as err: raise ImportError( "frame_products needs deepCR for per-frame cosmic-ray masks — " - "pip install autoreduce[frames] (or pip install deepCR)" + "pip install pyautoreduce[frames] (or pip install deepCR)" ) from err model = deepCR(mask=DEEPCR_MODELS[adapter_key], device="CPU") diff --git a/autoreduce/psf/stpsf_model.py b/autoreduce/psf/stpsf_model.py index 7733299..608ffc7 100644 --- a/autoreduce/psf/stpsf_model.py +++ b/autoreduce/psf/stpsf_model.py @@ -48,7 +48,7 @@ def model_frame_psf( import stpsf except ImportError as err: raise ImportError( - "tier-2b model PSFs need stpsf — pip install autoreduce[psf] " + "tier-2b model PSFs need stpsf — pip install pyautoreduce[psf] " "(or pip install stpsf, plus its reference data)" ) from err import poppy diff --git a/docs/design/hst_acs_pipeline.md b/docs/design/hst_acs_pipeline.md index e9fbb0d..97d638b 100644 --- a/docs/design/hst_acs_pipeline.md +++ b/docs/design/hst_acs_pipeline.md @@ -476,7 +476,7 @@ Design decisions: model + threshold, so datasets remain re-maskable). WFC3/IR skips deepCR — calwf3 up-the-ramp fitting already flags IR CRs in DQ. Mask-only by contract: deepCR inpainting is never used — bad pixels are - masked, never fabricated. Optional dependency: `autoreduce[frames]`. + masked, never fabricated. Optional dependency: `pyautoreduce[frames]`. - **Masking policy** — any nonzero DQ bit, deepCR CR pixel, off-chip or non-finite/non-positive-ERR pixel is masked-by-noise (`noise = MASKED_NOISE_VALUE`, `data = 0`), so each frame's diff --git a/pyproject.toml b/pyproject.toml index 1ed0907..75a8e57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,13 @@ requires = ["setuptools>=79.0", "setuptools-scm", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "autoreduce" +# The distribution name is `pyautoreduce`, NOT `autoreduce`: `autoreduce` on +# PyPI belongs to an unrelated, actively maintained project +# (github.com/ayush9pandey/AutoReduce — automated model reduction of nonlinear +# dynamical systems, 0.1.0 in 2020 through 0.9 in 2026). We cannot publish +# under it, and until 2026-08-24 our own README told users to install it. +# The IMPORT package stays `autoreduce` — see PyAutoReduce#71. +name = "pyautoreduce" dynamic = ["version"] description = "Data reduction of HST (and future JWST/other) imaging into modeling-ready datasets for PyAutoLens and PyAutoGalaxy" readme = { file = "README.md", content-type = "text/markdown" }