uibcdf / MolSysMT

Open source library to work with molecular systems
https://www.uibcdf.org/MolSysMT/
Other
12 stars 3 forks source link

Do we need a MolecularSystemNeeded error? #64

Closed dprada closed 2 years ago

dprada commented 2 years ago

In @Daniel-Ibarrola's PR the following code in basic/set.py:

    if check:

        if not is_molecular_system(molecular_system):
            raise MolecularSystemNeeded()

was replaced by:

    if check:

        if not is_molecular_system(molecular_system):
            raise TypeError("A molecular system is needed.")

I gues that at this point, the version of current process should be something as:

    if check:
        digest_single_molecular_system(molecular_system)

And it is inside the digestion where the error should be raised. This needs to be reviewed. Do we already have a MolecularSystemNeeded error to be raised in this situation?

Daniel-Ibarrola commented 2 years ago

This was fixed by #71. The molecular_system argument is checked by digestion function and it raises a MolecuarSystemNedeed error in case the argument doesn't have the expected type.