Skip to content

Troutpy v0.1.1

Choose a tag to compare

@sergiomarco25 sergiomarco25 released this 16 Jun 07:54
· 11 commits to main since this release
457253a

Release Notes: v0.1.1

We are excited to announce the release of troutpy v0.1.1! This release marks a major milestone, introducing our foundational tool, preprocessing, and plotting APIs, alongside critical ecosystem compatibility fixes for spatialdata, dask, and pandas.

Additionally, we have streamlined our dependency tree to make the core installation incredibly lightweight, shifting heavier domain-specific packages to optional extras, and removed several deprecated legacy functions.


🚀 Added

  • Core API Foundation: Introduced the basic suite of preprocessing (pp), tool (tl), and plotting (pl) functions.
  • Robust Test Suite: Added a comprehensive test suite (tests/) validating public APIs against a synthetic SpatialData fixture.
  • Enhanced CI Testing: Added troutpy[spatial-stats] to the test environment to guarantee optional integrations (sainsc, squidpy) are continually verified.

🔄 Changed & Streamlined

  • Lightweight Core: Trimmed core package requirements to the absolute minimum needed to import troutpy (added missing numba, dropped unused joblib).
  • Optional Extras: Moved heavy or specialized dependencies into lazy-imported optional extras. You can now customize your installation depending on your workflow:
    • pip install troutpy[spatial-stats] (for squidpy, sainsc)
    • pip install troutpy[segmentation-free] (for points2regions)
    • pip install troutpy[chord] (for mpl-chord-diagram)
    • pip install troutpy[morphology] (for scikit-image)
    • pip install troutpy[factor-analysis] (for drvi)
    • Or install everything at once: pip install troutpy[all]
  • API Docs: Completely updated docs/api/*.md to fully reflect the newly streamlined public API footprint.

🛑 Removed (Deprecations)

  • Entirely removed legacy functions superseded by tl.adaptative_source_score and tl.adaptative_source_score_optimized:
    • tl.compute_source_cells
    • tl.distance_to_source_cell
    • tl.compute_distant_cells_proportion
    • tl.compute_source_score
    • tl.characterize_cell_like_structures

🔧 Other Fixes & Optimization

Algorithmic & Vectorization Fixes

  • tl.adaptative_source_score_optimized: Fixed an AttributeError occurring when sdata["table"].X is a dense array by explicitly converting it via csr_matrix(...) instead of calling .tocsr().
  • tl.calculate_target_cells: Fixed a critical gene alignment crash under pandas 2.3.x with a CategoricalIndex by swapping out a join for a robust reindex.

Ecosystem & Compatibility Updates

  • Dask & SpatialData Compatibility: Fixed an issue in pp.filter_urna and pp.aggregate_urna where boolean-indexing the transcripts points dataframe dropped crucial .attrs. Also removed an obsolete .compute() call that caused failures on newer dask versions.
  • Plotting Key Alignment: Aligned the default cluster_key in pl.global_distribution_from_source ("kmeans_distribution") to perfectly match the column written by tl.cluster_distribution_from_source.
  • Dependency Pinning & Workarounds:
    • Blocked anndata==0.13.0rc1 to prevent an upstream None key layer allocation from crashing SpatialData validation.
    • Pinned setuptools<81 in documentation builds to prevent missing pkg_resources errors caused by upstream dependencies (xarray_schema).

Documentation & Developer Experience

  • Documentation Build Fixes: Resolved ~170 Sphinx nitpicky warnings by mapping external libraries (seaborn, squidpy) to intersphinx_mapping, cleaning up cross-references, and fixing type aliasing.
  • Tutorial Improvements: Cleared cell parsing failures in Basic_tutorial.ipynb (caused by stray leading whitespaces), removed an unused numpy import, and corrected library aliases from troutpy.pl to tp.pl.