Skip to content

Generalize categorizes (keep state, etc.)  #687

Description

@zerothi

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:

  1. a category is a base class that is only used to check stuff

  2. when categorizing a Category, it should return a CategoryResult class 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 scipy optimizers. My main worry is the optional variables associated with the categories.

  3. Are there other ways to do this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions