mphowardlab / lammpsio

Python tools for working with LAMMPS files
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Only return True in has_ methods if self._N > 0 #65

Closed clpetix closed 1 day ago

clpetix commented 1 month ago

All the has_ methods should check with return self._property is not None and self._N > 0 since .N can be zero else this will throw errors in the @property methods , as an array that is allocated to 0 should not be considered as being there.

https://github.com/mphowardlab/lammpsio/blob/3070f946570fda16a9881b78a35cd5153d406a5c/src/lammpsio/topology.py#L95C5-L104C40

mphoward commented 1 day ago

Resolved in #68