populse / capsul

Collaborative Analysis Platform : Simple, Unifying, Lean
Other
7 stars 14 forks source link

use xor and optional in get_missing_mandatory_parameters() #290

Closed servoz closed 11 months ago

servoz commented 11 months ago

See #289.

Here we only modify capsul.process.Process.get_missing_mandatory_parameters(). Is it also necessary to modify capsul.pipeline.pipeline_nodes.Node.get_missing_mandatory_parameters()?

In this PR, we consider that only two parameters can be mutually exclusive. In fact, I don't know if this is the case for more than 2 parameters. If it's the case for more than 2 parameters, we need to change the xor_value = self.get_parameter(xors[0]) and do the check on all elements (it's not a big change to do it if we have a doubt...). What do you think?

servoz commented 11 months ago

I just made a small change to handle the case where there are more than 2 mutually exclusive parameters ... I don't know if this makes sense, but at least it will work in all cases ...

denisri commented 11 months ago

Okay, but the "xor" is implemented as a "or" here, isnt't it ?

servoz commented 11 months ago

Here we look for missing parameters.

It must be non-optional, and if it doesn't exist while one of xor's parameters (which must itself be non-optional) does, then it's not missing.

Then there's the compatibility check between parameters (for example, two mutually exclusive parameters can't exist at the same time), which is handled by nipype, which throws an exception in this case ... and that's what's currently crashing Mia (case 2- in the #289 ticket, this case has yet to be handled, but that's another issue, I'll look at later, certainly to be solved in Mia ...).

I don't know if I've answered correctly, I'm not sure I understood the question ...

denisri commented 11 months ago

OK I get it :)