Skip to content

Bring back logps #6272

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

Merged
merged 4 commits into from
Nov 20, 2022
Merged

Bring back logps #6272

merged 4 commits into from
Nov 20, 2022

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Nov 7, 2022

This PR brings back univariate continuous logp methods that had been moved to Aeppl

I also removed all old logp/logcdf docstrings. They were both wrong and too cumbersome to update. Will do in a separate PR

Closes #5329

Major / Breaking Changes

  • ...

Bugfixes / New features

  • ...

Docs / Maintenance

  • Remove old logp and logcdf docstrings

@ricardoV94 ricardoV94 force-pushed the bring_back_logp branch 3 times, most recently from fd9a6f5 to aefb017 Compare November 7, 2022 16:33
@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Merging #6272 (b95d30c) into main (cb37afa) will increase coverage by 3.86%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6272      +/-   ##
==========================================
+ Coverage   90.39%   94.25%   +3.86%     
==========================================
  Files         111      111              
  Lines       23869    23930      +61     
==========================================
+ Hits        21577    22556     +979     
+ Misses       2292     1374     -918     
Impacted Files Coverage Δ
pymc/distributions/continuous.py 97.84% <100.00%> (+0.33%) ⬆️
pymc/distributions/discrete.py 99.22% <100.00%> (ø)
pymc/distributions/multivariate.py 92.28% <100.00%> (ø)
pymc/tests/distributions/test_continuous.py 99.76% <100.00%> (+<0.01%) ⬆️
pymc/aesaraf.py 94.62% <0.00%> (-0.25%) ⬇️
pymc/distributions/shape_utils.py 97.87% <0.00%> (+0.42%) ⬆️
pymc/sampling/parallel.py 88.81% <0.00%> (+1.04%) ⬆️
pymc/distributions/logprob.py 67.28% <0.00%> (+5.55%) ⬆️
pymc/step_methods/hmc/quadpotential.py 80.62% <0.00%> (+6.77%) ⬆️
pymc/model_graph.py 78.82% <0.00%> (+12.35%) ⬆️
... and 3 more

@ricardoV94 ricardoV94 force-pushed the bring_back_logp branch 2 times, most recently from 2c83bcc to db4f688 Compare November 8, 2022 10:15
@rlouf
Copy link
Contributor

rlouf commented Nov 8, 2022

I am curious to see how you are going to do attribution here since you're breaking Git history. In AePPL history this seems to come from this commit by Brandon, who is not a PyMC member.

@ricardoV94
Copy link
Member Author

I am curious to see how you are going to do attribution here since you're breaking Git history. In AePPL history this seems to come from this commit by Brandon, who is not a PyMC member.

Good question. In this specific case I don't see any issues. There was a previous PR that removed all the logp methods involved in this PR towards Aeppl, and no questions of attribution or git history were raised then: #4887

For future PRs, do you have any suggestion? A non-inconsequent portion of the Aeppl code was originally developed in PyMC and moved to Aeppl for unclear reasons.

@@ -1898,19 +1714,6 @@ def moment(rv, size, nu, mu, sigma):
return mu

