Skip to content

Fix JAX warnings in tests #306

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

Closed
wants to merge 147 commits into from

Conversation

jessegrabowski
Copy link
Member

JAX warning mentioned #305 seems to be caused by using multiple cores when sampling with pm.sample in tests. This PR sets cores=1 in all the tests to avoid it.

I also fixed a future warning emitted by arviz related to the use of the coords property to get the size of dimension -- the sizes property should be used instead.

Finally (and perhaps controversially?), I took the opportunity to move the test folder up one level, out of the project module. This matches the directory structure of pymc and pytensor, and makes more sense to me.

ferrine and others added 30 commits September 7, 2022 14:46
* fix unitary case

* fix pre commit
* Add wrapper for running blackjax pathfinder.
* Only look for tests in test subdir.

Co-authored-by: Ricardo Vieira <[email protected]>
* remove bart

* black
* added model_builder

* added explanation

* added tests

* formatting

* change in save and load method

* updated save and load methods

* fixed more errors

* fixed path variable in save and load

* Documentation

* Documentation

* fixed formatting and tests

* fixed docstring

* fixed minor issues

* fixed minor issues

* Update pymc_experimental/model_builder.py

Co-authored-by: Michael Osthege <[email protected]>

* Update pymc_experimental/model_builder.py

Co-authored-by: Michael Osthege <[email protected]>

* fixed spelling errors

* Update pymc_experimental/model_builder.py

Co-authored-by: Thomas Wiecki <[email protected]>

* Update pymc_experimental/model_builder.py

* Update pymc_experimental/model_builder.py

* added build method again

* Update pymc_experimental/tests/test_model_builder.py

* removed unecessary imports

* changed arviz to az

* fixed codes to pass build tests

* linespace -> linspace

* updated test_model_builder.py

* updated model_builder.py

* fixed overloading of test_fit()

* fixed indentation in docstring

* added some better examples

* fixed test.yml

* indetation

* Apply suggestions from code review

* Update pymc_experimental/model_builder.py

* Update pymc_experimental/model_builder.py

Co-authored-by: Michael Osthege <[email protected]>
Co-authored-by: Thomas Wiecki <[email protected]>
* Initial commit of the linear conjugate gradients

* Updated __init__ so that we can import linear_cg

* Since we are invoking the function as a class attribute, removing the self

* Fixed the import

* Cleaned up some unused code

* Fixed the name of the function

* If vector is not equal to itself, it might have NaN

* removed temporary variable

* Moved configuration from settings class to function arguments

* Ensure output has same datatype regardless of value of n_tridiag

* if n_tridiag = 0 then tridiagonal matrices are not computed instead an identity matrix is returned which doesn't affect downstream computation
* added predict_posterior

* changed tests

* Update pymc_experimental/model_builder.py

Co-authored-by: Thomas Wiecki <[email protected]>
)

* Initial commit of the linear conjugate gradients

* Updated __init__ so that we can import linear_cg

* Initial commit of pivoted cholesky

* Fixed the name of pivoted cholesky function

* Since we are invoking the function as a class attribute, removing the self

* Removing linear conjugate gradients from this branch

* Also removing linear cg from __init__

* Fixed the import

* Adding dependencies for pivoted_cholesky, they are also needed for tests

* Added correct package for pytorch

* Added try...catch block to ensure users who don't have these packages installed, and don't want to use pivoted Cholesky, can use pymc

* Added import checks in the test file as well

* removed unused commits

* removing pytorch and gpytorch from requirements.

* pre-commit wouldn't let me commit print statements

* removing the test for now

* Raising an ImportError instead of printing

* Addressing stylistic comment

* formatting fixes

* formatting fixes

* pre-commit modifications
* Make xhistogram dependency optional

* Update setup.py

* Update setup.py

Co-authored-by: Ricardo Vieira <[email protected]>

* Update setup.py

* Update setup.py

* pretty extras require

* Update setup.py

Co-authored-by: Ricardo Vieira <[email protected]>

* fix black

Co-authored-by: Maxim Kochurov <[email protected]>
…variable

Warning is now only issued for IntervalTransforms
* added predict_posterior

* changed tests

* Update pymc_experimental/model_builder.py

* updated load method

* updated load method

* added required changes

* added required changes

* fixed laod function

* fixed laod functio

* Update pymc_experimental/model_builder.py

* Update pymc_experimental/model_builder.py

* Apply suggestions from code review

* Restructure tests. Fix load().

* Bump isort.

* Skip saving on windows.

* Different approach.

* Different approach.

* Different approach.

* Different approach.

---------

Co-authored-by: Thomas Wiecki <[email protected]>
* changed id of model_builder to property, added type hinting

* added id property test

* autolinting

* added test for model_builder predict function

* extended test_model_builder.py with test_extract_samples

* last test for model_builder

* addressing requested changes, created support function from code repetitions

---------

Co-authored-by: Michal Raczycki <[email protected]>
ricardoV94 and others added 17 commits November 23, 2023 15:12
* add more typehints

* Update pymc_experimental/tests/distributions/test_multivariate.py

Co-authored-by: Ricardo Vieira <[email protected]>

* Update pymc_experimental/tests/distributions/test_multivariate.py

Co-authored-by: Ricardo Vieira <[email protected]>

* change a letter

* change a letter

* wrap results into a named tuple

---------

Co-authored-by: Ricardo Vieira <[email protected]>
Expand test coverage fix bugs in `structural.py`
* Cycle initial state has shape (2,) and two named dimensions

Test initial state against statsmodels

* Add tests of coords and dims for structural models

* Add tests of params_info for structural models
…variances (pymc-devs#296)

* Model variables named "sigma" no longer expect variances

* Rename variables "sigma" to "sigma2" in `create_structural_model_and_equivalent_statsmodel` test function
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.3.0...v4.5.0)
- [github.com/PyCQA/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2)
- [github.com/asottile/pyupgrade: v2.37.1 → v3.15.0](asottile/pyupgrade@v2.37.1...v3.15.0)
- [github.com/psf/black: 22.6.0 → 23.12.1](psf/black@22.6.0...23.12.1)
- [github.com/PyCQA/pylint: v2.14.5 → v3.0.3](pylint-dev/pylint@v2.14.5...v3.0.3)
- [github.com/MarcoGorelli/madforhooks: 0.3.0 → 0.4.1](MarcoGorelli/madforhooks@0.3.0...0.4.1)
updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1)
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jessegrabowski
Copy link
Member Author

Sorry I posted cringe, fixing the git history on this branch.

@zaxtax
Copy link
Contributor

zaxtax commented Feb 11, 2024 via email

@jessegrabowski jessegrabowski force-pushed the fix-tests branch 2 times, most recently from 02b5665 to 6d6ee91 Compare February 11, 2024 13:47
@jessegrabowski jessegrabowski deleted the fix-tests branch February 11, 2024 14:50
@jessegrabowski jessegrabowski restored the fix-tests branch February 11, 2024 14:53
@jessegrabowski jessegrabowski deleted the fix-tests branch February 11, 2024 14:54
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.