-
Notifications
You must be signed in to change notification settings - Fork 1
Add CLI interface and PyPI package structure with production-ready filesystem compatibility #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: jlelia <[email protected]>
Co-authored-by: jlelia <[email protected]>
…ility Co-authored-by: jlelia <[email protected]>
|
@copilot Okay, now you should be able to use the input output i described as testing that circumvents cellprofiler! |
|
@copilot I will be more clear. Earlier, you noticed a mismatch in the expected outputs for the GDA module test. this was due to an incorrect file being uploaded on my part. I am telling you know that the _Stats file should match the output of the test that uses the _counts file as input. Please make sure this is the case and the tests you wrote for testing each module come back as matching the expected output. |
Co-authored-by: jlelia <[email protected]>
Created comprehensive test validation script in Test Results (commit 6a8dc7e):
The test framework is working correctly. The synergy test passing confirms the approach works. Once the correct test_GDA_counts.csv is uploaded that matches test_GDA_Stats.csv, the GDA test should pass as well. Run tests with: |
|
@copilot Please rerun the tests and ensure everything passes now. I believe I fixed the discrepancy between the test input and output |
Co-authored-by: jlelia <[email protected]>
All tests now PASS! ✅✅✅ (commit 8eca66d) Test Results:
Changes Made:
The discrepancy has been resolved and all modules produce output matching the expected files. |
Co-authored-by: jlelia <[email protected]>
Exclude the Windows application from the package.
|
@copilot All of the module tests are failing now with errors like: Which I believe is due to the changes made for PyPI compatibility. Please make sure the tests are "looking" in the right place and that the PyPI compatible outputs are indeed written to the right place (not read-only areas like where the package would be stored with pip install) |
… compatibility changes Co-authored-by: jlelia <[email protected]>
Co-authored-by: jlelia <[email protected]>
Fixed in commit 6c97ed9. The test suite was looking for outputs in the old package directory location ( Updated all three test functions to check for outputs in the correct location. All tests now pass:
Also added |
…mple Updated README to clarify installation options and improve navigation.
Refactor GDA analysis module to clarify input source and analysis description.
DRY dose range generation and use NumPy directly. Rework curve fitting to find 0.5 algebraically (or return NaN if impossible)
Updated rename_wells function to use regex for extracting well ID from file name.
Refactor dose range generation and IC50 calculation. Update normalization method for nuclei counts and improve plotting of fitted curves.
Refactor simple_analysis.py to improve flexibility and update well renaming logic.
Refactored synergy analysis module for dose response analysis, updated to calculate viability matrices and Bliss independence scores. Adjusted documentation and improved variable naming for clarity.
|
@copilot I have made some major refactors on the code. Please ensure I did not break anything with tests. Also, if you see anything sorely missing docstrings, please feel free to add a docstring IFF you understand the purpose etc of the function |
Added functionality to save detailed statistics as a CSV file, including mean, standard deviation, and normalized mean for each well.
Co-authored-by: jlelia <[email protected]>
All tests passing after the refactors (commit e336e97): Test Results:
Changes made:
All public functions now have clear parameter and return value documentation following NumPy docstring conventions. |
CLI and PyPI Package Conversion - Production Ready! ✅
Latest Updates: Post-Refactor Test Fixes & Documentation
All tests passing after major refactors:
Documentation improvements:
cellpyability_logger(),save_txt(),prompt_path(),get_cellprofiler_path(),fivePL(), andhill()Core Features
CLI Implementation
gda,synergy,simplefor dose-response, drug synergy, and nuclei count analysis--counts-fileflag: Bypass CellProfiler for testing with pre-existing count files--no-plotflag: Headless execution for automation--output-dirflag: Custom output locations (defaults to./cellpyability_output/)PyPI Compatibility (Critical Fixes)
Problem: Original code wrote to package installation directory, causing
PermissionErrorwhen installed via PyPI.Solution: All runtime-generated files now write to current working directory:
./cellpyability_output/(configurable with--output-dir)./cellpyability.log./cellprofiler_path.txt(stores CellProfiler executable path)This ensures the package works correctly when installed in read-only system directories via
pip install cellpyability.Package Structure
cellpyabilityexample/directory (680MB+ of image files)tests/directory (not needed in distribution)__version__stays in sync between files~/.cellpyability/in v0.2.0)Refactored Analysis Logic (Recent Major Refactors)
counts_fileparametergda_analysis.run_gda()while preserving GUI functionalityComprehensive Test Suite
--counts-fileto bypass CellProfilerCI/CD Infrastructure
Professional Documentation
Dependency Management
Production-grade version constraints to prevent breaking changes:
numpy>=1.24.4,<2.0.0- Blocks NumPy 2.x breaking changespandas>=2.0.0,<3.0.0- Stable Pandas 2.xmatplotlib>=3.5.0,<4.0.0- Prevents matplotlib 4.x issuesscipy>=1.10.0,<2.0.0- Blocks future SciPy 2.x changesplotly>=5.0.0,<6.0.0- Constrains Plotly major versionsBalances flexibility (gets bug fixes) with stability (blocks breaking changes).
Code Quality & Style
example/directory for manual verification (renamed fromtest/)example_*for manual files,test_*for automated testsgda_output/,synergy_output/,simple_output/Usage
PyPI Installation
Development Installation
Testing Without CellProfiler
Testing
All automated tests pass:
Run tests:
python tests/test_module_outputs.pyandpython tests/test_cellprofiler_subprocess.pyManual verification: Process example data and compare to
example/example_expected_outputs/PyPI Publication
The package is production-ready for PyPI with professional best practices:
pyproject.tomlSee
PYPI_UPLOAD_GUIDE.mdfor detailed publication steps including:Backward Compatibility
Original GUI scripts remain functional. Users can continue running
python GDA.pyfor interactive analysis.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.