jewettaij / moltemplate

A general cross-platform tool for preparing simulations of molecules and complex molecular assemblies
http://www.moltemplate.org
MIT License
244 stars 95 forks source link

Fixing attribute double initialization. #60

Closed ProfLeao closed 2 years ago

ProfLeao commented 2 years ago

self.coords_multi the value is already properly initialized in the constructor, its use in this part seems to prevent manual assignment by the client of the class.

jewettaij commented 2 years ago

Thanks Reginaldo

jewettaij commented 2 years ago

its use in this part seems to prevent manual assignment by the client of the class. It's true that those lines were not necessary. I should probably test the code more thoroughly. Thanks for testing and fixing.

jewettaij commented 2 years ago

I should probably test the code more thoroughly.

(...before merging the changes...) (hmm. I wonder why didn't circleci run automatic tests on your commits? I have to fix my circleci settings.)

jewettaij commented 2 years ago

Okay. I think I fixed it...

jewettaij commented 2 years ago

It looks like I made the similar mistake overwriting the contents of name_sequence_multi with [].

else:
    self.name_sequence_multi = []

Seeing how you fixed the problem with coords_multi helped me figure this out quickly. Thanks.

Anyway, don't forget tot do a pull request.

ProfLeao commented 2 years ago

I am working on a use of self avoided walks in place of Hamiltonian paths. I can provide an additional example as PR later, if that's not a problem for you.

jewettaij commented 2 years ago

Cool. If you have a program to generate a different kind of self-avoiding walk, please email me. I can't promise that I will use it in my examples. But if your self-avoiding-walk code is available online, I will let moltemplate users know where they can find it.