
Install the Python backend for spharmlithic
Source: R/install_python.R
install_spharmlithic_python.RdCreates (or recreates) a conda environment containing the Python
packages required for spherical harmonic analysis. By default installs
the core environment, sufficient for the direction-vector pipeline
(spharm_from_directions()). Pass mesh = TRUE to additionally
install trimesh and open3d for the STL pipeline
(spharm_from_meshes()).
Arguments
- envname
Character. Conda environment name. Default
"r-spharmlithic".- method
Character. One of
"auto","conda","virtualenv". Default"auto", which prefers conda when available (recommended, becausepyshtoolsis easier to install via conda-forge).- mesh
Logical. If
TRUE, install the mesh-processing extension (trimesh,open3d) needed forspharm_from_meshes(). DefaultFALSE(core only).- python_version
Character. Python version constraint. Default
">=3.11,<3.13". The lower bound is the oldest version the currentpyshtools,open3d,numpyandscipyreleases still publish wheels for; the upper bound is required becausepyshtoolshas no Python 3.13 wheels. Both bounds now reach the installer: conda and virtualenv each take the newest version inside the range (3.12 at the time of writing).- new_env
Logical. If
TRUE(default whenenvnameis the package default), remove any existing environment with the same name first.- restart_session
Logical. Restart R session after install (only affects RStudio).
Details
On macOS the conda environment uses the pthreads build of OpenBLAS, so
that it does not load a second copy of the OpenMP runtime next to the one
that comes with R (two copies abort the R session with
OMP: Error #15). Results are identical to the default build. If you
created the environment with an earlier version of spharmlithic, run
install_spharmlithic_python() again to recreate it. The mesh extension
cannot be used in a native macOS installation; see
spharm_from_meshes().