def logp(value, nu, mu, sigma):
"""
Copy link
Member Author

@ricardoV94 ricardoV94 Nov 8, 2022

Choose a reason for hiding this comment

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

Because they were wrong since V4 began, and it's not supposed to be a user-facing method anyway

@canyon289
Copy link
Member

@ricardoV94 git is being a bit flaky for me, i understand why the comments are removed! you had mentioned it at in the PR body which I missed my apologies!

@brandonwillard
Copy link
Contributor

brandonwillard commented Nov 8, 2022

Interesting that you've unnecessarily decided on an approach to all this that removes the original Git history of the material you're taking, especially since you've already forked AePPL itself. Was that intended or do you have some sort of excuse for doing things this way?

Good question. In this specific case I don't see any issues. There was a previous PR that removed all the logp methods involved in this PR towards Aeppl, and no questions of attribution or git history were raised then: #4887

For future PRs, do you have any suggestion? A non-inconsequent portion of the Aeppl code was originally developed in PyMC and moved to Aeppl for unclear reasons.

Wow, that's a bold and curiously aggressive and unbacked claim with some very overtly negative implications about me and everyone else who worked on that material across both AePPL and PyMC. Please, demonstrate to us exactly where attribution in AePPL was appropriate and missing. Don't forget to check who originally wrote the code that was moved!

Copy link
Member

@canyon289 canyon289 left a comment

Choose a reason for hiding this comment

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

My 2 cents readd the docstrings from dropped in d34b557b5e0a0806842e2d4ec5aa5a842dbf8dfe for two reasons

  1. Even though theyre stale they contain some useful information such as on here. https://github.com/pymc-devs/pymc/pull/6272/files#diff-9ac5fc2380425e161c832a41b1a173cac7693410b99e9c746d39507d96a8d357L1024-L1042

  2. To update them its a great issue for beginners, and its simpler for beginners to start with an existing docstring and modify than start one from scratch

Per slack convo

  • Keeping them is bad because they're stale
  • When new logps get added they wont have docstrings so things will be inconsistent
  • We could autogenerate them

One question about autogeneration in this example here for instance, how would an autogenerated docstring tell us what the parameters good and bad mean? If I was a developer working on this in the future where would I get this information of what these mean?

https://github.com/pymc-devs/pymc/pull/6272/files#diff-9ac5fc2380425e161c832a41b1a173cac7693410b99e9c746d39507d96a8d357L1025-L1042

@canyon289
Copy link
Member

@brandonwillard @rlouf in all sincerity I appreciate you bringing up these concerns. I think there's low probability that any sort of understanding will be reached on this PR. Given that is another mode of discussion possible? Happy with whatever your suggestion is.

@twiecki
Copy link
Member

twiecki commented Nov 8, 2022

@brandonwillard @rlouf How about we add you as co-authors on the commits?

@rlouf
Copy link
Contributor

rlouf commented Nov 8, 2022

@twiecki I appreciate the offer, but for one I wouldn't want to be credited for a piece of code I didn't write. I looked around and found this answer very helpful: https://opensource.stackexchange.com/questions/11631/how-to-properly-attribute-others-people-work-on-github

@twiecki
Copy link
Member

twiecki commented Nov 8, 2022

@rlouf Thanks, that's helpful. Yeah, let's find out the best way of including that in the copyright and license information. There are already some similar references there, e.g. https://github.com/aesara-devs/aesara/blob/main/doc/LICENSE.txt#L11

@brandonwillard Let me know if you want to be co-authored on the commits in addition to the above, or what you think the appropriate way of attributioning is.

@rlouf
Copy link
Contributor

rlouf commented Nov 8, 2022

@rlouf Thanks, that's helpful. Yeah, let's find out the best way of including that in the copyright and license information. There are already some similar references there, e.g. https://github.com/aesara-devs/aesara/blob/main/doc/LICENSE.txt#L11

Building upon other people's work instead of copy/pasting avoids all this hassle. The full git history is kept and attribution is simple. The file you're pointing to is an excellent example: https://github.com/aesara-devs/aesara/commits/main/doc/LICENSE.txt

Copyright (c) 2009-2017 The PyMC developers (see contributors to pymc-devs on GitHub)
Copyright (c) 2009-2022 The PyMC developers (see contributors to pymc-devs on GitHub)

Contains code from Aeppl, Copyright (c) 2021-2022, Aesara Developers
Copy link
Member

Choose a reason for hiding this comment

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

@rlouf @brandonwillard Are you happy with this?

@@ -6,7 +6,10 @@ PyMC is distributed under the Apache License, Version 2.0

Copyright (c) 2006 Christopher J. Fonnesbeck (Academic Free License)
Copyright (c) 2007-2008 Christopher J. Fonnesbeck, Anand Prabhakar Patil, David Huard (Academic Free License)
Copyright (c) 2009-2017 The PyMC developers (see contributors to pymc-devs on GitHub)
Copyright (c) 2009-2022 The PyMC developers (see contributors to pymc-devs on GitHub)
Copy link
Member

Choose a reason for hiding this comment

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

while we are editing this, this copyright sentence should not have end date

Copy link
Member Author

@ricardoV94 ricardoV94 Nov 9, 2022

Choose a reason for hiding this comment

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

How should it be?

  • Copyright (c) 2009 The PyMC developers (see contributors to pymc-devs on GitHub)
  • Copyright (c) 2009- The PyMC developers (see contributors to pymc-devs on GitHub)
  • Copyright (c) 2009-present The PyMC developers (see contributors to pymc-devs on GitHub)

Or something else?

Copy link
Member

Choose a reason for hiding this comment

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

I like the 2009-present version most

Copy link
Member

@michaelosthege michaelosthege Nov 9, 2022

Choose a reason for hiding this comment

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

@ricardoV94 @OriolAbril, let's fix the dates later, because then "while we're at it" we can update it in all places

for all intents and purposes of this PR it's ready to merge now that the attribution part has been taken care of

@@ -6,7 +6,10 @@ PyMC is distributed under the Apache License, Version 2.0

Copyright (c) 2006 Christopher J. Fonnesbeck (Academic Free License)
Copyright (c) 2007-2008 Christopher J. Fonnesbeck, Anand Prabhakar Patil, David Huard (Academic Free License)
Copyright (c) 2009-2017 The PyMC developers (see contributors to pymc-devs on GitHub)
Copyright (c) 2009-2022 The PyMC developers (see contributors to pymc-devs on GitHub)
Copy link
Member

@michaelosthege michaelosthege Nov 9, 2022

Choose a reason for hiding this comment

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

@ricardoV94 @OriolAbril, let's fix the dates later, because then "while we're at it" we can update it in all places

for all intents and purposes of this PR it's ready to merge now that the attribution part has been taken care of

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.

Add AePPL logp/logcdf references for all Distributions that are missing them
7 participants