Branch | |||
---|---|---|---|
master |
|||
develop |
Work with Python installed at a custom location.
ormr
allows a user to install Python packages,
create a Conda environment and run Python scripts
with only one point of contact.
ormr
heavily depends on reticulate
, the latter being
more powerful and flexible. ormr
, however, focuses
on making it trivially simple to install Python
packages and run Python scripts.
As ormr
is developed on the master
branch, only a release
is tested to work:
remotes::install_github("richelbilderbeek/ormr", ref = "v0.6.1")
See FAQ why one needs to install a release.
ormr
uses one point of contact, ormr_folder_name
.
For convenience, there is also a default ormr_folder_name
.
- Install a Python package
- Run a Python script
- Run a Python script with command-line arguments
Also, ormr
uses eager loading, which means that
it will setup everything it needs for you. For example,
if you want to run a Python script from a new ormr_folder_name
,
it will create a Conda environment there for you as well.
Note that create_default_conda_env
conveniently returns the
ormr_folder_name
used to work with this environment.
Using the default ormr
environment:
install_python_package(
package_name = "scipy"
)
Using a custom ormr_folder_name
:
ormr_folder_name <- tempfile()
install_python_package(
ormr_folder_name = ormr_folder_name,
package_name = "scipy"
)
Using the default ormr
environment:
python_script_path <- system.file(
"extdata", "hello_world.py", package = "ormr"
)
run_python_script(
python_script_path = python_script_path
)
Using a custom ormr_folder_name
:
ormr_folder_name <- tempfile()
python_script_path <- system.file(
"extdata", "hello_world.py", package = "ormr"
)
run_python_script(
ormr_folder_name = ormr_folder_name,
python_script_path = python_script_path
)
Using the default ormr
environment:
python_script_path <- system.file(
"extdata", "show_args.py", package = "ormr"
)
run_python_script_with_args(
python_script_path = python_script_path,
args = c("Hello", "world")
)
Using a custom ormr_folder_name
:
ormr_folder_name <- tempfile()
python_script_path <- system.file(
"extdata", "show_args.py", package = "ormr"
)
run_python_script_with_args(
ormr_folder_name = ormr_folder_name,
python_script_path = python_script_path,
args = c("Hello", "world")
)
ormr
allows a user to install Python packages,
create a Conda environment and run Python scripts
with only one point of contact.
ormr
was written to write simpler
Singularity (a type of containerization
software, similar to Docker) scripts.
reticulate
is great when using its default folders on a local computer.
However, for a Singularity container, it is recommended to install
libraries in a systems folder. In that setting, reticulate
is
harder to work with.
ormr
allows to install install Python packages,
create a Conda environment and run Python scripts
in any folder easily, for example,
in a system folder (/opt/ormr
) of a Singularity container.
ormr
heavily depends on reticulate
, the latter being
more powerful and flexible.
ormr
, however, focuses
on making it trivially simple to install Python
packages and run Python scripts,
due to eager loading.
Additionally, ormr
has a more extensive documentation,
and 100% code coverage.
Beyond the domain of ormr
, use reticulate
.
Eager loading is the opposite of lazy loading.
Here, it is defined as 'if you want ormr
to do B, which depends on
the setup of A', ormr
will setup A, then do B. For example, to install
a package to a certain ormr_folder_name
('to do B'), ormr
will create a Conda environment for that ('the setup of A').
This means that no setup code is necessary.
The development of ormr
takes place on the master
branch.
Hence, master
will break regularily.
A specific release is tested to build correctly.
The reason for this non-traditional workflow, is that the
Singularity script always installs the master
branch,
as it cannot detect the git
branch is being built by.
See CONTRIBUTING, at Submitting use cases
See CONTRIBUTING, at Submitting code
See CONTRIBUTING, at Submitting bugs
Sure, just add an Issue. Or send an email.
See CONTRIBUTING.md.
This name is a pun on reticulate
. reticulate
is named after a
type of snake. ormr
is written in Sweden. In Swedish, orm
, is a snake.
Following the common tradtion of adding an r
to the end of an R package
name (e.g dplyr
, tidyr
, etc) resulted in ormr
.
The original snake image was found when searching for a public domain image of a snake, using the following DuckDuckGo image seach:
https://duckduckgo.com/?q=orm+.png&t=ffab&iar=images&iaf=license%3APublic%2Ctype%3Aclipart&iax=images&ia=images&iai=https%3A%2F%2Fcdn.pixabay.com%2Fphoto%2F2016%2F03%2F31%2F15%2F10%2Fcartoon-1293047_1280.png
After that, the image was modified using KolourPaint and the R logo was added.
- https://github.com/richelbilderbeek/reticulate_on_singularity:
demo how to run
reticulate
within a Singularity container, withoutormr