Skip to content

Conversation

@colganwi
Copy link
Collaborator

@colganwi colganwi commented Jul 8, 2025

No description provided.

@colganwi colganwi requested a review from Copilot July 8, 2025 21:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds initial “Getting started” functionality by introducing a new get submodule for palette handling, enhancing sorting and categorical support in utilities and plotting, and updating core algorithms with improved type annotations and overloads, alongside test and documentation updates.

  • Added pycea.get subpackage with palette functionality
  • Extended utils.get_keyed_obs_data with sorting and introduced _get_categories
  • Updated autocorr and ancestral_states to include overloads, refined signatures, and node‐attribute handling
  • Added minor test assertions, removed example notebook, and updated documentation for the new features

Reviewed Changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_autocorr.py Added non‐None assertions to verify returned results are not null
tests/test_ancestral_states.py Added non‐None assertions, type ignore for obsm, and test runner block
src/pycea/utils.py Introduced _get_categories helper; added sort support to get_keyed_obs_data
src/pycea/tl/autocorr.py Added overloads, refined default parameters, and ensured outputs are arrays
src/pycea/tl/ancestral_states.py Refactored method signatures, removed old attributes, and improved node‐attribute cleanup
src/pycea/pl/plot_tree.py Integrated _get_categories for categorical branch/node coloring
src/pycea/pl/_utils.py Added save flag to _get_categorical_colors and adjusted return logic
src/pycea/get/get_palette.py New module for generating palettes from custom maps or colormaps
src/pycea/get/init.py Exposed palette in the get subpackage
src/pycea/datasets/datasets.py Updated ZENODO_DOI constant
src/pycea/init.py Registered get subpackage in __all__
docs/index.md Included getting-started notebook
docs/api.md Documented pycea.get.palette in autosummary
docs/notebooks/example.ipynb Removed placeholder example notebook
datasets/yang22/make_treedata.ipynb Adjusted execution counts, data transformations, and metadata
Comments suppressed due to low confidence (4)

src/pycea/utils.py:147

  • The alias sp is not imported in this module, leading to a NameError. Add import scipy as sp (or import the specific sparse submodule) at the top.
            if sp.sparse.issparse(tdata.obsm[key]):

src/pycea/get/get_palette.py:22

  • Using a union type (str | mcolors.Colormap) in isinstance is invalid at runtime. Replace with a tuple of types, e.g., isinstance(cmap, (str, mcolors.Colormap)).
    if isinstance(cmap, str | mcolors.Colormap):  # type: ignore

src/pycea/tl/ancestral_states.py:311

  • zip(..., strict=False) uses a keyword only supported in Python 3.10+. Remove the strict argument for broader compatibility or ensure the project requires ≥3.10.
            for key, key_added in zip(keys, keys_added, strict=False):

tests/test_ancestral_states.py:118

  • [nitpick] The __main__ block is unnecessary in pytest files; pytest auto-discovers tests. Consider removing this section to keep tests focused.
if __name__ == "__main__":

@colganwi colganwi merged commit 1e96d5e into main Jul 8, 2025
5 checks passed
@colganwi colganwi deleted the getting-started branch July 8, 2025 21:40
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