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

Remove SeededTest class #6799

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

aerubanov
Copy link
Contributor

@aerubanov aerubanov commented Jun 28, 2023

This PR remove SeededTest class and close #6234


📚 Documentation preview 📚: https://pymc--6799.org.readthedocs.build/en/6799/

@aerubanov aerubanov marked this pull request as draft June 28, 2023 14:54
@aerubanov
Copy link
Contributor Author

aerubanov commented Jun 28, 2023

Some tests are fails after removing SeededTest and I`m working on fixing it.

@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #6799 (6fcaf80) into main (50d056d) will decrease coverage by 4.38%.
The diff coverage is 100.00%.

❗ Current head 6fcaf80 differs from pull request most recent head d2475c9. Consider uploading reports for the commit d2475c9 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6799      +/-   ##
==========================================
- Coverage   92.05%   87.68%   -4.38%     
==========================================
  Files          96       95       -1     
  Lines       16376    16315      -61     
==========================================
- Hits        15075    14305     -770     
- Misses       1301     2010     +709     
Files Changed Coverage Δ
pymc/testing.py 88.38% <100.00%> (-3.22%) ⬇️

... and 20 files with indirect coverage changes

@aerubanov aerubanov marked this pull request as ready for review July 6, 2023 10:07
@aerubanov
Copy link
Contributor Author

@ricardoV94 , @twiecki Could you please review this PR when you will have some time?

Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

Looks pretty good. Small question and suggestion below

@@ -44,4 +44,4 @@ def strict_float32():
@pytest.fixture(scope="function", autouse=False)
def seeded_test():
# TODO: use this instead of SeededTest
np.random.seed(42)
np.random.seed(20160911)
Copy link
Member

Choose a reason for hiding this comment

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

Any reason for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found some test that fails with random seed 42 - the result differs from expected just a little bit more than the selected threshold value. That is why I decided to use here value from the SeededTest class for random seed.

tests/conftest.py Outdated Show resolved Hide resolved
@ferrine
Copy link
Member

ferrine commented Jul 28, 2023

Why not using a fixture with autouse?

@ricardoV94
Copy link
Member

Why not using a fixture with autouse?

For what? The point in that global seeding doesn't do anything in PyMC anymore so each test should create a generator/seed to pass to the functions that need seeding.

Do you mean a fixture to create such a seed?

@aerubanov
Copy link
Contributor Author

@ricardoV94 I think @ferrine ask about pytest fixture autouse argument to apply seeded_test fixture to all tests.

@ricardoV94
Copy link
Member

ricardoV94 commented Aug 1, 2023

@ricardoV94 I think @ferrine ask about pytest fixture autouse argument to apply seeded_test fixture to all tests.

I don't think we need/should do that. If anything we should move away from using any numpy RandomState stuff, so the fixture would be useless.

Let me know if I am missing something?

@ricardoV94
Copy link
Member

There's a conflict with main now. Otherwise I think it's good to merge

@ricardoV94 ricardoV94 merged commit 06bf9df into pymc-devs:main Aug 2, 2023
21 checks passed
@ricardoV94
Copy link
Member

Thanks @aerubanov!

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

Successfully merging this pull request may close these issues.

Remove SeededTest class
3 participants