Skip to content

Fix bugs and improve code organization across SimiCPipeline - #1

Draft
irenemaring with Copilot wants to merge 2 commits into
masterfrom
copilot/improve-code-organization-structure
Draft

Fix bugs and improve code organization across SimiCPipeline#1
irenemaring with Copilot wants to merge 2 commits into
masterfrom
copilot/improve-code-organization-structure

Conversation

Copilot AI commented Mar 31, 2026

Copy link
Copy Markdown

Several correctness bugs, API hygiene issues, and code organization problems existed across the package. This PR addresses them with surgical, targeted changes.

Bug Fixes

  • @staticmethod on module-level function (utils/io.py): format_time was decorated with @staticmethod at module scope, producing a staticmethod descriptor object instead of a callable — any call would raise TypeError.
  • __all__ typo (simicpipeline/__init__.py): "AUProcessor" was appended instead of "AUCProcessor", so the class was silently missing from the public API.
  • == None identity check (utils/io.py): adata.raw == Noneadata.raw is None.
  • load_from_matrix_market path handling: genes_path/cells_path typed as Union[str, Path] with None defaults but .exists() called directly on them. Fixed type hints to Optional[Union[str, Path]] with explicit is not None guard and Path(...) conversion.

API / Public Surface

  • Renamed install_package_install_package and removed it from utils/__init__.py exports. A library package should not expose a pip-installer as public API.
  • Removed setup.cfg — fully redundant with pyproject.toml; settings conflicted (mypy Python 3.9 vs 3.10, line length 100 vs 88).

Dead Code & Import Cleanup

  • Removed large blocks of commented-out class definitions in core/__init__.py, aucprocessor.py, simicpreprocess.py.
  • Removed unused imports (os in _jupyter.py; numpy, coo_matrix, Tuple in utils/io.py).
  • Removed stale section-separator comments; fixed misindented comment inside print_tree docstring.

Tests

Added tests/ directory (previously missing despite pytest being configured) with 14 smoke tests covering format_time, write_pickle, print_tree, SimiCBase, and _load_assignment_file.

… guidelines

Agent-Logs-Url: https://github.com/ML4BM-Lab/SimiCPipeline/sessions/3f107643-064f-4581-b984-c13d8626f3fd

Co-authored-by: irenemaring <72460651+irenemaring@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor code organization and structure for better practices Fix bugs and improve code organization across SimiCPipeline Mar 31, 2026
Copilot AI requested a review from irenemaring March 31, 2026 13:53
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.

2 participants