Skip to content

fix sign of w0wzCDM inv_efuncs pyx#15049

Merged
pllim merged 3 commits into
astropy:mainfrom
nstarman:cosmo-w0wz-pyx
Aug 23, 2023
Merged

fix sign of w0wzCDM inv_efuncs pyx#15049
pllim merged 3 commits into
astropy:mainfrom
nstarman:cosmo-w0wz-pyx

Conversation

@nstarman

@nstarman nstarman commented Jul 9, 2023

Copy link
Copy Markdown
Member

And update the internal consistency tests.

Fixes #15025

cc @cmarmo

@nstarman nstarman added this to the v5.0.7 milestone Jul 9, 2023
@github-actions

github-actions Bot commented Jul 9, 2023

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see "When to rebase and squash commits".
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • Is a milestone set? Milestone must be set but we cannot check for it on Actions; do not let the green checkmark fool you.
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions

github-actions Bot commented Jul 9, 2023

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@nstarman

nstarman commented Jul 9, 2023

Copy link
Copy Markdown
Member Author

Failure in https://github.com/astropy/astropy/actions/runs/5502061341/jobs/10026067493?pr=15049 is unrelated.
This is a different bug, from how numpy.vectorize handles object arrays, uncovered by fuzzed tests. Opening a separate issue. Opened #15050.

@nstarman nstarman marked this pull request as ready for review July 9, 2023 22:36
@nstarman nstarman requested a review from a team as a code owner July 9, 2023 22:36
@cmarmo

cmarmo commented Jul 10, 2023

Copy link
Copy Markdown
Member

cc @cmarmo

is that an issue with the auto-completion?

@nstarman

Copy link
Copy Markdown
Member Author

cc @cmarmo

is that an issue with the auto-completion?

#15050? I don't believe so. Numpy vectorize is a convenient but not-particularly-efficient for-loop and it can cast to object arrays during the broadcasting. .age isn't very happy about that.

Comment thread astropy/cosmology/flrw/scalar_inv_efuncs.pyx Outdated
@nstarman nstarman requested a review from saimn July 15, 2023 15:07
@nstarman

nstarman commented Jul 19, 2023

Copy link
Copy Markdown
Member Author

On reflection, I'm moving the cdef double to another PR.

@nstarman

Copy link
Copy Markdown
Member Author

@saimn, I moved the cdef double to #15076, is this PR ready?

@saimn

saimn commented Jul 21, 2023

Copy link
Copy Markdown
Contributor

#15076 seems fine, but for this one I have no idea about the sign ;).


>>> cosmo.comoving_distance(0.5)
<Quantity 1982.66012926 Mpc>
<Quantity 1849.74726272 Mpc>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a way to check those numerical values with another package/software ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can test this with Mathematica.
I'll add some tests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Confirmed:
CleanShot 2023-07-22 at 17 05 32@2x

I'll add a test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same example is now a test, with the Mathematica code if this ever needs to be rerun.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ping @saimn.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@saimn, I implemented a test.

@nstarman nstarman Aug 19, 2023

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@pllim, I've checked the calculation (see screenshot in this thread) and implemented a trivial test. I think this is an uncontroversial merge, if you feel comfortable!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please rebase then, the CI should be green by now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@pllim pllim added Affects-dev PRs and issues that do not impact an existing Astropy release skip-changelog-checks Tells bot to skip changlog checks and removed no-changelog-entry-needed labels Jul 24, 2023
@nstarman nstarman force-pushed the cosmo-w0wz-pyx branch 2 times, most recently from edbb4f2 to 8460977 Compare July 30, 2023 20:32
@nstarman nstarman requested a review from saimn July 31, 2023 04:42
@pllim pllim modified the milestones: v5.0.7, v5.0.8 Aug 15, 2023
And update the the internal consistency tests.

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Signed-off-by: nstarman <nstarman@users.noreply.github.com>

@pllim pllim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't grok cosmology but aconley approved, so I am giving the ✔️ by proxy. Thanks!

@pllim pllim merged commit 46df1bb into astropy:main Aug 23, 2023
@lumberbot-app

lumberbot-app Bot commented Aug 23, 2023

Copy link
Copy Markdown

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v5.0.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 46df1bbb31d61fe1d1895f6a05abac5e3c35d39c
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #15049: fix sign of w0wzCDM inv_efuncs pyx'
  1. Push to a named branch:
git push YOURFORK v5.0.x:auto-backport-of-pr-15049-on-v5.0.x
  1. Create a PR against branch v5.0.x, I would have named this PR:

"Backport PR #15049 on branch v5.0.x (fix sign of w0wzCDM inv_efuncs pyx)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@lumberbot-app

lumberbot-app Bot commented Aug 23, 2023

Copy link
Copy Markdown

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v5.3.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 46df1bbb31d61fe1d1895f6a05abac5e3c35d39c
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #15049: fix sign of w0wzCDM inv_efuncs pyx'
  1. Push to a named branch:
git push YOURFORK v5.3.x:auto-backport-of-pr-15049-on-v5.3.x
  1. Create a PR against branch v5.3.x, I would have named this PR:

"Backport PR #15049 on branch v5.3.x (fix sign of w0wzCDM inv_efuncs pyx)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@pllim

pllim commented Aug 23, 2023

Copy link
Copy Markdown
Member

@nstarman , are you willing to do manual backport for both release branches? 🙏

@nstarman nstarman deleted the cosmo-w0wz-pyx branch August 23, 2023 16:40
@nstarman

Copy link
Copy Markdown
Member Author

I can do that. It would be nice if the backport bot could open Issues if a manual backport is required. It would be a better reminder in my inbox. Can that be configured?

@pllim

pllim commented Aug 23, 2023

Copy link
Copy Markdown
Member

I think that is overkill, the backport bot already applies this label that you can check: Still Needs Manual Backport

@nstarman

Copy link
Copy Markdown
Member Author

@pllim, on v5.0.x this changelog entry is deleted, should I keep it deleted?

@pllim

pllim commented Aug 23, 2023

Copy link
Copy Markdown
Member

Oh maybe because it was rendered into CHANGES.rst when bug fix release happened. I suspect same for v5.3.x. Unless @astrofrog or @saimn has a better idea, you will have to recreate the fragment? Or should we create a new fragment but for 15059 ? 🤔

pllim added a commit that referenced this pull request Aug 24, 2023
…v5.0.x

Backport PR #15049 on branch v5.0.x (fix sign of w0wzCDM inv_efuncs pyx)
pllim added a commit that referenced this pull request Aug 24, 2023
…v5.3.x

Backport PR #15049: fix sign of w0wzCDM inv_efuncs pyx (v5.3.x)
@saimn

saimn commented Aug 30, 2023

Copy link
Copy Markdown
Contributor

Sorry for the long time with response, vacation time ;).
Re-changelog: you shouldn't have modified an old changelog entry (for a PR that has been released since)... instead just add a new one for this PR (15049).

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

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release cosmology skip-changelog-checks Tells bot to skip changlog checks

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Possible remaining w0wz de_density_scale problems

5 participants