Skip to content

Commit

Permalink
Removing named inputs_outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
PauAndrio committed Jul 16, 2024
1 parent c3bfe94 commit aa48ad5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 29 deletions.
32 changes: 19 additions & 13 deletions tools/biobb_pytorch/biobb_apply_mdae.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,45 @@

<command detect_errors="exit_code"><![CDATA[
`#Required inputs using file extension`
ln -s '$input_data_npy_path' ./input_data_npy_path.$input_data_npy_path.ext &&
ln -s '$input_model_pth_path' ./input_model_pth_path.$input_model_pth_path.ext &&
ln -s '$input_model_pth_path' ./input_model_pth_path.pth &&
`#Optional inputs using file extension`
#if $config_json:
ln -s '$config_json' ./config_json.$config_json.ext &&
#end if
`#Required Outputs using file extension`
touch '$output_reconstructed_data_npy_path' &&
ln -s '$output_reconstructed_data_npy_path' ./output_reconstructed_data_npy_path.$output_reconstructed_data_npy_path.ext &&
`#Optional Outputs using file extension`
#if $output_latent_space_npy_path:
touch '$output_latent_space_npy_path' &&
ln -s '$output_latent_space_npy_path' ./output_latent_space_npy_path.$output_latent_space_npy_path.ext &&
#end if
`#Command`
apply_mdae
#if $config_json:
--config ./config_json.$config_json.ext
#end if
--input_data_npy_path ./input_data_npy_path.$input_data_npy_path.ext
--input_model_pth_path ./input_model_pth_path.$input_model_pth_path.ext
--output_reconstructed_data_npy_path $outname_output_reconstructed_data_npy_path
#if $outname_output_latent_space_npy_path:
--output_latent_space_npy_path $outname_output_latent_space_npy_path
--input_model_pth_path ./input_model_pth_path.pth
#if $output_latent_space_npy_path:
--output_latent_space_npy_path ./output_latent_space_npy_path.$output_latent_space_npy_path.ext
#end if
--output_reconstructed_data_npy_path ./output_reconstructed_data_npy_path.$output_reconstructed_data_npy_path.ext
;
mv '$outname_output_reconstructed_data_npy_path' '$output_reconstructed_data_npy_path' &&
if test -f '$outname_output_latent_space_npy_path'; then mv '$outname_output_latent_space_npy_path' '$output_latent_space_npy_path'; fi;
]]>
</command>

<inputs>
<param name="input_data_npy_path" type="data" format="npy" optional="False" label="Input NPY file" help="Input data file"/>
<param name="input_model_pth_path" type="data" format="pth" optional="False" label="Input PTH file" help="Input model file"/>
<param name="outname_output_reconstructed_data_npy_path" type="text" value="myapply_mdae.npy" optional="False" label="Output NPY name" help="Output reconstructed data file"/>
<param name="outname_output_latent_space_npy_path" type="text" value="myapply_mdae.npy" optional="True" label="Output NPY name" help="Output reduced dimensionality file"/>
<param name="config_json" type="data" format="json" optional="True" label="Configuration file" help="File containing tool settings"/>
</inputs>

Expand All @@ -54,8 +62,6 @@
<param name="config_json" value="config_apply_mdae.json" ftype="json" />
<param name="input_data_npy_path" value="train_mdae_traj.npy" ftype="npy" />
<param name="input_model_pth_path" value="ref_output_model.pth" />
<param name="outname_output_reconstructed_data_npy_path" value="output_reconstructed_data.npy" />
<param name="outname_output_latent_space_npy_path" value="output_latent_space.npy" />
<output name="output_reconstructed_data_npy_path" ftype="npy">
<assert_contents>
<has_size value="123k" delta="50k"/>
Expand Down
39 changes: 23 additions & 16 deletions tools/biobb_pytorch/biobb_train_mdae.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,32 @@

<command detect_errors="exit_code"><![CDATA[
`#Required inputs using file extension`
ln -s '$input_train_npy_path' ./input_train_npy_path.$input_train_npy_path.ext &&
`#Optional inputs using file extension`
#if $input_model_pth_path:
ln -s '$input_model_pth_path' ./input_model_pth_path.$input_model_pth_path.ext &&
#end if
#if $config_json:
ln -s '$config_json' ./config_json.$config_json.ext &&
#end if
`#Required Outputs using file extension`
touch '$output_model_pth_path' &&
ln -s '$output_model_pth_path' ./output_model_pth_path.pth &&
`#Optional Outputs using file extension`
#if $output_train_data_npz_path:
touch '$output_train_data_npz_path' &&
ln -s '$output_train_data_npz_path' ./output_train_data_npz_path.npz &&
#end if
#if $output_performance_npz_path:
touch '$output_performance_npz_path' &&
ln -s '$output_performance_npz_path' ./output_performance_npz_path.npz &&
#end if
`#Command`
train_mdae
#if $config_json:
Expand All @@ -28,28 +46,20 @@
#if $input_model_pth_path:
--input_model_pth_path ./input_model_pth_path.$input_model_pth_path.ext
#end if
--output_model_pth_path $outname_output_model_pth_path
#if $outname_output_train_data_npz_path:
--output_train_data_npz_path $outname_output_train_data_npz_path
--output_model_pth_path $output_model_pth_path
#if $output_train_data_npz_path:
--output_train_data_npz_path ./output_train_data_npz_path.npz
#end if
#if $outname_output_performance_npz_path:
--output_performance_npz_path $outname_output_performance_npz_path
#if $output_performance_npz_path:
--output_performance_npz_path ./output_performance_npz_path.npz
#end if
;
mv '$outname_output_model_pth_path' '$output_model_pth_path' &&
if test -f '$outname_output_train_data_npz_path'; then mv '$outname_output_train_data_npz_path' '$output_train_data_npz_path'; fi;
if test -f '$outname_output_performance_npz_path'; then mv '$outname_output_performance_npz_path' '$output_performance_npz_path'; fi;
]]>
</command>

<inputs>
<param name="input_train_npy_path" type="data" format="npy" optional="False" label="Input NPY file" help="Input train NPY data file"/>
<param name="input_model_pth_path" type="data" format="pth" optional="True" label="Input PTH file" help="Input model PTH file"/>
<param name="outname_output_model_pth_path" type="text" value="output_model_pth_path.pth" optional="False" label="Output PTH name" help="Output model file"/>
<param name="outname_output_train_data_npz_path" type="text" value="output_train_data_npz_path.npz" optional="True" label="Output train data NPZ name" help="Output train data file"/>
<param name="outname_output_performance_npz_path" type="text" value="output_performance_npz_path.npz" optional="True" label="Output performance NPZ name" help="Output performance file"/>
<param name="config_json" type="data" format="json" optional="True" label="Configuration file" help="File containing tool settings"/>
</inputs>

Expand All @@ -63,9 +73,6 @@
<test>
<param name="config_json" value="config_train_mdae.json" ftype="json" />
<param name="input_train_npy_path" value="train_mdae_traj.npy" ftype="npy" />
<param name="outname_output_model_pth_path" value="output_model.pth" />
<param name="outname_output_train_data_npz_path" value="output_train_data.npz" />
<param name="outname_output_performance_npz_path" value="output_performance.npz" />
<output name="output_model_pth_path" file="ref_output_model.pth" compare="sim_size" />
<output name="output_train_data_npz_path">
<assert_contents>
Expand Down

0 comments on commit aa48ad5

Please sign in to comment.