diff --git a/README.md b/README.md index 5bcff569..229223d4 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ implementation. Use `pip install openhcs-basicpy` for this fork. Do not install both distributions into the same environment: they provide the same Python package. Numerical and saved-model controls cover Python 3.12 and 3.14; this does not establish biological validity for a new acquisition. +Use the `BaSiC` Python API shown below; the inherited, unimplemented CLI has +been removed rather than advertised as a working command. A python package for background and shading correction of optical microscopy images [![PyPI](https://img.shields.io/pypi/v/openhcs-basicpy.svg)](https://pypi.org/project/openhcs-basicpy) diff --git a/VERSION b/VERSION index f0bb29e7..3a3cd8cc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.0 +1.3.1 diff --git a/docs/openhcs-distribution-20260930.rst b/docs/openhcs-distribution-20260930.rst index 4143c69e..6ef49cea 100644 --- a/docs/openhcs-distribution-20260930.rst +++ b/docs/openhcs-distribution-20260930.rst @@ -2,7 +2,7 @@ OpenHCS distribution checkpoint ============================== ``openhcs-basicpy`` 1.3.0 packages the existing OpenHCSDev JAX fork as an -ordinary registry dependency. The Python package and CLI remain ``basicpy``; +ordinary registry dependency. The Python package remains ``basicpy``; no algorithm, dispatcher, compatibility alias or second implementation is introduced. Do not install upstream ``basicpy`` beside this distribution: both own that Python package. Scientific attribution and the MIT license are retained. @@ -30,3 +30,23 @@ activation. Durable wheel/XML receipts are retained under ``/home/ts/wt/openhcs-issue-batch-20260929/basicpy-project-dependency-20260930``; the disposable installed target belongs to the parent dependency task at ``/home/ts/.cache/agent-scratch/basicpy-package-20260930/installed``. + +Corrective publication checkpoint +-------------------------------- + +The advertised console script failed its actual installed entrypoint check: +``basicpy --help`` imported a removed ``Device`` type. Source inspection also +found that its processing body was only TODO comments and a no-op return. +The queued 1.3.0 release was cancelled before any job steps ran; its original +tag and evidence are retained, not overwritten. No 1.3.0 publication is claimed. + +Version 1.3.1 removes that dead module and console-script declaration in place. +The functioning BaSiC Python API remains unchanged. A standalone CLI is not +implemented as an unrelated expansion of the OpenHCS dependency request. + +Actual corrective acceptance: build from a fresh sdist, install the new wheel +into a separate owned target, then seven tests pass on Python3.14 in12.58s. +The new installed-distribution test verifies no advertised console command and +no dead CLI module. All functioning Python module bytes match the earlier +wheel that passed numerical tests on both Python3.12 and3.14; the only removed +Python source is the unimplemented CLI. Thus no numerical owner was rewritten. diff --git a/setup.cfg b/setup.cfg index 76ba3693..1a99f272 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,10 +39,6 @@ package_dir = [options.packages.find] where = src -[options.entry_points] -console_scripts = - basicpy = basicpy.__main__:main - [options.extras_require] autotune = hyperactive>=4.4.0,<5 diff --git a/src/basicpy/__main__.py b/src/basicpy/__main__.py deleted file mode 100644 index b90eec37..00000000 --- a/src/basicpy/__main__.py +++ /dev/null @@ -1,135 +0,0 @@ -"""CLI entry point for BaSiCPy.""" -import argparse -import logging -from pathlib import Path -from typing import Optional - -from basicpy import BaSiC -from basicpy.basicpy import Device - -# Initialize the logger -logging.basicConfig( - format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", - datefmt="%d-%b-%y %H:%M:%S", -) - - -def main( - input_dir: Path, - output_dir: Path, - pattern: Optional[str], - timelapse: Optional[bool], - **settings, -) -> None: - - # Check to make the input and output directories exists - # TODO: Make output directory if it doesn't exist? Commented now for testing - # assert input_dir.exists() - # assert output_dir.exists() - - # For now, just validate command line inputs - # basic = BaSiC(**settings) - - # TODO: Handle file loading better, use pattern - # images = image_tools.load_images(input_dir.iterdir()) - - # corrected = basic.fit_transform(images, timelapse=settings["timelapse"]) - - # TODO: Save the files - # for i in range(corrected.shape[-1]): - - # output = corrected[..., i] - - return - - -def snake_to_camel(string: str): - - split = string.split("_") - - camel_pieces = split[:1] + [s.capitalize() for s in split[1:]] - - return "".join(camel_pieces) - - -if __name__ == "__main__": - - parser = argparse.ArgumentParser( - prog="BaSiCPy", description="BaSiC flatfield shading correction." - ) - - # Logging verbosity - parser.add_argument( - "-v", - "--verbose", - help="Show verbose outputs when running BaSiC. Useful for debugging.", - action="store_true", - required=False, - ) - - # Input arguments for file i/o - parser.add_argument( - "--inpDir", - dest="input_dir", - help="Path to input images.", - metavar="FOLDER", - type=Path, - required=True, - ) - parser.add_argument( - "--outDir", - dest="output_dir", - help="Path to output images.", - metavar="FOLDER", - type=Path, - required=True, - ) - parser.add_argument( - "--pattern", - help="A regular expression pattern for selected images in inpDir.", - metavar="REGEX", - type=Path, - required=False, - ) - - # Input arguments for BaSiC settings - settings = BaSiC().dict() - for k, v in settings.items(): - description = BaSiC.__fields__[k].field_info.description - parser.add_argument( - f"--{snake_to_camel(k)}", - dest=k, - type=type(v), - help=description, - metavar=type(v).__name__, - default=v, - required=False, - ) - parser.add_argument( - "--device", - help="Device to run on. Must be one of [cpu,gpu,tpu].", - metavar="DEVICE", - type=Device, - default=Device.cpu, - required=False, - ) - parser.add_argument( - "--timelapse", - help="Apply timelapse or photobleaching correction.", - action="store_true", - required=False, - ) - - args = parser.parse_args() - logger = logging.getLogger("basicpy") - if args.verbose: - logger.setLevel(logging.DEBUG) - - logger.info("BaSiCPy Input Arguments") - logger.info("-----------------------") - for k, v in vars(args).items(): - logger.info(f"{k}: {v}") - - logger.info("") - - main(**vars(args)) diff --git a/tests/test_installed_distribution.py b/tests/test_installed_distribution.py new file mode 100644 index 00000000..9bcd762d --- /dev/null +++ b/tests/test_installed_distribution.py @@ -0,0 +1,10 @@ +"""Acceptance checks against the installed fork wheel, not a source-path shim.""" + +from importlib.metadata import distribution +from importlib.util import find_spec + + +def test_distribution_does_not_advertise_an_unimplemented_cli(): + package = distribution("openhcs-basicpy") + assert not package.entry_points.select(group="console_scripts") + assert find_spec("basicpy.__main__") is None