reticulate 1.36.0
-
Internal refactoring and optimization now give a faster experience,
especially for workflows that frequently access Python objects from R.
For example, simple attribute access likesys$path
is ~2.5x times faster, and
a sample workload ofpy_to_r(np_array(1:3) + np_array(1:3))
benchmarks
~3.5x faster when compared to the previous CRAN release. -
Fixed issue where callable python objects created with
convert = FALSE
would not be
wrapped in an R function (#1522). -
Fixed issue where
py_to_r()
S3 methods would not be called on arguments supplied to
R functions being called from Python (#1522). -
install_python()
will now build optimized versions of Python on macOS and Linux (#1567) -
Default Python version installed by
install_python()
is now 3.10 (was 3.9) (#1574). -
Output of
reticulate::py_last_error()
now includes a hint, showing how to access
the full R call stack (#1572). -
Fixed an issue where nested
py_capture_output()
calls result in a lost reference
to the originalsys.stdout
andsys.stderr
, resulting in no further visible output
from Python, and eventually, a segfault. (#1564) -
Fixed issues reported by rchk, as requested by CRAN (#1581).
-
py_to_r(x)
now returnsx
unmodified ifx
is not a Python object,
instead of signaling an error. -
New
as.data.frame()
method exported for Python Polars DataFrames (#1568) -
Fixed an issue where printing a delayed module (
import("foo", delay_load = TRUE)
)
would output<pointer: 0x0>
. -
py_validate_xptr()
will now attempt to resolve delayed modules before
signaling an error (#1561). -
R packages can now express multiple preferred Python environments to
search for and use if they exist, by supplying a character vector toimport()
:
import("foo", delay_load = list(environment = c("r-foo", "r-bar")))
(#1559) -
Reticulate will no longer warn about ignored
use_python(,required = FALSE)
calls (#1562). -
reticulate
now prefers using the agg matplotlib backend when the R session
is non-interactive. The backend can also be overridden via theMPLBACKEND
or
RETICULATE_MPLBACKEND
environment variables when necessary (#1556). -
attr(x, "tzone")
attributes are (better) preserved when converting POSIXt to Python.
POSIXt types with a non-emptytzone
attr convert to adatetime.datetime
,
otherwise they convert to NumPydatetime64[ns]
arrays. -
Fixed an issue where calling
py_set_item()
on a subclassed dict would
not invoke a custom__setitem__
method. -
py_del_attr(x, name)
now returnsx
invisibly -
source_python()
no longer exports ther
symbol to the R global environment.
(the "R Interface Object" that is used by Python code get a reference to the
Rglobalenv()
) -
Fixed hang encountered (sometimes) when attempting to call
iterate()
on an exhaustedpy_iterator()
object multiple times (#1539). -
iterate(simplify=TRUE)
rewritten in C for speed improvements (#1539). -
Update for Pandas 2.2 deprecation of
Index.format()
(#1537, #1538). -
Updates for CRAN R-devel (R 4.4) (#1554).
-
Fixed an issue where
py_discover_config()
would discoverpython
(v2) on the PATH
in preference ofpython3
on the PATH. (#1547) -
Fixed an issue where reticulate would error when using conda environments created
with the (new)conda env create
command. (#1535, #1543) -
Fixed an issue where reticulate would error when using a conda environment
where the original conda binary that was used to create the environment
is no longer available (#1555) -
Fixed an issue where a user would be unable to accept the prompt to create
the default "r-reticulate" venv (#1557). -
is_py_object()
is now exported (#1573).