scikit-learn-contrib / scikit-matter

A collection of scikit-learn compatible utilities that implement methods born out of the materials science and chemistry communities
https://scikit-matter.readthedocs.io/en/v0.2.0/
BSD 3-Clause "New" or "Revised" License
76 stars 20 forks source link

Sparse kde #222

Open GardevoirX opened 7 months ago

GardevoirX commented 7 months ago

This PR introduces SparseKDE:

I am not sure if the current API of SparseKDE is OK and if the auxiliary classes should be integrated into SparseKDE. Also, SparseKDE seems to be too large and complex. Perhaps it needs to be decomposed into smaller parts, but I have not figured out how.

Contributor (creator of PR) checklist

For Reviewer


📚 Documentation preview 📚: https://scikit-matter--222.org.readthedocs.build/en/222/

PicoCentauri commented 5 months ago

Also, can you please update the CHANGELOG file.

GardevoirX commented 3 months ago

Hi @agoscinski, thank you for your review! I just accepted several modifications and found that the build of docs failed, and the error seems to be out of the scope of this PR. I checked this branch and it is not behind the main branch. Please take a look:

Extension error:
Here is a summary of the problems encountered when running the examples:

Unexpected failing examples:

    ../../examples/selection/GCH-ROY.py failed leaving traceback:

    Traceback (most recent call last):
      File "/home/docs/checkouts/readthedocs.org/user_builds/scikit-matter/checkouts/222/examples/selection/GCH-ROY.py", line 28, in <module>
        roy_data = load_roy_dataset()
                   ^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/scikit-matter/envs/222/lib/python3.12/site-packages/skmatter/datasets/_base.py", line 145, in load_roy_dataset
        energies = np.array([f.info["energy"] for f in structures])
                             ~~~~~~^^^^^^^^^^
    KeyError: 'energy'

After I merged the main branch to the main branch of my fork, I also found that the build of docs failed.

PicoCentauri commented 3 months ago

Hi @agoscinski, thank you for your review! I just accepted several modifications and found that the build of docs failed, and the error seems to be out of the scope of this PR. I checked this branch and it is not behind the main branch. Please take a look:

Extension error:
Here is a summary of the problems encountered when running the examples:

Unexpected failing examples:

    ../../examples/selection/GCH-ROY.py failed leaving traceback:

    Traceback (most recent call last):
      File "/home/docs/checkouts/readthedocs.org/user_builds/scikit-matter/checkouts/222/examples/selection/GCH-ROY.py", line 28, in <module>
        roy_data = load_roy_dataset()
                   ^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/scikit-matter/envs/222/lib/python3.12/site-packages/skmatter/datasets/_base.py", line 145, in load_roy_dataset
        energies = np.array([f.info["energy"] for f in structures])
                             ~~~~~~^^^^^^^^^^
    KeyError: 'energy'

After I merged the main branch to the main branch of my fork, I also found that the build of docs failed.

This is an issue related to the new ase 3.23.0 version that was release a week ago. One can not use the key "energy" anymore to extract the energy but instead should use the get_potential_energy() methof of the Atoms instance. We have to fix this in a different PR.

GardevoirX commented 1 month ago

Hi @agoscinski, I think this PR is ready for further review. Thank you for your time!