Repository: cta-observatory/lstmcpipe

Issue:
Production 20221128_src5_dec3476_tuned did not include integration corrections
See #383 comments and PR.
@alvmas 
Merging failure does not make job fail
>   @vuillaut It seems other base productions have the same issue:
> `20221215_v0.9.12_base_prod` and `20230127_v0.9.12_base_prod_az_tel`

_Originally posted by @SeiyaNozaki in https://github.com/cta-observatory/lstmcpipe/issues/371#issuecomment-1446600468_
            

See  e.g.
`/fefs/aswg/data/mc/DL1/AllSky/20221215_v0.9.12_base_prod/TrainingDataset/dec_931/Protons/merging-output.e`

``` 
Traceback (most recent call last):
  File "/fefs/aswg/software/conda/envs/lstchain-v0.9.12/bin/lstchain_merge_hdf5_files", line 8, in <module>
    sys.exit(main())
  File "/fefs/aswg/software/conda/envs/lstchain-v0.9.12/lib/python3.8/site-packages/lstchain/scripts/lstchain_merge_hdf5_files.py", line 88, in main
    auto_merge_h5files(
  File "/fefs/aswg/software/conda/envs/lstchain-v0.9.12/lib/python3.8/site-packages/lstchain/io/io.py", line 341, in auto_merge_h5files
    out_node.append(in_node.read().astype(out_node.dtype))
ValueError: structures must have the same size
```



Discussion:
codecov[bot]: ## [Codecov](https://codecov.io/gh/cta-observatory/lstmcpipe/pull/399?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory) Report
Patch coverage: **`100.00`**% and no project coverage change.
> Comparison is base [(`c2340d1`)](https://codecov.io/gh/cta-observatory/lstmcpipe/commit/c2340d1a4d046d327ddabd8c287afdee6edc7ec2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory) 30.65% compared to head [(`35faf02`)](https://codecov.io/gh/cta-observatory/lstmcpipe/pull/399?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory) 30.65%.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           master     #399   +/-   ##
=======================================
  Coverage   30.65%   30.65%           
=======================================
  Files          46       46           
  Lines        2776     2776           
=======================================
  Hits          851      851           
  Misses       1925     1925           
```


| [Impacted Files](https://codecov.io/gh/cta-observatory/lstmcpipe/pull/399?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory) | Coverage Δ | |
|---|---|---|
| [lstmcpipe/tests/test\_utils.py](https://codecov.io/gh/cta-observatory/lstmcpipe/pull/399?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory#diff-bHN0bWNwaXBlL3Rlc3RzL3Rlc3RfdXRpbHMucHk=) | `95.94% <100.00%> (ø)` | |
| [lstmcpipe/utils.py](https://codecov.io/gh/cta-observatory/lstmcpipe/pull/399?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory#diff-bHN0bWNwaXBlL3V0aWxzLnB5) | `81.71% <100.00%> (ø)` | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory)

</details>

[:umbrella: View full report in Codecov by Sentry](https://codecov.io/gh/cta-observatory/lstmcpipe/pull/399?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cta-observatory).


Patch:
diff --git a/lstmcpipe/utils.py b/lstmcpipe/utils.py
index 6ab3063..723c7ea 100644
--- a/lstmcpipe/utils.py
+++ b/lstmcpipe/utils.py
@@ -285,7 +285,7 @@ class SbatchLstMCStage:
         if slurm_deps is None or slurm_deps == "":
             return ""
         elif all(items != "" for items in slurm_deps.split(",")):
-            return f"--dependency={dependency_type}:{slurm_deps}"
+            return f"--dependency={dependency_type}:{slurm_deps.replace(',',':')}"
         else:
             raise ValueError("Slurm dependencies contain an empty value between commas, i.e.; ,'', ")
 


Test patch:
diff --git a/lstmcpipe/tests/test_utils.py b/lstmcpipe/tests/test_utils.py
index 7957757..505671e 100644
--- a/lstmcpipe/tests/test_utils.py
+++ b/lstmcpipe/tests/test_utils.py
@@ -86,7 +86,7 @@ def test_sbatch_lst_mc_stage():
 
     sbatch.extra_slurm_options = None
     sbatch.slurm_dependencies = "123,243,345,456"
-    assert sbatch._construct_slurm_dependencies() == "--dependency=afterok:123,243,345,456"
+    assert sbatch._construct_slurm_dependencies() == "--dependency=afterok:123:243:345:456"
 
     sbatch.compose_wrap_command(
         wrap_command="python args",