populse / mia_processes

The default processes repository for mia
Other
1 stars 2 forks source link

Initialization issue when self.requirement = [] #19

Closed manuegrx closed 1 year ago

manuegrx commented 1 year ago

When using alone a brick with self.requirement = [] there is an issue during pipeline initialization. A windows appears with the following message : message

However if we used this brick in a pipeline there is no pipeline initialization issue

For example brick preprocess.others.ConformeImage --> intialization issue when using the brick alone and okay when brick is used in Anat_mriqc pipeline.

It seems to come from make_initResult function (in populse_mia/user_interfacte/pipeline_maganer/process_mia).

def make_initResult(self):
        """Make the initResult_dict from initialisation."""
        if (
            (self.requirement is None)
            or (not self.inheritance_dict)
            or (not self.outputs)
        ):
            print(
                "\nDuring the {0} process initialisation, some possible "
                "problems were detected:".format(self)
            )

            if self.requirement is None:
                print("- requirement attribute was not found ...")

            if not self.inheritance_dict:
                print("- inheritance_dict attribute was not found ...")

            if not self.outputs:
                print("- outputs attribute was not found ...")

            print()

        if (
            self.outputs
            and self.requirement is not None
            and "spm" in self.requirement
        ):
            self.outputs["notInDb"] = ["spm_script_file"]

        return {
            "requirement": self.requirement,
            "outputs": self.outputs,
            "inheritance_dict": self.inheritance_dict,
        }

When using the brick alone, it is like self.requirement is None and not when using the same brick in a pipeline. I do not understand why, maybe I missing something

servoz commented 1 year ago

This issue is part of a larger issue regarding the management of requirements at initialisation time, which is currently suboptimal. There is already a ticket open on this topic in the populse_mia repository. Please close this one and add these findings to the existing ticket. The populse_mia ticket is on top of my to-do list... I will start working on this ticket as soon as possible (but I have other issues to deal with first!).