rmagic has a behavior that depends on the presence or absence of packages.
The beginning of rmagic.py has:
try: from rpy2.robjects import pandas2ri as py2ri except ImportError: try: from rpy2.robjects import numpy2ri as py2ri except ImportError: # Give up on numerics py2ri = None
While this is providing convenience this is also introducing both a challenge for current unit tests (tests should test with and without the packages) and a possible apparent unpredictability of behavior (apparent: the behavior depends on the presence or absence or other packages without the other being explicitly informed).
An initial fix would be to decide on a hierarchy of dependencies (e.g., "have pandas" > "have numpy" > "other case") and issue warnings when going down the hierarchy at import time.
A second fix would be able to go down the hierarchy even in the presence of the dependencies.
The first fix seems like something minimal (in terms of code change) and make it to release 2.6.0.
How does it look like ? (@davclark)