-
-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Describe the feature
Currently the categories are quite strict in the sense that they provide the functionality to check individual atoms.
However, there are cases where it could be valuable to retain state information in the form of
- geometry from which it was categorized
- index in the above geometry
- neighbor information (when searching for neighbors)
A primary concern when trying to solve #202 is to reduce the overhead of doing the neighbor estimation twice, which is necessary when doing the categories.
Instead we might propose something like this:
-
a category is a base class that is only used to check stuff
-
when categorizing a
Category, it should return aCategoryResultclass specifying whether it succeeded (if res) and some information. I imagine something like:@dataclass class CategoryResult: category: Category info: PropertyDict # geometry, atom, [neighbors, ...] def __bool__(self): return not isinstance(self.category, NullCategory)
This approach is not too different from
scipyoptimizers. My main worry is the optional variables associated with the categories. -
Are there other ways to do this?