You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Language basics:Maps section of the docs has the following Tip:
Tip!: Appending an “update” map is a safer way to modify maps in Nextflow, specifically when passing maps through channels. This way, any references to the original map elsewhere in the pipeline won’t be modified. https://www.nextflow.io/docs/latest/script.html#maps
I understand this to mean making a deep copy of a map rather than adding a new reference (which I agree can be important). Is this what was intended? Unfortunately, I can not figure out what the document means by an "update" map. I am not a native Groovy developer, but I searched the Nextflow documentation, google, ChatGPT, and the official Groovy Maps documentation (https://groovy-lang.org/groovy-dev-kit.html).
This tip should be clarified, perhaps with a link to the documentation for "update" maps?
The text was updated successfully, but these errors were encountered:
It's not a technical term, that's why I put it in double quotes. Just an elaboration of the preceding example in which a map is updated by adding a new map instead of in-place mutation. See #2660 for the history behind this change. I think there was also a bytesize about it recently.
I think I probably would have understood the meaning if the Tip had started:
"Appending an “update” map using the '+' operator as shown above is a safer way ..."
I also think you could add at the end of the tip: "This is especially useful in adding items to the 'meta' map, which is used extensively in nf-core" (since this is the map 90% of the users are going to be dealing with).
PS: I like the + operator! Somehow the solution I found online was to clone using meta.subMap(meta.keySet())
I agree with Ben, the overall tip is not clear at all. I think it should say "Creating a new map instance .." or "Cloning the map object " would be more precise
The Language basics:Maps section of the docs has the following Tip:
Tip!: Appending an “update” map is a safer way to modify maps in Nextflow, specifically when passing maps through channels. This way, any references to the original map elsewhere in the pipeline won’t be modified.
https://www.nextflow.io/docs/latest/script.html#maps
I understand this to mean making a deep copy of a map rather than adding a new reference (which I agree can be important). Is this what was intended? Unfortunately, I can not figure out what the document means by an "update" map. I am not a native Groovy developer, but I searched the Nextflow documentation, google, ChatGPT, and the official Groovy Maps documentation (https://groovy-lang.org/groovy-dev-kit.html).
This tip should be clarified, perhaps with a link to the documentation for "update" maps?
The text was updated successfully, but these errors were encountered: