Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major dependency updates after numpy 2.0.0 #509

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

qchempku2017
Copy link
Collaborator

Summary

Major changes:

  • Update numpy dependency to numpy >= 2.0.0
  • Update pymatgen, monty, h5py, scipy, scikit-learn dependencies accordingly.
  • Update scip installation procedure as pyscipopt now has bundled solver libarary, no longer needs to install a stand-alone package before testing.

Todos

If this is work in progress, what else needs to be done?

  • Update package dependencies
  • Test locally
  • Test remotely through workflows

Checklist

  • All existing tests pass.
  • Tests have been added for any new features/fixes.
  • Docstrings have been added in the Google docstring format.

Tip: Install pre-commit hooks to auto-check types and linting before every commit:

pip install -U pre-commit
pre-commit install

…ikit-learn, scipy versions updated accordingly. Pyscipopt now contains bundled solver library, no longer needs stand-alone binary installation.
@qchempku2017 qchempku2017 marked this pull request as draft January 1, 2025 03:35
…with np.int32_t, replace all double types with np.float64_t to ensure compatibility with numpy 2. Require further changes and tests in the frontend functions that uses them.
@qchempku2017
Copy link
Collaborator Author

qchempku2017 commented Jan 1, 2025

In order to ensure compatibility across platform, the current approach I take is to enforce all int and long type variables that appears in smol/utils/cluster cython modules to be np.int32_t, while all double types to be np.float64_t. Thus, the functions that use these modules in the Python frontend will be responsible to check and convert into the correct input format before calling the Cython backend.

For example:

https://github.com/qchempku2017/smol/blob/94adb8c836847e95e288f7889fd88395e4c9ae29/smol/utils/cluster/container.pyx#L84C1-L104C21

@lbluque @kamronald There might be a smarter solution. If you have better suggestions please feel free to reach out!

@lbluque lbluque marked this pull request as ready for review January 2, 2025 00:57
…to int and double type in order to pass compilation.
…Several tests still won't pass in test_cofe.
@qchempku2017
Copy link
Collaborator Author

@lbluque Please note that test_cofe/test_expansion/test_prune is not completely safe.

Pruning may occasionally throw out an orbit entirely, causing inconsistency between ints.shape and orbit_multiplicities.shape. I encountered this rare case just now. Fixed by replacing with "expansion.cluster_subspace.orbit_multiplicities".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant