From fc2644033b34d3ee5130562c41fdb1b5a991946e Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Wed, 9 Jun 2021 13:49:03 +0200 Subject: [PATCH 1/6] allow multiple inputs in jupyter IT + fix a bug with saving notebooks on exit that had non-default name + remove the confusion with naming notebooks after inputs --- .../interactivetool_jupyter_notebook.xml | 69 +++++++++++-------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/tools/interactive/interactivetool_jupyter_notebook.xml b/tools/interactive/interactivetool_jupyter_notebook.xml index 8c4af7ccbc6..7c19b386717 100644 --- a/tools/interactive/interactivetool_jupyter_notebook.xml +++ b/tools/interactive/interactivetool_jupyter_notebook.xml @@ -16,38 +16,47 @@ @@ -64,7 +73,7 @@ help="This option is useful in workflows when you just want to execute a notebook and not dive into the webfrontend."/> - + From 26a7bcf89c27f718b06879f3db5f7ee6901ab6ad Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Wed, 9 Jun 2021 13:50:35 +0200 Subject: [PATCH 2/6] bump version --- tools/interactive/interactivetool_jupyter_notebook.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/interactive/interactivetool_jupyter_notebook.xml b/tools/interactive/interactivetool_jupyter_notebook.xml index 7c19b386717..5f03e496a52 100644 --- a/tools/interactive/interactivetool_jupyter_notebook.xml +++ b/tools/interactive/interactivetool_jupyter_notebook.xml @@ -1,4 +1,4 @@ - + quay.io/bgruening/docker-jupyter-notebook:ie2 From 0b1bad89582d4d8fae8cfb722b7ecf32f8c20c9e Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Wed, 9 Jun 2021 13:57:32 +0200 Subject: [PATCH 3/6] respect the cheetah style --- .../interactivetool_jupyter_notebook.xml | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/tools/interactive/interactivetool_jupyter_notebook.xml b/tools/interactive/interactivetool_jupyter_notebook.xml index 5f03e496a52..c7453f06f0d 100644 --- a/tools/interactive/interactivetool_jupyter_notebook.xml +++ b/tools/interactive/interactivetool_jupyter_notebook.xml @@ -16,47 +16,47 @@ From 54dd806c26a562fc0d2c4ae5873a23be22fd8c28 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Wed, 9 Jun 2021 14:24:01 +0200 Subject: [PATCH 4/6] Apply suggestions from code review include file ext with a name, allow spaces in input datasets and notebook names Co-authored-by: Marius van den Beek --- tools/interactive/interactivetool_jupyter_notebook.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/interactive/interactivetool_jupyter_notebook.xml b/tools/interactive/interactivetool_jupyter_notebook.xml index c7453f06f0d..6a9873b54b0 100644 --- a/tools/interactive/interactivetool_jupyter_notebook.xml +++ b/tools/interactive/interactivetool_jupyter_notebook.xml @@ -25,13 +25,13 @@ #set $cleaned_names = [] #for $file in $input - #set $cleaned_name = re.sub('[^\w\-\.]', '_', str($file.element_identifier)) + #set $cleaned_name = re.sub('[^\w\-\.\s]', '_', str($file.element_identifier)) ## prevent overwriting data with a randomized suffix #if $cleaned_name in $cleaned_names: #set $cleaned_name = $cleaned_name + '_' + ''.join(random.choice(string.ascii_lowercase) for _ in range(3)) #end if #set $cleaned_names += [$cleaned_name] - ln -sf '$file' './jupyter/data/${cleaned_name}' && + ln -sf '$file' './jupyter/data/${cleaned_name}.${file.ext}' && #end for ## change into the directory where the notebooks are located @@ -46,7 +46,7 @@ jupyter lab --allow-root --no-browser --NotebookApp.shutdown_button=True && cp ./ipython_galaxy_notebook.ipynb '$jupyter_notebook' #else: - #set $noteboook_name = re.sub('[^\w\-\.]', '_', str($mode.ipynb.element_identifier)) + #set $noteboook_name = re.sub('[^\w\-\.\s]', '_', str($mode.ipynb.element_identifier)) cp '$mode.ipynb' ./${noteboook_name}.ipynb && jupyter trust ./${noteboook_name}.ipynb && #if $mode.run_it: From cd2c1a5d853d052f2e394ce1099dafa2872279b6 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Thu, 10 Jun 2021 14:30:34 +0200 Subject: [PATCH 5/6] prefix all datasets with their index --- .../interactivetool_jupyter_notebook.xml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tools/interactive/interactivetool_jupyter_notebook.xml b/tools/interactive/interactivetool_jupyter_notebook.xml index c7453f06f0d..0ca5732b858 100644 --- a/tools/interactive/interactivetool_jupyter_notebook.xml +++ b/tools/interactive/interactivetool_jupyter_notebook.xml @@ -17,21 +17,13 @@ Date: Thu, 10 Jun 2021 15:21:09 +0200 Subject: [PATCH 6/6] properly quote var expansion, since it can contain spaces now --- tools/interactive/interactivetool_jupyter_notebook.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/interactive/interactivetool_jupyter_notebook.xml b/tools/interactive/interactivetool_jupyter_notebook.xml index 0ca5732b858..3ad598ceed0 100644 --- a/tools/interactive/interactivetool_jupyter_notebook.xml +++ b/tools/interactive/interactivetool_jupyter_notebook.xml @@ -39,15 +39,15 @@ cp ./ipython_galaxy_notebook.ipynb '$jupyter_notebook' #else: #set $noteboook_name = re.sub('[^\w\-\.\s]', '_', str($mode.ipynb.element_identifier)) - cp '$mode.ipynb' ./${noteboook_name}.ipynb && - jupyter trust ./${noteboook_name}.ipynb && + cp '$mode.ipynb' './${noteboook_name}.ipynb' && + jupyter trust './${noteboook_name}.ipynb' && #if $mode.run_it: jupyter nbconvert --to notebook --execute --output ./ipython_galaxy_notebook.ipynb --allow-errors ./*.ipynb && #set $noteboook_name = 'ipython_galaxy_notebook' #else: jupyter lab --allow-root --no-browser --NotebookApp.shutdown_button=True && #end if - cp ./${noteboook_name}.ipynb '$jupyter_notebook' + cp './${noteboook_name}.ipynb' '$jupyter_notebook' #end if ]]>