Skip to content
Permalink
Browse files
fix: R encoding of pathlib.Path objects (#1201)
* feat: support converting Path objects for R

* test: test for converting Path objects to R

* Update script.py

* test: Snakemake test for R encoding pathlib.Path objects (missing files)

* fix: touch file to make expected-results dir appear in git

Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>
  • Loading branch information
jhrcook and johanneskoester committed Nov 23, 2021
1 parent 12a9f92 commit bd516e958af22e57c18cacf0cb22552c2a237bd8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
@@ -0,0 +1,18 @@

from pathlib import Path


rule all:
input:
out_file="out-file.txt"


rule step1:
input:
text_file=Path("text-file.txt")
params:
param_dir=Path("dir")
output:
out_file=Path("out-file.txt")
script:
"r-script.R"
@@ -0,0 +1,9 @@

infile <- snakemake@input[["text_file"]]

# Check the read value is as expected in R.
param_dir <- snakemake@params[["param_dir"]]
stopifnot(param_dir == "dir")

outfile <- snakemake@output[["out_file"]]
file.create(outfile)
Empty file.
@@ -1340,5 +1340,9 @@ def test_github_issue1158():
)


def test_converting_path_for_r_script():
run(dpath("test_converting_path_for_r_script"), cores=1)


def test_ancient_dag():
run(dpath("test_ancient_dag"))

0 comments on commit bd516e9

Please sign in to comment.