-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Channel
instead of channel
#5352
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ben Sherman <[email protected]>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -71,10 +71,6 @@ For example, the `Channel.of()` factory can be used to create a channel from an | |||
Channel.of(1, 2, 3).view() | |||
``` | |||
|
|||
:::{versionadded} 20.07.0 | |||
`channel` was introduced as an alias of `Channel`, allowing factory methods to be specified as `channel.of()` or `Channel.of()`, and so on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to completely remove reference to this? It's out there in the wild already..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could take it or leave it. the strict parser will recognize it and give a deprecation warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Phil here that it's already out in the wild and will cause frustration if it's not documented why.
Maybe:
channel
was introduced as an alias of Channel
, allowing factory methods to be specified as channel.of()
or Channel.of()
, and so on. It is preferable to use Channel
to maintain clarity and follow best practices. channel
will be depreciated in the future.
Or something like that.
Why this? actually the plane was to converge to |
why? |
because the use of uppercase is a legacy of Java conventions, but there's no really reason in nextflow lang. I always found unnatural the need to capitalise channel |
Uppercase is still needed to distinguish types from variable names. Otherwise it's difficult to tell which is which at a glance. This is not so important now but will become important when we add static types. So we need to prepare now |
Uppercase for types is a pure convention, above all as a nextflow developer I should not be exposed to |
Users absolutely will be exposed to workflow foo {
take:
inputs: Channel<Path>
param1: String
param2: Integer
flag1: Boolean
main:
// ...
} Similarly when hovering over a variable, they will see something like Therefore it makes most sense for the channel factories to be static methods of the |
Of course I agree that we shouldn't expose With static types, |
DSL2 introduced
channel
as an alias forChannel
to create channel factories. I assume this was for consistency with other lower-case words like "process" and "workflow". However, Channel is a type like List or Map or Path, and the channel factories are static methods that create values of type Channel.Technically, channels in Nextflow are of type
DataflowReadChannel
, but this is really an implementation detail. When we implement static types, we can provide an explicitChannel
type to the user that does not expose such internal details To prepare for that, we should deprecate the use ofchannel
before it gets any more widespread and causes confusion