Skip to content

Commit

Permalink
Using from_work_dir attribute to avoid touch and ln on outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
PauAndrio committed Jul 22, 2024
1 parent aa48ad5 commit 5fb9146
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 38 deletions.
21 changes: 4 additions & 17 deletions tools/biobb_pytorch/biobb_apply_mdae.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,13 @@

<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.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:
Expand All @@ -39,9 +26,9 @@
--input_data_npy_path ./input_data_npy_path.$input_data_npy_path.ext
--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
--output_latent_space_npy_path ./output_latent_space_npy_path.npy
#end if
--output_reconstructed_data_npy_path ./output_reconstructed_data_npy_path.$output_reconstructed_data_npy_path.ext
--output_reconstructed_data_npy_path ./output_reconstructed_data_npy_path.npy
;
]]>
</command>
Expand All @@ -53,8 +40,8 @@
</inputs>

<outputs>
<data format="npy" name="output_reconstructed_data_npy_path" label="output_reconstructed_data_npy_path" />
<data format="npy" name="output_latent_space_npy_path" label="output_latent_space_npy_path" />
<data format="npy" name="output_reconstructed_data_npy_path" from_work_dir="output_reconstructed_data_npy_path.npy" label="output_reconstructed_data_npy_path" />
<data format="npy" name="output_latent_space_npy_path" from_work_dir="output_latent_space_npy_path.npy" label="output_latent_space_npy_path" />
</outputs>

<tests>
Expand Down
25 changes: 4 additions & 21 deletions tools/biobb_pytorch/biobb_train_mdae.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,15 @@

<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 @@ -46,7 +29,7 @@
#if $input_model_pth_path:
--input_model_pth_path ./input_model_pth_path.$input_model_pth_path.ext
#end if
--output_model_pth_path $output_model_pth_path
--output_model_pth_path ./output_model_pth_path.pth
#if $output_train_data_npz_path:
--output_train_data_npz_path ./output_train_data_npz_path.npz
#end if
Expand All @@ -64,9 +47,9 @@
</inputs>

<outputs>
<data format="pth" name="output_model_pth_path" label="output_model_pth_path" />
<data format="npz" name="output_train_data_npz_path" label="output_train_data_npz_path" />
<data format="npz" name="output_performance_npz_path" label="output_performance_npz_path" />
<data format="pth" name="output_model_pth_path" from_work_dir="output_model_pth_path.pth" label="output_model_pth_path" />
<data format="npz" name="output_train_data_npz_path" from_work_dir="output_train_data_npz_path.npz" label="output_train_data_npz_path" />
<data format="npz" name="output_performance_npz_path" from_work_dir="output_performance_npz_path.npz" label="output_performance_npz_path" />
</outputs>

<tests>
Expand Down

0 comments on commit 5fb9146

Please sign in to comment.