Skip to content

Remove rpy2 Dependency#298

Merged
johnwalz97 merged 10 commits intomainfrom
john6797/sc-8198/remove-rpy2-dependency
Jan 21, 2025
Merged

Remove rpy2 Dependency#298
johnwalz97 merged 10 commits intomainfrom
john6797/sc-8198/remove-rpy2-dependency

Conversation

@johnwalz97
Copy link
Contributor

@johnwalz97 johnwalz97 commented Jan 21, 2025

Internal Notes for Reviewers

Remove rpy2 as a dependency

External Release Notes

@johnwalz97 johnwalz97 added internal Not to be externalized in the release notes chore Chore tasks that aren't bugs or new features labels Jan 21, 2025
@johnwalz97 johnwalz97 requested a review from cachafla January 21, 2025 18:20
@johnwalz97 johnwalz97 changed the title John6797/sc 8198/remove rpy2 dependency Remove rpy2 Dependency Jan 21, 2025
@github-actions
Copy link
Contributor

PR Summary

This pull request refactors the installation instructions for R support in the README.md and README.pypi.md files. The previous method of installing R support using the validmind[r-support] extra has been replaced with a direct installation of the rpy2 package. This change simplifies the installation process for users who require R support.

Additionally, the PR includes several code improvements and refactorings:

  • The MissingRExtrasError class in validmind/errors.py has been updated to provide a more accurate error message when rpy2 is not installed.
  • The validmind/models/r_model.py file now includes a try-except block to handle the ImportError for rpy2, raising a MissingRExtrasError if the package is not installed.
  • The validmind/__init__.py file has been reorganized to improve the structure and readability of the exported symbols.
  • Several test functions in the validmind/tests directory have been refactored to improve code clarity and maintainability, including FeatureTargetCorrelationPlot, ContextualRecall, MeteorScore, ToxicityScore, MinimumROCAUCScore, and RegressionModelSummary.

The poetry.lock and pyproject.toml files have been updated to reflect the removal of the rpy2 dependency from the optional extras.

Test Suggestions

  • Verify that the installation instructions in the README files work correctly for R support.
  • Test the error handling in validmind/models/r_model.py by attempting to use R models without rpy2 installed.
  • Ensure that all refactored test functions in the validmind/tests directory produce the expected results.
  • Check that the reorganization of exports in validmind/__init__.py does not affect the functionality of the library.
  • Run the full test suite to ensure no regressions have been introduced.

Copy link
Contributor

@cachafla cachafla left a comment

Choose a reason for hiding this comment

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

Awesome. Are these unrelated fixes required on the soon to be prod release?

@johnwalz97
Copy link
Contributor Author

Awesome. Are these unrelated fixes required on the soon to be prod release?

Nope @cachafla these are just formatting/clean up of some of the raw data changes but not required.

@johnwalz97 johnwalz97 merged commit 6d6dab2 into main Jan 21, 2025
6 checks passed
@johnwalz97 johnwalz97 deleted the john6797/sc-8198/remove-rpy2-dependency branch January 23, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore tasks that aren't bugs or new features internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants