Dessia-tech / dessia_common

GNU Lesser General Public License v2.1
1 stars 2 forks source link

Fix: duplicate result name nbv #675

Closed younesdessia closed 6 months ago

younesdessia commented 7 months ago
younesdessia commented 7 months ago

@GhislainJ as we have the possibility of putting a label on the Varaiable, I think we can do that

younesdessia commented 7 months ago

Yes but if we use _resultname as a name, the _find_name function adds a second nbv (Result Name)

I think that in this case, you have to put the same name, like that we will detect it and if the user wants to change he changes the label!

    def _find_name(self):
        found_name = False
        i = 0
        all_nbvs = self.nonblock_variables + self.detached_variables
        while not found_name and i < len(all_nbvs):
            variable = all_nbvs[i]
            found_name = variable.name == RESULT_VARIABLE_NAME
            i += 1
        if not found_name:
            self.detached_variables.insert(0, NAME_VARIABLE)
younesdessia commented 6 months ago

I'm closing this PR because I understood why I had this problem,

in fact I defined a nbv locally with the name Result Name that's why dessia_common adds a new one to me whereas when we let the front end do it it works well.