Skip to content

Commit

Permalink
added some handy scripts to convert some test data to ipynb/rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBRoswell committed Dec 15, 2024
1 parent ef0b9f3 commit 171f0bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vreapis/tests/extract-notebook.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ param(
New-Item -i Directory -f $output_dir
foreach ($input_file in $input_files) {
$root = ConvertFrom-Json (Get-Content -raw $input_file) -d 100
ConvertTo-Json $root.data.notebook -d 100 > $output_dir/$($input_file.BaseName).ipynb
$serialized_nb = ConvertTo-Json $root.data.notebook -d 100
$serialized_nb > $output_dir/$($input_file.BaseName).ipynb
switch ($root.data.kernel) {
'ipython' {}
'IRkernel' {

$serialized_nb | jupytext --from ipynb --to Rmd > $output_dir/$($input_file.BaseName).Rmd
}
}
}

0 comments on commit 171f0bb

Please sign in to comment.