Skip to content

Commit fe0e266

Browse files
Robrecht Cannoodthcannoodtdanielskatz
authored
Port Nextflow fix, Bump Viash version, Remove deprecated functionality (#832)
* Fix author names in paper (#644) * add paper * update paper * add more orcids * move figures * rename pipeline to workflow * add section on benefits * rewrite state of the field * solve issue with figure 3 * update bibtex * update bibtex again * broaden domain * update figure 2 based on @wilkinson's feedback * minor changes in paper (#628) * minor change * fix refactoring error * Add JOSS release info * update readme * Fix author names --------- Co-authored-by: Daniel S. Katz <d.katz@ieee.org> * use reflection to get viash to fix issue in nextflow edge (#812) * use reflection to get viash to fix issue in nextflow edge * add entry to changelog * Backport: Make sure scripts in Nextflow have the right extension (#815) * Backport: Make sure scripts in Nextflow have the right extension * fix changelog * Edit -- I'm going to port it in the different direction * Pass session as an argument (#818) * pass session as an argument * fix import * Prepare for release * post release changes, update release guide * Add entry for 0.8.7 * port of #823 * add pr number * copied 0.8.8 changelog entry * update version and changelog * Update CHANGELOG.md * Update CHANGELOG.md * post release changes * cherry pick 5271a3b * fix test * Remove deprecated things (#833) * wip deprecate things * fix components * fix test * update tests and yamls * fix test (recent versions of git require a message) * remove test code for removed functionality * Update CHANGELOG.md --------- Co-authored-by: Hendrik Cannoodt <hendrik.cannoodt@gmail.com> Co-authored-by: Daniel S. Katz <d.katz@ieee.org>
1 parent b611d1b commit fe0e266

66 files changed

Lines changed: 289 additions & 1604 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,40 @@ TODO add summary
88

99
## BREAKING CHANGES
1010

11-
* `Nextflow` runner: remove deprecated `map`, `mapId`, `mapData`, `mapPassthrough` and `renameKeys` (PR #792).
11+
* `Nextflow` runner: remove deprecated `map`, `mapId`, `mapData`, `mapPassthrough` and `renameKeys` arguments (PR #792).
1212

13-
* `Nextflow` runner: remove helper functions: `setWorkflowArguments`, `getWorkflowArguments`, `strictMap`, `passthroughMap`, `passthroughFlatMap` and `passthroughFilter` (PR #792).
13+
* `Nextflow` runner: remove helper functions: `setWorkflowArguments`, `getWorkflowArguments`, `strictMap`, `passthroughMap`, `passthroughFlatMap`, `passthroughFilter`, `channelFromParams`, `runComponents` (PRs #792, #811).
1414

15-
* `Nextflow` runner: `channelFromParams` is now deprecated (PR #792).
15+
* Remove deprecated functionality `functionality` and `platforms` (PR #832).
1616

17-
* `Nextflow` runner: remove deprecated `runComponents` (PR #811).
17+
## BUG FIXES
1818

19-
## MINOR CHANGES
19+
* `NextflowRunner`: Automatically convert integers to doubles when argument type is `double` (port of PR #824, PR #825).
20+
21+
## MINOR FIXES
2022

2123
* `Executable`: Add more info to the --help (PR #802).
2224

25+
# Viash 0.9.4 (2025-04-24): Hotfix for Nextflow edge
2326

24-
# Viash 0.9.3 (yyyy-MM-dd): TODO Add title
27+
This is a hotfix release for the changes in Nextflow edge's handling of double arguments.
28+
29+
## BUG FIXES
30+
31+
* `NextflowRunner`: Automatically convert integers to doubles when argument type is `double` (port of PR #823, PR #824).
32+
33+
# Viash 0.9.3 (2025-03-31): Support upcoming version of Nextflow
34+
35+
The upcoming release of Nextflow introduces a new class for loading scripts and renamed the old class.
36+
This release supports this change by using reflection to detect the available class.
2537

2638
## BUG FIXES
2739

2840
* `NextflowRunner`: ScriptParser was renamed to ScriptLoaderV1 in Nextflow 25.02.0-edge (PR #812). This fix uses reflection
2941
to detect whether ScriptParser exists -- if not the ScriptLoaderFactory is used instead.
3042

43+
* `NextflowRunner`: Make sure scripts are generated with the right extension (PR #815).
44+
3145
# Viash 0.9.2 (2025-03-04): Bug fix release
3246

3347
This release fixes an edge case where output arguments for subworkflows were malformed.
@@ -40,7 +54,6 @@ This release fixes an edge case where output arguments for subworkflows were mal
4054

4155
* `NextflowRunner`: Fix issue where output arguments for subworkflows were being returned as nested arrays instead of simple arrays (PR #798, PR #800).
4256

43-
4457
# Viash 0.9.1 (2024-12-16): Enhanced nextflow support and Scala 3 update
4558

4659
Workflows can now publish results asynchronously by emitting multiple output channels. These results will then be merged into a published output behind the screens.
@@ -227,6 +240,28 @@ Implemented a proper way of caching dependency repositories. The cache is stored
227240

228241
* `viash test`: Fix an issue where the tests would not copy package config settings to determine the docker image name (PR #767).
229242

243+
# Viash 0.8.8 (2025-04-24): Hotfix for Nextflow edge
244+
245+
This is a hotfix release for the changes in Nextflow edge's handling of double arguments.
246+
247+
## BUG FIXES
248+
249+
* `NextflowRunner`: Automatically convert integers to doubles when argument type is `double` (PR #823).
250+
251+
# Viash 0.8.7 (2025-04-01): Backport support upcoming version of Nextflow
252+
253+
The upcoming release of Nextflow introduces a new class for loading scripts and renamed the old class.
254+
This release supports this change by using reflection to detect the available class.
255+
256+
## BUG FIXES
257+
258+
* `viash build`: Fix error handling of non-generic errors in the build process or while pushing docker containers (PR #696).
259+
260+
* `NextflowRunner`: ScriptParser was renamed to ScriptLoaderV1 in Nextflow 25.02.0-edge (PR #817). Backport from Viash 0.9.3 (PR #812).
261+
This fix uses reflection to detect whether ScriptParser exists -- if not the ScriptLoaderFactory is used instead.
262+
263+
* `NextflowRunner`: Backport path handling for `meta.resources_dir` for when symlinks are used (PR #817).
264+
230265
# Viash 0.8.6 (2024-04-26): Bug fixes and improvements for CI
231266

232267
Fix some issues in some edge cases.

RELEASE_GUIDE.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@ e.g. from `version := "0.7.2-dev"` to `version := "0.7.2"`
1515

1616
# Merge PR to main
1717

18-
## Add a tag on main with the new version number
18+
# Release Viash
1919

20-
# Create GitHub release
20+
## Run 'Prepare Viash Release' workflow on GitHub
2121

22-
Title: 'Viash 0.7.2'
23-
Content: Add the full changelog entry of this release
22+
Select the `main` branch
2423

25-
# Build viash and viash_install and add to the release
24+
## Release the prepared release
2625

27-
Create the binaries with `make && make tools`.
28-
Add the files `bin/viash` and `bin/viash_install`.
26+
Head over releases and select the prepared release.
27+
28+
Double check the tag version.
29+
30+
Add the title from the changelog.md into the release notes.
31+
32+
Select the necessary prerelease or latest release options and hit the 'publish release' button.
2933

3034
# Update the website
3135

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name := "viash"
22

3-
version := "0.9.3-dev"
3+
version := "0.10.0-dev"
44

55
scalaVersion := "3.3.4"
66

docs/paper/paper.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,37 @@
22
title: 'Viash: A meta-framework for building reusable workflow modules'
33
bibliography: library.bib
44
authors:
5-
- name: Robrecht Cannoodt
5+
- given-names: Robrecht
6+
surname: Cannoodt
67
email: robrecht@data-intuitive.com
78
orcid: 0000-0003-3641-729X
89
corresponding: yes
910
affiliation: 1, 2, 3
10-
- name: Hendrik Cannoodt
11+
- given-names: Hendrik
12+
surname: Cannoodt
1113
orcid: 0000-0002-0032-6719
1214
affiliation: '1'
13-
- name: Dries Schaumont
15+
- given-names: Dries
16+
surname: Schaumont
1417
orcid: 0000-0002-4389-0440
1518
affiliation: '1'
16-
- name: Kai Waldrant
19+
- given-names: Kai
20+
surname: Waldrant
1721
orcid: 0009-0003-8555-1361
1822
affiliation: '1'
19-
- name: Eric Van de Kerckhove
23+
- given-names: Eric
24+
surname: Van de Kerckhove
2025
affiliation: '1'
21-
- name: Andy Boschmans
26+
- given-names: Andy
27+
surname: Boschmans
2228
orcid: 0009-0008-8793-4661
2329
affiliation: '1'
24-
- name: Dries De Maeyer
30+
- given-names: Dries
31+
surname: De Maeyer
2532
orcid: 0000-0002-1314-3348
2633
affiliation: '4'
27-
- name: Toni Verbeiren
34+
- given-names: Toni
35+
surname: Verbeiren
2836
email: toni@data-intuitive.com
2937
orcid: 0000-0002-7007-6866
3038
corresponding: yes

src/main/resources/io/viash/runners/nextflow/arguments/_checkArgumentType.nf

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -66,64 +66,56 @@ def _checkArgumentType(String stage, Map par, Object value, String errorIdentifi
6666
foundClass = "List[${e.foundClass}]"
6767
}
6868
} else if (par.type == "string") {
69-
// cast to string if need be
69+
// cast to string if need be. only cast if the value is a GString
7070
if (value instanceof GString) {
71-
value = value.toString()
71+
value = value as String
7272
}
7373
expectedClass = value instanceof String ? null : "String"
7474
} else if (par.type == "integer") {
7575
// cast to integer if need be
76-
if (value instanceof String) {
76+
if (value !instanceof Integer) {
7777
try {
78-
value = value.toInteger()
78+
value = value as Integer
7979
} catch (NumberFormatException e) {
80-
// do nothing
80+
expectedClass = "Integer"
8181
}
8282
}
83-
if (value instanceof java.math.BigInteger) {
84-
value = value.intValue()
85-
}
86-
expectedClass = value instanceof Integer ? null : "Integer"
8783
} else if (par.type == "long") {
8884
// cast to long if need be
89-
if (value instanceof String) {
85+
if (value !instanceof Long) {
9086
try {
91-
value = value.toLong()
87+
value = value as Long
9288
} catch (NumberFormatException e) {
93-
// do nothing
89+
expectedClass = "Long"
9490
}
9591
}
96-
if (value instanceof Integer) {
97-
value = value.toLong()
98-
}
99-
expectedClass = value instanceof Long ? null : "Long"
10092
} else if (par.type == "double") {
10193
// cast to double if need be
102-
if (value instanceof String) {
94+
if (value !instanceof Double) {
10395
try {
104-
value = value.toDouble()
96+
value = value as Double
10597
} catch (NumberFormatException e) {
106-
// do nothing
98+
expectedClass = "Double"
10799
}
108100
}
109-
if (value instanceof java.math.BigDecimal) {
110-
value = value.doubleValue()
111-
}
112-
if (value instanceof Float) {
113-
value = value.toDouble()
101+
} else if (par.type == "float") {
102+
// cast to float if need be
103+
if (value !instanceof Float) {
104+
try {
105+
value = value as Float
106+
} catch (NumberFormatException e) {
107+
expectedClass = "Float"
108+
}
114109
}
115-
expectedClass = value instanceof Double ? null : "Double"
116110
} else if (par.type == "boolean" | par.type == "boolean_true" | par.type == "boolean_false") {
117111
// cast to boolean if need be
118-
if (value instanceof String) {
119-
def valueLower = value.toLowerCase()
120-
if (valueLower == "true") {
121-
value = true
122-
} else if (valueLower == "false") {
123-
value = false
112+
if (value !instanceof Boolean) {
113+
try {
114+
value = value as Boolean
115+
} catch (Exception e) {
116+
expectedClass = "Boolean"
124117
}
125118
}
126-
expectedClass = value instanceof Boolean ? null : "Boolean"
127119
} else if (par.type == "file" && (par.direction == "input" || stage == "output")) {
128120
// cast to path if need be
129121
if (value instanceof String) {
@@ -135,10 +127,13 @@ def _checkArgumentType(String stage, Map par, Object value, String errorIdentifi
135127
expectedClass = value instanceof Path ? null : "Path"
136128
} else if (par.type == "file" && stage == "input" && par.direction == "output") {
137129
// cast to string if need be
138-
if (value instanceof GString) {
139-
value = value.toString()
130+
if (value !instanceof String) {
131+
try {
132+
value = value as String
133+
} catch (Exception e) {
134+
expectedClass = "String"
135+
}
140136
}
141-
expectedClass = value instanceof String ? null : "String"
142137
} else {
143138
// didn't find a match for par.type
144139
expectedClass = par.type

src/main/resources/io/viash/runners/nextflow/channel/channelFromParams.nf renamed to src/main/resources/io/viash/runners/nextflow/channel/_channelFromParams.nf

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,3 @@ private _channelFromParams(Map params, Map config) {
100100
def processedParams = _paramsToParamSets(params, config)
101101
return Channel.fromList(processedParams)
102102
}
103-
104-
/**
105-
* Parse nextflow parameters based on settings defined in a viash config
106-
* and return a nextflow channel.
107-
*
108-
* @param params Input parameters. Can optionaly contain a 'param_list' key that
109-
* provides a list of arguments that can be split up into multiple events
110-
* in the output channel possible formats of param_lists are: a csv file,
111-
* json file, a yaml file or a yaml blob. Each parameters set (event) must
112-
* have a unique ID.
113-
* @param config A Map of the Viash configuration. This Map can be generated from the config file
114-
* using the readConfig() function.
115-
*
116-
* @return A nextflow Channel with events. Events are formatted as a tuple that contains
117-
* first contains the ID of the event and as second element holds a parameter map.
118-
*
119-
*
120-
*/
121-
def channelFromParams(Map params, Map config) {
122-
log.warn "channelFromParams is deprecated and will be removed in Viash 0.10.0. ",
123-
"Nextflow workflows can now be built into standalone components where parsed parameters ",
124-
"are automatically provided to the input channel."
125-
return _channelFromParams(params, config)
126-
}

src/main/scala/io/viash/Main.scala

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -198,36 +198,6 @@ object Main extends Logging {
198198
}
199199
case _ =>
200200
}
201-
202-
// backwards compability for --platform
203-
cli.subcommands.lastOption match {
204-
case Some(x: ViashCommand) =>
205-
if (x.platform.isDefined) {
206-
if (x.runner.isDefined || x.engine.isDefined) {
207-
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
208-
}
209-
warn("Warning: --platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0. Use --runner or --engine instead.")
210-
}
211-
case Some(x: ViashNs) =>
212-
if (x.platform.isDefined) {
213-
if (x.runner.isDefined || x.engine.isDefined) {
214-
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
215-
}
216-
warn("Warning: --platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0. Use --runner or --engine instead.")
217-
}
218-
case _ =>
219-
}
220-
// backwards compability for --apply_platform
221-
cli.subcommands match {
222-
case List(cli.namespace, cli.namespace.exec) =>
223-
if (cli.namespace.exec.applyPlatform()) {
224-
if (cli.namespace.exec.applyRunner() || cli.namespace.exec.applyEngine()) {
225-
throw new IllegalArgumentException("Error: --platform cannot be used together with --runner or --engine.")
226-
}
227-
warn("Warning: --apply_platform is deprecated in Viash 0.9.0, will be removed in Viash 0.10.0n. Use --apply_runner or --apply_engine instead.")
228-
}
229-
case _ =>
230-
}
231201

232202
// see if there are package overrides passed to the viash command
233203
val packSrc = cli.subcommands.lastOption match {
@@ -337,8 +307,8 @@ object Main extends Logging {
337307
cli.namespace.list,
338308
packageConfig = pack1,
339309
addOptMainScript = false,
340-
applyRunner = cli.namespace.list.runner.isDefined || cli.namespace.list.platform.isDefined,
341-
applyEngine = cli.namespace.list.engine.isDefined || cli.namespace.list.platform.isDefined
310+
applyRunner = cli.namespace.list.runner.isDefined,
311+
applyEngine = cli.namespace.list.engine.isDefined
342312
)
343313
val configs2 = namespaceDependencies(configs, None, pack1.rootDir)
344314
ViashNamespace.list(
@@ -351,8 +321,8 @@ object Main extends Logging {
351321
val configs = readConfigs(
352322
cli.namespace.exec,
353323
packageConfig = pack1,
354-
applyRunner = cli.namespace.exec.applyRunner() || cli.namespace.exec.applyPlatform(),
355-
applyEngine = cli.namespace.exec.applyEngine() || cli.namespace.exec.applyPlatform()
324+
applyRunner = cli.namespace.exec.applyRunner(),
325+
applyEngine = cli.namespace.exec.applyEngine()
356326
)
357327
ViashNamespace.exec(
358328
configs = configs,
@@ -371,7 +341,7 @@ object Main extends Logging {
371341
cli.config.view,
372342
packageConfig = pack1,
373343
addOptMainScript = false,
374-
applyRunnerAndEngine = cli.config.view.platform.isDefined || cli.config.view.runner.isDefined || cli.config.view.engine.isDefined
344+
applyRunnerAndEngine = cli.config.view.runner.isDefined || cli.config.view.engine.isDefined
375345
)
376346
val config2 = DependencyResolver.modifyConfig(config.config, None, pack1.rootDir)
377347
ViashConfig.view(
@@ -480,11 +450,8 @@ object Main extends Logging {
480450
viashPackage = Some(packageConfig)
481451
)
482452
if (applyRunnerAndEngine) {
483-
val runnerStr = subcommand.runner.toOption orElse subcommand.platform.toOption
484-
val engineStr = subcommand.engine.toOption orElse subcommand.platform.toOption
485-
486-
val runner = config.findRunner(runnerStr)
487-
val engines = config.findEngines(engineStr)
453+
val runner = config.findRunner(subcommand.runner.toOption)
454+
val engines = config.findEngines(subcommand.engine.toOption)
488455

489456
processConfigWithRunnerAndEngine(
490457
appliedConfig = config,
@@ -509,8 +476,8 @@ object Main extends Logging {
509476
val queryNamespace = subcommand.query_namespace.toOption
510477
val queryName = subcommand.query_name.toOption
511478
val queryConfig = subcommand.query_config.toOption
512-
val runnerStr = subcommand.runner.toOption orElse subcommand.platform.toOption
513-
val engineStr = subcommand.engine.toOption orElse subcommand.platform.toOption
479+
val runnerStr = subcommand.runner.toOption
480+
val engineStr = subcommand.engine.toOption
514481
val configMods = packageConfig.config_mods
515482

516483
val configs0 = Config.readConfigs(

0 commit comments

Comments
 (0)