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

Couple of numpy-related fixes #140

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

Conversation

davidwilby
Copy link
Collaborator

📝 Description

We have a few tests routinely failing at the moment for a handful of reasons mostly relating to numpy 2.

One such error is due to DeepSensor's dependency stheno not yet pinning the version of fdm which repairs some of the numpy compatibility bugs. I've raised a PR in that project here: wesselb/stheno#27

In this PR there are a couple of corrections to alleviate test failures:

  1. Use of np.product in some tests, this was changed in something like numpy 1.16 to np.prod.
  2. The type of encoder_scales was being set to a numpy float32 with numpy 2 (possible relating to https://numpy.org/devdocs/numpy_2_0_migration_guide.html#changes-to-numpy-data-type-promotion) which was causing the saving and loading test to fail. I've added an int() but unsure if this is appropriate/ideal, though all of the tests pass locally.

✅ Checklist before requesting a review

(See the contributing guide for more details on these steps.)

  • I have installed developer dependencies with pip install -r requirements/requirements.dev.txt and running pre-commit install (or alternatively, manually running ruff format before commiting)

If changing or adding source code:

  • tests are included and are passing (run pytest).
  • documentation is included or updated as relevant, including docstrings.

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