FCP-INDI / C-PAC

Configurable Pipeline for the Analysis of Connectomes
https://fcp-indi.github.io/
GNU Lesser General Public License v3.0
61 stars 39 forks source link

♻️ Always or by default have Function nodes "as module"s? #2109

Open shnizzedy opened 2 months ago

shnizzedy commented 2 months ago

Why don't we default https://github.com/FCP-INDI/C-PAC/blob/26ebd1ebb88b15229577757befda121b8e4490ab/CPAC/utils/interfaces/function/function.py#L163 as True (or even not make it an option, and just always have Function nodes "as module"s)?

I.e., when would we want a Function node not be "as module"?

Originally posted by @shnizzedy in https://github.com/FCP-INDI/C-PAC/issues/2062#issuecomment-1954443008

It's cool; as far as I can tell, it

  1. Includes the variables available in the namespace like if you imported the function normally outside of nipype (so you don't need the imports param or the imports defined in the function itself
  2. Includes the module name in the log instead of just the text of the function

But I don't know how much overhead this costs or saves, or what other considerations we should have about whether / when to use it

https://github.com/FCP-INDI/C-PAC/pull/2062#issuecomment-1971862268