Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bf_double_tgz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LDV
bf_double_tgz
Commits
36980108
Commit
36980108
authored
1 year ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
Add psrfits file to quality
parent
ed27b2df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Add requantize workflow
Pipeline
#49458
passed
1 year ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
steps/format_quality.cwl
+5
-0
5 additions, 0 deletions
steps/format_quality.cwl
steps/join_contents.cwl
+62
-56
62 additions, 56 deletions
steps/join_contents.cwl
workflow/download_and_run_psrfits_requantisation.cwl
+12
-1
12 additions, 1 deletion
workflow/download_and_run_psrfits_requantisation.cwl
with
79 additions
and
57 deletions
steps/format_quality.cwl
+
5
−
0
View file @
36980108
...
...
@@ -7,6 +7,8 @@ requirements:
- class: InlineJavascriptRequirement
inputs:
- id: summary_psrfits_file
type: File?
- id: summary_file
type: File?
- id: plots
...
...
@@ -31,6 +33,9 @@ expression: |
if(inputs.summary_file){
plots.push(inputs.summary_file);
}
if(inputs.summary_psrfits_file){
plots.push(inputs.summary_psrfits_file)
}
var summary = {}
for (var s_idx in inputs.summaries) {
...
...
This diff is collapsed.
Click to expand it.
steps/join_contents.cwl
+
62
−
56
View file @
36980108
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entryname: summary.json
entry: $(inputs.metadata)
- entryname: script.py
entry: |
#!/usr/bin/env python3
import os
import sys
import json
SIZE_FACTORS = ["B", "kB", "MB", "GB", "TB", "PB", "EB"]
def size_to_string(size: int):
for factor_index, label in enumerate(SIZE_FACTORS):
factor = 1024 ** factor_index
next_factor = 1024 * factor
if size < next_factor:
return "{:.2f} {}".format(size / factor, label).strip()
else:
return None
files_in = sys.argv[1:]
file_out_path = sys.argv[1].split('/')[-1]
sasid = file_out_path.split('-')[0].lstrip('L')
with open('summary.json', 'r') as fin:
summaries = json.load(fin)
total_input = 0
total_output = 0
for summary in summaries:
total_input += summary['input_size']
total_output += summary['output_size']
with open(file_out_path, 'w') as fout:
fout.write('#'*97+'\n')
fout.write('There are %s tarballs processed for the SASId %s\n' % (len(summaries), sasid))
fout.write('The total size of all input tarballs: %s \n' % (size_to_string(total_input), ))
fout.write('The total size of all output tarballs: %s \n' % (size_to_string(total_output), ))
fout.write('The size ratio (output/input) is: %.2f \n' % (total_output/total_input, ))
fout.write('#'*97+'\n')
for file in files_in:
with open(file, 'r') as fin:
fout.write(fin.read())
inputs:
- id: metadata
type: Any[]
- id: summary_files
type: File[]
inputBinding:
position: 1
- id: metadata
type: Any[]
- id: summary_files
type: File[]?
inputBinding:
position: 1
outputs:
- id: summary_file
type: File
outputBinding:
glob: "$(inputs.summary_files[0].basename)"
- id: summary_file
type: File
outputBinding:
glob: $(inputs.summary_files[0].basename)
baseCommand:
- python3
- script.py
hints:
- class: DockerRequirement
dockerPull: git.astron.nl:5000/ldv/bf_double_tgz:latest
requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entryname: summary.json
entry: $(inputs.metadata)
- entryname: script.py
entry: |
#!/usr/bin/env python3
import os
import sys
import json
SIZE_FACTORS = ["B", "kB", "MB", "GB", "TB", "PB", "EB"]
def size_to_string(size: int):
for factor_index, label in enumerate(SIZE_FACTORS):
factor = 1024 ** factor_index
next_factor = 1024 * factor
if size < next_factor:
return "{:.2f} {}".format(size / factor, label).strip()
else:
return None
files_in = sys.argv[1:]
file_out_path = sys.argv[1].split('/')[-1]
sasid = file_out_path.split('-')[0].lstrip('L')
with open('summary.json', 'r') as fin:
summaries = json.load(fin)
total_input = 0
total_output = 0
for summary in summaries:
total_input += summary['input_size']
total_output += summary['output_size']
with open(file_out_path, 'w') as fout:
fout.write('#'*97+'\n')
fout.write('There are %s tarballs processed for the SASId %s\n' % (len(summaries), sasid))
fout.write('The total size of all input tarballs: %s \n' % (size_to_string(total_input), ))
fout.write('The total size of all output tarballs: %s \n' % (size_to_string(total_output), ))
fout.write('The size ratio (output/input) is: %.2f \n' % (total_output/total_input, ))
fout.write('#'*97+'\n')
for file in files_in:
with open(file, 'r') as fin:
fout.write(fin.read())
- class: DockerRequirement
dockerPull: git.astron.nl:5000/ldv/bf_double_tgz:latest
This diff is collapsed.
Click to expand it.
workflow/download_and_run_psrfits_requantisation.cwl
+
12
−
1
View file @
36980108
...
...
@@ -23,7 +23,7 @@ outputs:
type: File[]
outputSource: requantise/summary_file
- id: summary_psrfits_file
type: File[]
type: File[]
?
outputSource: requantise/summary_psrfits_file
- id: ingest
type: Any
...
...
@@ -63,8 +63,19 @@ steps:
run: ../steps/join_contents.cwl
out:
- id: summary_file
- id: join_contents_psrfits
in:
- id: summary_files
source: requantise/summary_psrfits_file
- id: metadata
source: requantise/summary
run: ../steps/join_contents.cwl
out:
- id: summary_file
- id: format_quality
in:
- id: summary_psrfits_file
source: join_contents_psrfits/summary_file
- id: summary_file
source: join_contents/summary_file
- id: plots
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment