diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 79e857311c1b020443f7e1b1220093ab4bf1d8fe..bfe1767331592af2719e4acbeaad25cd6accc75e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,6 +59,12 @@ losoto_norm: script: - cwl-runner --no-container steps/LoSoTo.Norm.cwl test_jobs/losoto_norm.json +losoto_replicateonaxis: + stage: test_steps + allow_failure: true + script: + - cwl-runner --no-container steps/LoSoTo.Replicateonaxis.cwl test_jobs/losoto_axisreplicate.json + parset_selector: stage: test_steps diff --git a/steps/LoSoTo.Replicateonaxis.cwl b/steps/LoSoTo.Replicateonaxis.cwl new file mode 100644 index 0000000000000000000000000000000000000000..5a5bc2ae466530299dedb183962e484a7f5a4814 --- /dev/null +++ b/steps/LoSoTo.Replicateonaxis.cwl @@ -0,0 +1,69 @@ +#!/usr/bin/env cwl-runner + +class: CommandLineTool +cwlVersion: v1.0 +id: losoto_replicate_on_axis + +doc: | + Replace the values along a certain axis taking them from one specific axis + cell + +requirements: + InlineJavascriptRequirement: {} + InitialWorkDirRequirement: + listing: + - entryname: "replicate_axis.py" + entry: | + import sys + from losoto.h5parm import openSoltab + from losoto.operations import replicateonaxis + + soltab_address = "$(inputs.soltab)" + soltab = openSoltab(sys.argv[1], address=soltab_address) + + axisReplicate = "$(inputs.axisReplicate)" + fromCell = "$(inputs.fromCell !== null ? inputs.fromCell : 0)" + updateWeights = "$(inputs.updateWeights? inputs.updateWeights : 'True')" + + replicateonaxis.run(soltab, axisReplicate=axisReplicate, + fromCell=fromCell, + updateWeights=updateWeights) + + - entryname: $(inputs.input_h5parm.basename) + entry: $(inputs.input_h5parm) + writable: true + +baseCommand: "python3" + +arguments: + - replicate_axis.py + - $(inputs.input_h5parm.basename) + + +hints: + DockerRequirement: + dockerPull: lofareosc/prefactor-ci:master + +inputs: + - id: input_h5parm + type: File + - id: soltab + type: string + doc: "Solution table" + - id: axisReplicate + type: string + doc: Axis along which replicate the values. + - id: fromCell + type: string? + doc: A cell value in axisReplicate from which to copy the data values. + - id: updateWeights + type: boolean? + doc: | + If False then weights are untouched, if True they are replicated + like data. Default: True. + +outputs: + - id: output_h5parm + type: File + outputBinding: + glob: $(inputs.input_h5parm.basename) diff --git a/test_jobs/losoto_replicateonaxis.json b/test_jobs/losoto_replicateonaxis.json new file mode 100644 index 0000000000000000000000000000000000000000..c450feeb21cb430c6a5184f3e18d80d36653130c --- /dev/null +++ b/test_jobs/losoto_replicateonaxis.json @@ -0,0 +1,9 @@ +{ + "input_h5parm": { + "class": "File", + "path": "/data/example.h5" + }, + "soltab": "sol000/amplitude000", + "axisReplicate": "time", + "updateWeight": true +}