11 fix rpy2 depraction of conversion rules#12
Conversation
Signed-off-by: kgoebler <Konstantin.Goebler@de.bosch.com>
Signed-off-by: kgoebler <Konstantin.Goebler@de.bosch.com>
55d23ed to
20bb5c2
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes rpy2 deprecation warnings by replacing the deprecated activate() conversion methods with the newer localconverter approach. The changes modernize the R interface code to use current rpy2 best practices while maintaining backward compatibility.
- Replaces deprecated
numpy2ri.activate()andpandas2ri.activate()with a local converter pattern - Adds automatic installation of the "drf" R package if not present
- Updates documentation and version number
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| causalAssembly/drf_fitting.py | Modernizes rpy2 conversion methods and adds automatic R package installation |
| VERSION | Bumps version from 1.2.0 to 1.2.1 |
| README.md | Updates citation and removes manual R package installation requirement |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
causalAssembly/drf_fitting.py
Outdated
|
|
||
| if not rpackages.isinstalled("drf"): | ||
| # select a mirror for R packages | ||
| utils.chooseCRANmirror(ind=1) |
There was a problem hiding this comment.
Hard-coding the CRAN mirror index to 1 is fragile and may fail if that mirror becomes unavailable. Consider using a more robust approach like utils.chooseCRANmirror(graphics=False) which automatically selects an available mirror, or handle potential failures with error handling.
| utils.chooseCRANmirror(ind=1) | |
| utils.chooseCRANmirror(graphics=False) |
|
|
||
| Returns: | ||
| np.ndarray: New predicted samlpe of Y. | ||
| np.ndarray: New predicted sample of Y. |
There was a problem hiding this comment.
There's a spelling error in the comment. 'samlpe' should be 'sample'. This was correctly fixed in the code.
Signed-off-by: kgoebler <Konstantin.Goebler@de.bosch.com>
closes #11