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

Renamed SMC files #6174

Merged
merged 1 commit into from
Oct 29, 2022
Merged

Renamed SMC files #6174

merged 1 commit into from
Oct 29, 2022

Conversation

IMvision12
Copy link
Contributor

@IMvision12 IMvision12 commented Oct 2, 2022

What is this PR about?

Renamed SMC Files
Closes : #6171

Major / Breaking Changes

  • Renamed SMC files

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.

Thanks for opening the PR. We should keep the internal function names unchanged. Change only file names.

RELEASE-NOTES.md Outdated Show resolved Hide resolved
RELEASE-NOTES.md Outdated Show resolved Hide resolved
pymc/distributions/simulator.py Outdated Show resolved Hide resolved
pymc/smc/__init__.py Outdated Show resolved Hide resolved
pymc/smc/sampling.py Outdated Show resolved Hide resolved
@IMvision12 IMvision12 requested a review from ricardoV94 October 2, 2022 10:14
@ricardoV94
Copy link
Member

ricardoV94 commented Oct 2, 2022

@IMvision12 Why did you close #6173 and open this PR?

@IMvision12
Copy link
Contributor Author

No particular reason; did I do something wrong?

@Armavica
Copy link
Member

Armavica commented Oct 2, 2022

No particular reason; did I do something wrong?

If you are not happy with a PR that you submitted, or if the tests don't pass, etc., there is no need to create a new PR: the easiest is to push again to the same branch, and the PR will be updated. If you remove or modify some of the commits that are already pushed, you can git push --force to replace them. A PR is a request to merge some changes but while it has not been accepted you can always change what you want to merge.

@IMvision12
Copy link
Contributor Author

IMvision12 commented Oct 2, 2022

Thanks for Information

pymc/tests/distributions/test_simulator.py Outdated Show resolved Hide resolved
pymc/smc/sampling.py Outdated Show resolved Hide resolved
pymc/tests/smc/test_smc.py Outdated Show resolved Hide resolved
@IMvision12 IMvision12 requested review from Armavica and removed request for ricardoV94 October 3, 2022 04:53
Copy link
Member

@Armavica Armavica left a comment

Choose a reason for hiding this comment

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

Following up on @ricardoV94's review, I pointed out the places that should not be modified.

pymc/distributions/simulator.py Outdated Show resolved Hide resolved
pymc/smc/sampling.py Outdated Show resolved Hide resolved
pymc/tests/distributions/test_simulator.py Outdated Show resolved Hide resolved
pymc/tests/smc/test_smc.py Outdated Show resolved Hide resolved
docs/source/api/smc.rst Outdated Show resolved Hide resolved
@IMvision12
Copy link
Contributor Author

@Armavica Thanks for feedback, I have updated the files

@IMvision12 IMvision12 requested a review from Armavica October 4, 2022 05:19
Copy link
Member

@Armavica Armavica left a comment

Choose a reason for hiding this comment

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

There are still two places in test_smc.py that have been modified but shouldn't be. There are also a few places in this file that have not been modified but should be, you will see them if you run the tests with pytest pymc/tests/smc. After that, I think that it should be good.

pymc/tests/smc/test_smc.py Outdated Show resolved Hide resolved
pymc/tests/smc/test_smc.py Outdated Show resolved Hide resolved
@IMvision12
Copy link
Contributor Author

@Armavica I modified the file, but the tests are still failing.

@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Merging #6174 (d1a4f5c) into main (570e6e8) will decrease coverage by 8.12%.
The diff coverage is 66.66%.

❗ Current head d1a4f5c differs from pull request most recent head 451c439. Consider uploading reports for the commit 451c439 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6174      +/-   ##
==========================================
- Coverage   93.77%   85.65%   -8.13%     
==========================================
  Files         101       99       -2     
  Lines       22232    20962    -1270     
==========================================
- Hits        20849    17955    -2894     
- Misses       1383     3007    +1624     
Impacted Files Coverage Δ
pymc/smc/kernels.py 76.02% <ø> (ø)
pymc/tests/smc/test_smc.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/smc/sampling.py 77.85% <100.00%> (ø)
pymc/tests/distributions/test_simulator.py 99.50% <100.00%> (ø)
pymc/tests/tuning/test_scaling.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/tests/tuning/test_starting.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/tests/step_methods/test_slicer.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/tests/step_methods/hmc/test_nuts.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/tests/distributions/test_transform.py 0.00% <0.00%> (-100.00%) ⬇️
pymc/tests/step_methods/test_metropolis.py 0.00% <0.00%> (-100.00%) ⬇️
... and 50 more

@Armavica
Copy link
Member

Armavica commented Oct 5, 2022

Some of these tests fail because there are still a few places in test_smc.py that should be updated as a consequence of the file name change. You can see the output of the relevant tests on your computer if you run pytest pymc/tests/smc, or also here: https://github.com/pymc-devs/pymc/actions/runs/3188204616/jobs/5201000626 Please let me know if you need help fixing these issues.

Some others fail because now pymc.sampling is colliding with pymc.smc.sampling, because of

from pymc.smc import *

@ricardoV94 what should we do here?

@Armavica Armavica added no releasenotes Skipped in automatic release notes generation maintenance SMC Sequential Monte Carlo labels Oct 5, 2022
@ricardoV94 ricardoV94 removed the no releasenotes Skipped in automatic release notes generation label Oct 28, 2022
@ricardoV94
Copy link
Member

Some of these tests fail because there are still a few places in test_smc.py that should be updated as a consequence of the file name change. You can see the output of the relevant tests on your computer if you run pytest pymc/tests/smc, or also here: https://github.com/pymc-devs/pymc/actions/runs/3188204616/jobs/5201000626 Please let me know if you need help fixing these issues.

Some others fail because now pymc.sampling is colliding with pymc.smc.sampling, because of

from pymc.smc import *

@ricardoV94 what should we do here?

I pushed some changes that specify __all__ so that not everything is imported at the root level

@ricardoV94
Copy link
Member

@IMvision12 I squashed the commits and force-pushed do solve the conflicts. Be careful to get the upstream changes before you try to do further changes

@ricardoV94 ricardoV94 added this to the v4.3.0 milestone Oct 28, 2022
@ricardoV94 ricardoV94 added the major Include in major changes release notes section label Oct 28, 2022
Copy link
Member

@michaelosthege michaelosthege left a comment

Choose a reason for hiding this comment

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

One small comment, otherwise this appears to be ready to merge?

from pymc.smc.kernels import IMH, MH
from pymc.smc.sampling import sample_smc

__all__ = ("sample_smc",)
Copy link
Member

Choose a reason for hiding this comment

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

@IMvision12 you didn't include IMH and MH in __all__?

Copy link
Member

Choose a reason for hiding this comment

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

They weren't available at the root level before, just via pymc.smc. I think it was fine like that

from pymc.smc.kernels import IMH, MH
from pymc.smc.sampling import sample_smc

__all__ = ("sample_smc",)
Copy link
Member

Choose a reason for hiding this comment

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

nit: Isn't __all__ usually a list? In PyMC it is a list in 42 places and a tuple in only 2.

Copy link
Member

Choose a reason for hiding this comment

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

I'm team tuples

@ricardoV94 ricardoV94 merged commit bcffce2 into pymc-devs:main Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance major Include in major changes release notes section SMC Sequential Monte Carlo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename SMC files
4 participants