Skip to content

refactor: update to new pdex#222

Merged
noamteyssier merged 6 commits intocell-eval-0.7.0from
220-update-to-new-pdex
Feb 26, 2026
Merged

refactor: update to new pdex#222
noamteyssier merged 6 commits intocell-eval-0.7.0from
220-update-to-new-pdex

Conversation

@noamteyssier
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @noamteyssier, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the project's dependency on the pdex library to version 0.2.0, which necessitated a refactoring of existing code to accommodate breaking API changes. The update also raises the minimum required Python version to 3.11. These changes ensure compatibility with the latest pdex features and maintain the project's ability to perform differential expression calculations using the updated library.

Highlights

  • Dependency Update: Updated the pdex library dependency from version 0.1.26 to 0.2.0 in pyproject.toml.
  • Python Version Bump: Increased the minimum required Python version from >=3.10 to >=3.11.
  • pdex API Refactor: Replaced calls to parallel_differential_expression with the new pdex function, adapting parameter names such as groupby_key to groupby and num_workers to threads.
  • Parameter Removal: Removed deprecated parameters like metric, batch_size, and de_method from pdex related function calls, aligning with the updated pdex API.
  • New pdex Mode: Added mode="ref" to pdex function calls in _baseline.py and _evaluator.py.
  • Test Case Adjustment: Modified test cases to reflect the new pdex_kwargs parameters, specifically changing exp_post_agg to geometric_mean and num_workers to threads.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • pyproject.toml
    • Updated pdex dependency to 0.2.0.
    • Increased Python version requirement to >=3.11.
    • Formatted dev dependencies for readability.
  • src/cell_eval/_baseline.py
    • Updated pdex import from parallel_differential_expression to pdex.
    • Modified pdex function call parameters to match the new API, including renaming groupby_key to groupby, num_workers to threads, and adding mode="ref".
  • src/cell_eval/_evaluator.py
    • Updated pdex import from parallel_differential_expression to pdex.
    • Removed de_method and batch_size parameters from _build_de_comparison and _load_or_build_de.
    • Refactored _build_pdex_kwargs to align with the new pdex API, changing parameter names and removing as_polars.
  • tests/test_eval.py
    • Updated pdex_kwargs in test cases, replacing exp_post_agg with geometric_mean and num_workers with threads to match the new pdex API.
Activity
  • No specific pull request activity (comments, reviews, progress updates) was provided in the context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the pdex dependency to version 0.2.0 and refactors the code to align with the new API. The changes correctly replace parallel_differential_expression with pdex and update the corresponding arguments. While the core logic is updated, the refactoring appears incomplete. Several functions, including build_base_mean_adata in _baseline.py and _build_de_comparison and MetricsEvaluator.__init__ in _evaluator.py, retain now-unused parameters like de_method and batch_size in their signatures. These should be removed to clean up the code and prevent confusion. I've also added a comment about a potential high-severity issue regarding the removal of an explicit parameter that ensured the differential expression result is a polars DataFrame, which could lead to runtime errors if the new library version's default behavior has changed.

I am having trouble creating individual review comments. Click here to see my feedback.

src/cell_eval/_evaluator.py (285-286)

high

The removal of as_polars = True could cause runtime errors if the new pdex version doesn't return a polars DataFrame by default, as downstream code expects this type (e.g., for frame.write_csv(...)). The removal of the related comment # always return polars DataFrames makes this change particularly risky if the new default behavior wasn't verified.

@noamteyssier noamteyssier merged commit 287ed12 into cell-eval-0.7.0 Feb 26, 2026
10 checks passed
@noamteyssier noamteyssier deleted the 220-update-to-new-pdex branch February 26, 2026 19:17
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.

1 participant