zadorlab / KinBot

Automated reaction pathway search for gas-phase molecules
Other
45 stars 15 forks source link

AttributeError: 'StationaryPoint' object has no attribute 'maxbond' #51

Closed alongd closed 2 years ago

alongd commented 2 years ago

Executing a code such as:

rxn_finder = ReactionFinder(well, params.par, qc)
rxn_finder.find_reactions()

resulted in the following error:

File ".../KinBot/kinbot/reaction_finder.py", line 2284, in <genexpr>
    if all(self.species.maxbond[instance[ii]][instance[ii + 1]] > 1 for ii in range(len(instance) - 2)):
AttributeError: 'StationaryPoint' object has no attribute 'maxbond'

Is it possible that a call such as self.species.calc_maxbond() is missing prior to L2284 of reaction_finder.py?

juditzador commented 2 years ago

Hi Alon, In our workflow it doesn't happen that the maxbond attribute is not present, because we always call the self.charaterize() much earlier, but sure, if you are using the module on its own, it can happen. I added a few lines where you suggested:

        try:
            self.species.maxbond
        except AttributeError:
            self.species.calc_maxbond()

I think this will solve the problem you are having, let me know if it doesn't. Also note that I am heavily working on the master branch at the moment, we'll soon have a new version.

alongd commented 2 years ago

Thanks for the quick response! Is it possible that the recent addition if self.species.maxbond on L2287 is not necessary?

juditzador commented 2 years ago

Oh, sure, sorry. It was a bug that I left that in. I pushed the file w/o that line.