Skip to content

Commit

Permalink
Merge branch 'CW-790' into 'dev'
Browse files Browse the repository at this point in the history
template updates

See merge request epi2melabs/workflow-containers/wf-artic!113
  • Loading branch information
sarahjeeeze committed Jul 8, 2022
2 parents 218aa1d + 45c321d commit 60d479d
Show file tree
Hide file tree
Showing 9 changed files with 232 additions and 38 deletions.
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating System
description: What operating system are you running?
options:
- Windows 10
- Windows 11
- macOS
- ubuntu 18.04
- ubuntu 20.04
validations:
required: true
- type: dropdown
id: execution
attributes:
label: Workflow Execution
description: Where are you running the workflow?
options:
- EPI2ME Labs desktop application
- Command line
- EPI2ME
- Other (please describe)
validations:
required: true
- type: input
id: labs-version
attributes:
label: Workflow Execution - EPI2ME Labs Versions
description: If you're running using EPI2ME Labs please provide the version and the environment version (Click the blue help icon bottom left and select ":bout")?
validations:
required: false
- type: dropdown
id: profile
attributes:
label: Workflow Execution - Execution Profile
description: If you're using the CLI to run the workflow, what profile are you using?
options:
- Docker
- Singularity
- Conda
validations:
required: false
- type: input
id: version
attributes:
label: Workflow Version
description: What version of the workflow are you running?
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Nanopore customer support
url: https://nanoporetech.com/contact
about: For general support, including bioinformatics questions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include:

variables:
NF_WORKFLOW_OPTS: "--fastq test_data/fastq --samples test_data/sample_sheet.csv"
NF_IGNORE_PROCESSES: "checkSampleSheet,combineGenotypeSummaries,genotypeSummary,report_no_data"
IMAGE_TAG: "NO_UPDATE"

check-versions:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.3.17]
### Changes
- Args parser for fastqingress
- Set out_dir option type to ensure output is written to correct directory on Windows

## [v0.3.16]
### Added
- `--pangolin_options` command line arg, use with quotes i.e.: "--analysis-mode fast"
Expand Down
61 changes: 61 additions & 0 deletions lib/ArgumentParser.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* Check arguments of a Nextflow function
*
* Nextflow script does not support the Groovy idiom:
*
* def function(Map args[:], arg1, arg2, ...)
*
* to support unordered kwargs. The methods here are designed
* to reduce boileplate while allowing Nextflow script to implement
*
* def function(Map args[:])
*
* with required and default values. This is similar to some Python
* libraries' (notably matplotlib) extensive use of things like:
*
* def function(*args, **kwargs)
*
* to implement generic APIs. Why do we want to do all this? Because
* we want to write library code with a clean set of required parameters
* but also extensible with non-required parameters with default values.
* This allows us to later add parameters without breaking existing code,
* and is very common practice elsewhere.
*/

import java.util.Set

class ArgumentParser {
Set args
Map kwargs
String name

/* Parse arguments, raising an error on unknown keys */
public Map parse_args(LinkedHashMap given_args) {
Set opt_keys = kwargs.keySet()
Set given_keys = given_args.keySet()
check_required(given_keys)
check_unknown(given_keys, opt_keys)
return kwargs + given_args
}

/* Parse arguments, without raising an error for extra keys */
public Map parse_known_args(LinkedHashMap given_args) {
Set opt_keys = kwargs.keySet()
Set given_keys = given_args.keySet()
check_required(given_keys)
return kwargs + given_args
}

private void check_required(Set given) {
Set missing_keys = args - given
if (!missing_keys.isEmpty()) {
throw new Exception("Missing arguments for function ${name}: ${missing_keys}")
}
}

private void check_unknown(Set given, Set kwargs_keys) {
Set extra_keys = given - (args + kwargs_keys)
if (!extra_keys.isEmpty()) {
throw new Exception("Unknown arguments provided to function ${name}: ${extra_keys}.")
}
}
}
Loading

0 comments on commit 60d479d

Please sign in to comment.