Skip to content

Commit

Permalink
enh: support passing pathlib.Path to lme4.rsetup.set_*_path methods
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Oct 18, 2024
1 parent 6b77745 commit dbd78f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.62.6
- enh: support passing pathlib.Path to lme4.rsetup.set_*_path methods
0.62.5
- enh: make set_r_lib_path available in lme4 submodule
0.62.4
Expand Down
4 changes: 2 additions & 2 deletions dclab/lme4/rsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ def set_r_lib_path(r_lib_path):
"""Add given directory to the R_LIBS_USER environment variable"""
paths = os.environ.get("R_LIBS_USER", "").split(os.pathsep)
paths = [p for p in paths if p]
paths.append(r_lib_path.strip())
paths.append(str(r_lib_path).strip())
os.environ["R_LIBS_USER"] = os.pathsep.join(list(set(paths)))


def set_r_path(r_path):
"""Set the path of the R executable/binary"""
tmp = run_command((r_path, "RHOME"))
tmp = run_command((str(r_path), "RHOME"))

r_home = tmp.split(os.linesep)
if r_home[0].startswith("WARNING"):
Expand Down

0 comments on commit dbd78f6

Please sign in to comment.