uibcdf / MolSysMT

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

Comparing a selection (taking the value of a numpy ndarray) with 'all' #66

Closed dprada closed 2 years ago

dprada commented 2 years ago

Along the code there are multiple times comparing selection with 'all'. Lines such as:

    if indices is None:
        if selection != 'all':
            indices = select(molecular_system, element=element, selection=selection,
                    syntaxis=syntaxis, check=False)
        else:
            indices = 'all'

But this code gives the following warning if selection is a numpy ndarray:

FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison

Is this a potential source of errors in the future?