Merge pull request #12113 from martenson/jupyter-multiple

allow jupyter IT to take multiple inputs
This commit is contained in:
Marius van den Beek
2021-06-18 18:09:51 +02:00
committed by GitHub
@@ -1,4 +1,4 @@
<tool id="interactive_tool_jupyter_notebook" tool_type="interactive" name="Interactive Jupyter Notebook" version="0.1">
<tool id="interactive_tool_jupyter_notebook" tool_type="interactive" name="Interactive Jupyter Notebook" version="0.2">
<requirements>
<container type="docker">quay.io/bgruening/docker-jupyter-notebook:ie2</container>
</requirements>
@@ -21,8 +21,10 @@
mkdir -p ./jupyter/outputs/ &&
mkdir -p ./jupyter/data &&
#set $cleaned_name = re.sub('[^\w\-\.]', '_', str($input.element_identifier))
ln -sf '$input' './jupyter/data/${cleaned_name}' &&
#for $count, $file in enumerate($input):
#set $cleaned_name = str($count + 1) + '_' + re.sub('[^\w\-\.\s]', '_', str($file.element_identifier))
ln -sf '$file' './jupyter/data/${cleaned_name}.${file.ext}' &&
#end for
## change into the directory where the notebooks are located
cd ./jupyter/ &&
@@ -35,18 +37,17 @@
jupyter trust ./ipython_galaxy_notebook.ipynb &&
jupyter lab --allow-root --no-browser --NotebookApp.shutdown_button=True &&
cp ./ipython_galaxy_notebook.ipynb '$jupyter_notebook'
#else:
#set $cleaned_name = re.sub('[^\w\-\.]', '_', str($input.element_identifier))
cp '$mode.ipynb' ./${cleaned_name}.ipynb &&
jupyter trust ./${cleaned_name}.ipynb &&
#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:
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 ./ipython_galaxy_notebook.ipynb '$jupyter_notebook'
cp './${noteboook_name}.ipynb' '$jupyter_notebook'
#end if
]]>
</command>
@@ -64,7 +65,7 @@
help="This option is useful in workflows when you just want to execute a notebook and not dive into the webfrontend."/>
</when>
</conditional>
<param name="input" type="data" optional="true" label="Include data into the environment"/>
<param name="input" multiple="true" type="data" optional="true" label="Include data into the environment"/>
</inputs>
<outputs>