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

BUG: Return of _logpmf #4049

Closed
wants to merge 3 commits into from
Closed

BUG: Return of _logpmf #4049

wants to merge 3 commits into from

Conversation

helderc
Copy link
Contributor

@helderc helderc commented Oct 3, 2014

This fixes the bug mentioned in #4029

@ev-br
Copy link
Member

ev-br commented Oct 3, 2014

This also needs tests.

@ev-br ev-br added scipy.stats needs-work Items that are pending response from the author labels Oct 3, 2014
@helderc
Copy link
Contributor Author

helderc commented Oct 3, 2014

Guys, I did the regression test.
But how can I merge all these commits in only one?

@helderc
Copy link
Contributor Author

helderc commented Oct 4, 2014

@argriffing I corrected that in other commit... I'm very confusing in use git... sorry I'm doing a mess...

@@ -238,6 +238,9 @@ def test_pmf(self):
# regression test for ticket 1779
assert_allclose(np.exp(stats.nbinom.logpmf(700, 721, 0.52)),
stats.nbinom.pmf(700, 721, 0.52))
# regression test for ticjet 4029
Copy link
Member

Choose a reason for hiding this comment

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

Although I see it was also done above, just referencing the ticket number isn't really a helpful comment. If you think it needs a comment, something more like "logpmf(0,1,1) shouldn't return nan". Or anything that describes the edge case the test is guarding would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ewmoore I updated that comment and merge all commits in just one. But I cant send the code to update this pull request... Can you help me?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's something to do with your patch-1 branch vs. your master branch. This PR knows only about your patch-1 scipy branch and I think your last commit was to only your master scipy branch.

Copy link
Member

Choose a reason for hiding this comment

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

Do you just need to force push? (Note the -f).

git push -f https://github.com/helderc/scipy.git patch-1

I wrote the rest of this without reading your post carefully enough. I'm going to leave it here, even though it sounds like you've gotten most of it sorted out already yourself. Thanks for sticking with it through all of this. I know it can be discouraging when contributing seems to require endless fighting with the tools rather than working on the code.


I think @argriffing is right. It I can see the spelling change commit under your master branch on github. What has your work flow looked like? Generally speaking the master branch in your repository isn't a useful thing. What I do tends to look like this:

  1. Create a clone of my scipy repository
    git clone https://github.com/ewmoore/scipy.git
  2. Add the main scipy repository as a remote
    git remote add upstream https://github.com/scipy/scipy.git
  3. Create a feature branch that tracks the master branch of the main scipy repository.
    git branch feature_name upstream/master
  4. Work, create commits, generally small and not necessarily fit for upstream
    git add ...
    git commit
  5. Rework commits with git commit --amend to fix up the last commit or
    git rebase --interactive upstream/master
    to fix up and squash a series of commits.
  6. Push my changes to github
    git push https://github.com/ewmoore/scipy.git feature_name
    Ad this point, you can create your pull request, etc on github.
  7. If you need add a commit you can just do steps 4 and 6. If you need to change something but want to keep it a single commit, you'll have to rewrite the history, step 5 and then force push to the same branch, that is use
    git push -f https://github.com/ewmoore/scipy.git feature_name (note the -f here vs. in 6. above.) The force push is necessary because you are replacing the contents of the branch on github rather than adding commits to them.

Note that in all of this the master branch in my scipy repository is not used.

It looks to me as though you've somehow made all but the last change to both your patch-1 branch and your master branch. This spelling change appears to have been committed to only the master branch. Perhaps you had the wrong branch checked out when you made the commit?

@rgommers rgommers added this to the 0.15.0 milestone Nov 22, 2014
rgommers added a commit that referenced this pull request Nov 22, 2014
@rgommers
Copy link
Member

Thanks @helderc. Squashed and merged in fc6b387. Included change in comment suggested by @ewmoore

@ev-br
Copy link
Member

ev-br commented Dec 29, 2014

@ewmoore very nice git workflow write-up. Care to add it somewhere more easily discoverable (hacking.rst?)

@ewmoore
Copy link
Member

ewmoore commented Dec 29, 2014

I can look at doing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-work Items that are pending response from the author scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants