Skip to content

Conversation

@Starlitnightly
Copy link
Collaborator

This pull request introduces several improvements and updates across the codebase to enhance compatibility, maintainability, and monitoring capabilities. The most significant changes include replacing deprecated pandas methods, expanding Python version support in CI, adding function monitoring decorators, and updating documentation build logic.

Key changes:

Pandas compatibility and code modernization

  • Replaced deprecated DataFrame.append() calls with pd.concat() throughout dynamo/external/celldancer/simulation.py to ensure compatibility with newer pandas versions. [1] [2] [3] [4] [5] [6] [7]
  • Updated usage of np.float to float in type conversions in dynamo/external/deepvelo/utils/temporal.py to avoid deprecation warnings. [1] [2]
  • Removed unused import from distutils in dynamo/external/deepvelo/trainer/trainer.py.

Monitoring and tracking enhancements

  • Added @monitor decorator to key analysis and prediction functions (e.g., enrichr, fate, andecestor, least_action, KO, perturbation, ranking functions, state_graph, tree_model, and preprocessing methods) to enable improved tracking and logging of function calls. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]
  • Added a show_monitor parameter to the style function in dynamo/pl.py, and integrated monitor display preference handling. [1] [2]

CI and documentation improvements

  • Expanded the Python version matrix in GitHub Actions to include Python 3.12 and 3.13, improving future compatibility. (.github/workflows/python-package.yml)
  • Updated Sphinx documentation configuration to use importlib.metadata instead of pkg_resources for package discovery, aligning with modern Python standards. (docs/conf.py)

API and feature expansion

  • Added support for additional methods (deepvelo, velovi) in the method argument of extvelo in dynamo/tools/_extvelo.py.

These changes collectively modernize the codebase, improve observability, and ensure the package remains compatible with the latest Python and pandas releases.

- Introduced a new CellTypeClassifier class for cell type classification tasks.
- Implemented training, evaluation, and testing methods with support for various data augmentation techniques.
- Integrated advanced loss functions and optimizers, including PolyLoss and SAM.
- Added functionality for test-time augmentation and probability predictions.
- Included normalization methods and model checkpoint loading for enhanced usability.
- Introduced a new import for the monitor tool to track preprocessing steps.
- Applied the @monitor decorator to the preprocess_adata method for enhanced progress tracking during data preprocessing.
- Introduced the @monitor decorator in various files to enhance tracking of function execution.
- Updated functions in gseapy, fate, least_action_path, perturbation, state_graph, deprecated, pca, cell_velocities, connectivity, dimension_reduction, dynamics, moments, utils, networks, rank_vf, and topography modules.
- This addition aims to improve observability and debugging capabilities throughout the codebase.
- Introduced a global flag to control monitor output display and a function to set this preference.
- Updated the style function to include a new parameter for showing monitor output.
- Removed the @monitor decorator from specific functions to streamline monitoring integration.
- Enhanced the StructureWatcher class to conditionally display monitoring information based on the new settings.
- Replaced pkg_resources with importlib.metadata for package version retrieval in conf.py.
- Updated DataFrame concatenation from append to pd.concat in simulation.py and temporal.py for improved performance and compatibility.
- Removed unused import from trainer.py to clean up the codebase.
- Added Python versions 3.12 and 3.13 to the matrix in the Python package workflow for broader compatibility and testing coverage.
- Removed Python versions 3.12 and 3.13 from the matrix in both the python-package and python-plain-run-test workflows to streamline testing and compatibility.
… modules

- Updated NaN constants from np.NAN to np.nan for consistency in diffusion.py.
- Enhanced dtype checking in select_cell function to support both int and np.integer types in utils.py.
- Changed np.Inf to np.inf in Tang.py for uniformity in floating-point representation.
…ctorField in tests

- Improved the _log_to_uns method in StructureWatcher to handle various data types for history logs, ensuring consistent logging in adata.uns.
- Updated test data loading in conftest.py to regenerate VectorField if missing from adata.uns for both UMAP and PCA, enhancing test reliability.
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 32.95292% with 470 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.20%. Comparing base (68c50fd) to head (afc45b5).
⚠️ Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
dynamo/external/dynode/utils/classification.py 0.00% 426 Missing ⚠️
dynamo/tools/_track.py 92.52% 13 Missing ⚠️
dynamo/external/celldancer/simulation.py 0.00% 10 Missing ⚠️
dynamo/prediction/least_action_path.py 20.00% 8 Missing ⚠️
tests/conftest.py 33.33% 4 Missing ⚠️
dynamo/external/celldancer/diffusion.py 0.00% 2 Missing ⚠️
dynamo/external/deepvelo/utils/temporal.py 0.00% 2 Missing ⚠️
dynamo/pl.py 0.00% 2 Missing ⚠️
dynamo/vectorfield/Tang.py 0.00% 2 Missing ⚠️
dynamo/tools/utils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #734      +/-   ##
==========================================
+ Coverage   28.11%   28.20%   +0.09%     
==========================================
  Files         295      297       +2     
  Lines       46721    47399     +678     
==========================================
+ Hits        13137    13371     +234     
- Misses      33584    34028     +444     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Improved handling of cell indices in the get_cell_indices_by_name function to accommodate cases where cell names may match multiple entries or be represented as slices or arrays.
- Updated test cases to utilize variables for initial and target cell names, enhancing code readability and maintainability.
… method

- Changed indexing from clusters[knn.flatten()] to clusters.iloc[knn.flatten()] for correct row selection in fate_bias function.
- Updated DataFrame concatenation from pd.merge to pd.concat for improved performance and clarity.
@Starlitnightly Starlitnightly merged commit ced6380 into aristoteleo:master Nov 20, 2025
10 checks passed
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