Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Moving fps and cur to scikit-cosmo version with backwards compatibility#347

Merged
max-veit merged 7 commits into
masterfrom
feat/remove_fps_and_cur
Aug 26, 2021
Merged

Moving fps and cur to scikit-cosmo version with backwards compatibility#347
max-veit merged 7 commits into
masterfrom
feat/remove_fps_and_cur

Conversation

@max-veit

@max-veit max-veit commented Apr 29, 2021

Copy link
Copy Markdown
Contributor

The FPSFilter and CURFilter classes currently implement functionality that is better handled (in some cases, already implemented) in scikit-cosmo. Therefore, we are refactoring these classes so that these tasks can be handled by skcosmo instead.

This refactoring includes removing some code duplication that was present in these versions (and caused e.g. #333 ) by making both filters inherit from a common base class, Filter. The new CURFilter and FPSFilter classes behave exactly as the old ones, so there should be little to no change necessary for end users.

Tasks before review:

  • Add tests, examples, and complete documentation of any added functionality
    • Make sure the autogenerated documentation appears in Sphinx and is
      formatted correctly (ask @max-veit if you need help with this task).
    • Write additional documentation in the Sphinx (not docstrings!) to
      explain the feature and its usage in plain English
    • Make sure the examples run (!) and produce the expected output
  • Run make lint on the project, ensure it passes
    • Review variable names, make sure they're descriptive (ask a friend)
    • Review all TODOs, convert to issues wherever possible
    • Make sure draft, in-progress, and commented-out code is moved to its
      own branch
  • If committing any code in Jupyter/IPython notebooks, install and run nbstripout
  • Merge with master and resolve any conflicts
  • Make scikit-cosmo dependency optional?

@max-veit max-veit force-pushed the feat/remove_fps_and_cur branch from 78a7ab1 to 79be454 Compare July 14, 2021 15:35
@max-veit max-veit marked this pull request as ready for review August 19, 2021 18:16
@max-veit max-veit requested a review from Luthaf August 20, 2021 15:46
Comment thread bindings/rascal/utils/__init__.py Outdated
Comment thread bindings/rascal/utils/filter.py Outdated
Comment thread bindings/rascal/utils/filter.py
Comment thread bindings/rascal/utils/filter.py Outdated
Comment thread bindings/rascal/utils/filter.py Outdated
Comment thread bindings/rascal/utils/filter.py Outdated
Comment thread bindings/rascal/utils/filter.py Outdated
Comment thread bindings/rascal/utils/filter.py
Comment thread bindings/rascal/utils/filter.py Outdated
Comment thread bindings/rascal/utils/filter.py
@Luthaf

Luthaf commented Aug 23, 2021

Copy link
Copy Markdown
Contributor

This PR looks very goo overall, the new code is much simpler!

Comment thread bindings/rascal/utils/filter.py Outdated
Comment thread bindings/rascal/utils/filter.py
Comment thread bindings/rascal/utils/__init__.py Outdated
rosecers and others added 6 commits August 26, 2021 10:47
* Adding skcosmo to requirements

* Make scikit-cosmo an optional dependency (and add to CI)
* Making filter work for tests/python/python_representation_calculator_test.py

Fleshing out tests

* Blacking tests

* Make some asserts more specific

* Reduce sparse points so i-PI zundel example runs faster

(it was timing out in the CI.  The potential still gives stable MD.)
* Try re-adding functionality to plot FPS Hausdorff distances

* maek lnit

lank time

lake mint

late mink

:(

* Somewhat tangential docs update

* Apply quick suggestions

Co-authored-by: Guillaume Fraux <guillaume.fraux@epfl.ch>

* More extensive changes from review

* Update feature sparsification notebook for modified API

* Update doc for Filter

and some more minor doc and cosmoetic updates

* Remove filter mode assert (validity check is done in superclass)

* Make wrong-selection-mode error handling more robust and friendly

* Add a check on size of the returned SparsePoints

* Update the global-sample-mode selection to return a SparsePoints

(it's ordered by species, but that's usually OK)

* Fix checks of error messages

The previous constuction wasn't actually getting to the
assertEqual(cm.message, ...) bits because the exception broke it out of
that code block first

Also fix the actual error messages following the checks
The reference implementation is now in scikit-cosmo
Now they no longer need cryptic helper functions and are potentially
more useful outside the Filter class

Update example notebook
since it's an optional dependency
@max-veit max-veit force-pushed the feat/remove_fps_and_cur branch from 4bb05b2 to 8c63bef Compare August 26, 2021 09:03
@max-veit max-veit requested a review from Luthaf August 26, 2021 09:04
also fix some merge detritus

@Luthaf Luthaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice work @max-veit!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants