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 sd optional kwarg from distributions #5583

Merged
merged 23 commits into from
Mar 18, 2022

Conversation

purna135
Copy link
Member

@purna135 purna135 commented Mar 11, 2022

Closes #5576

Removed sd kwarg in favor of sigma from several continuous univariate distributions.

@codecov
Copy link

codecov bot commented Mar 11, 2022

Codecov Report

Merging #5583 (c5fcc70) into main (2db28f0) will increase coverage by 0.06%.
The diff coverage is 80.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5583      +/-   ##
==========================================
+ Coverage   87.60%   87.66%   +0.06%     
==========================================
  Files          76       76              
  Lines       13745    13712      -33     
==========================================
- Hits        12041    12021      -20     
+ Misses       1704     1691      -13     
Impacted Files Coverage Δ
pymc/data.py 83.61% <ø> (ø)
pymc/model.py 85.95% <ø> (ø)
pymc/distributions/timeseries.py 22.89% <33.33%> (+0.53%) ⬆️
pymc/distributions/continuous.py 98.07% <100.00%> (+0.84%) ⬆️
pymc/distributions/mixture.py 94.73% <100.00%> (+1.59%) ⬆️
pymc/parallel_sampling.py 86.71% <0.00%> (-1.00%) ⬇️

@purna135
Copy link
Member Author

Should I replace sd with sigma in the test which are calling any function with sd arguments?

@canyon289
Copy link
Member

Should I replace sd with sigma in the test which are calling any function with sd arguments?

Yes please, totally eliminate it from the codebase

@purna135
Copy link
Member Author

totally eliminate it from the codebase

Do you mean, the complete test function which are using sd parameter ?

@ricardoV94
Copy link
Member

ricardoV94 commented Mar 11, 2022

totally eliminate it from the codebase

Do you mean, the complete test function which are using sd parameter ?

No. Keep the function, just rename it to sigma as you first suggested.

@purna135
Copy link
Member Author

Hello, I'm having trouble understanding what these lines below are doing:

sigma_in_1 = pm.HalfNormal("sd_in_1", 1)
mu_in_2 = pm.Normal("mu_in_2", 0, 2)
sigma_in_2 = pm.HalfNormal("sd__in_2", 1)

"sd,size",
[
(2.5, 2),
(5.0, (2, 3)),
(np.ones(3) * 10.0, (4, 3)),
],

@ricardoV94
Copy link
Member

Hello, I'm having trouble understanding what these lines below are doing:

sigma_in_1 = pm.HalfNormal("sd_in_1", 1)
mu_in_2 = pm.Normal("mu_in_2", 0, 2)
sigma_in_2 = pm.HalfNormal("sd__in_2", 1)

That one does not seem to involve the sd kwarg. Is it failing or are you asking because the variable has sd in the name? If it's passing you can leave as is.

"sd,size",
[
(2.5, 2),
(5.0, (2, 3)),
(np.ones(3) * 10.0, (4, 3)),
],

That one you need to change that dict to havesigma as a key instead of sd. I guess in the function that's called the dictionary is unpacked as kwargs like Halfnormal(**{"sigma": 2})

@purna135
Copy link
Member Author

purna135 commented Mar 14, 2022

Hi @ricardoV94, @canyon289,

Running pytest takes an excessive amount of time.
I ran the pytest 24 hours ago and it's still at 98 percent.

Is it possible to do a quick test on local system before pushing to github to see if there are any errors?

@ricardoV94
Copy link
Member

Hi @ricardoV94, @canyon289,

Running pytest takes an excessive amount of time. I ran the pytest 24 hours ago and it's still at 98 percent.

Is it possible to do a quick test on local system before pushing to github to see if there are any errors?

You shouldn't try to run the entire test suite on your local machine. Usually only tests that you added or that you know are directly related to changes you've made.

@purna135
Copy link
Member Author

purna135 commented Mar 14, 2022

Hi @ricardoV94, I only fixed the errors I was getting the previous time, and it passed all of the tests this time.

However, I can still find some tests/methods/notebooks that use sd, for example:

pm.Normal("size64", mu=0, sd=1, size=size64, observed=obs)
pm.Normal("shape64", mu=0, sd=1, shape=size64, observed=obs)
model.logp()
pm.Normal("size_cast64", mu=0, sd=1, size=cast64, observed=obs)
pm.Normal("shape_cast64", mu=0, sd=1, shape=cast64, observed=obs)

https://github.com/pymc-devs/pymc/blob/main/docs/source/learn/examples/dimensionality.ipynb
Screenshot from 2022-03-14 17-38-21

Should I rename them to sigma as well ?

@ricardoV94
Copy link
Member

Should I rename them to sigma as well ?

Yes 👍

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@purna135
Copy link
Member Author

Hello, @ricardoV94! I believe I am finished; please take a look.
How to resolve this conflicts ?

@twiecki
Copy link
Member

twiecki commented Mar 15, 2022

Release notes

@purna135
Copy link
Member Author

Release notes

Yes, the release note mentions sd but I assumed it would be handled by the Member. Is it possible for me to make changes to that?

@twiecki
Copy link
Member

twiecki commented Mar 16, 2022 via email

@purna135
Copy link
Member Author

Under the Deprecations header for PyMC vNext, I'll add a point like "In favour of sigma, the deprecated sd has been removed.", right?

@twiecki
Copy link
Member

twiecki commented Mar 17, 2022

Yes, exactly.

@ricardoV94 ricardoV94 changed the title [WIP] Remove sd optional kwarg from distributions Remove sd optional kwarg from distributions Mar 17, 2022
@purna135
Copy link
Member Author

Done 😃, I believe it's finished now.

RELEASE-NOTES.md Outdated Show resolved Hide resolved
@purna135
Copy link
Member Author

Is there anything I can do to resolve this conflict?

@ricardoV94
Copy link
Member

Is there anything I can do to resolve this conflict?

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line

@ricardoV94 ricardoV94 merged commit e8c07ef into pymc-devs:main Mar 18, 2022
@ricardoV94
Copy link
Member

Thanks @purna135!

@purna135
Copy link
Member Author

Thanks for this opportunity ☺️

@purna135 purna135 deleted the remove_sd branch March 18, 2022 11:13
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.

Remove sd optional kwarg from distributions
4 participants