Skip to content

ENH/BUG: improve support for pathlib.Path inputs in iers#16931

Merged
mhvk merged 2 commits intoastropy:mainfrom
neutrinoceros:utils.iers/enh/14893/improve_support_for_path_objects
Sep 5, 2024
Merged

ENH/BUG: improve support for pathlib.Path inputs in iers#16931
mhvk merged 2 commits intoastropy:mainfrom
neutrinoceros:utils.iers/enh/14893/improve_support_for_path_objects

Conversation

@neutrinoceros
Copy link
Contributor

@neutrinoceros neutrinoceros commented Sep 4, 2024

Description

Ref: #14893

fixes #16929

This relieves a specific pain point I encountered while working on #16928, and participates to unblock it.

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

TODO:

  • add a test

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2024

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 instructions for rebase and squash.
  • 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?
  • 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
Copy link
Contributor

github-actions bot commented Sep 4, 2024

👋 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?

@neutrinoceros neutrinoceros force-pushed the utils.iers/enh/14893/improve_support_for_path_objects branch from 9aea4d1 to 86be650 Compare September 4, 2024 07:18
@neutrinoceros neutrinoceros changed the title ENH: add support for reading IERS_A/B from pathlib.Path objects ENH: add support for reading IERS_A/B from pathlib.Path objects Sep 4, 2024
@pllim pllim added this to the v7.0.0 milestone Sep 4, 2024
@pllim pllim requested review from astrofrog and mhvk September 4, 2024 18:13
@pllim
Copy link
Member

pllim commented Sep 4, 2024

This might naturally fix #16929 also but you should confirm.

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

This looks good, thanks! I do think we should have at least one test - fine to adjust one of the existing ones to pass in a path instead of a string.

@neutrinoceros
Copy link
Contributor Author

This might naturally fix #16929 also but you should confirm.

just checked, and it doesn't.

@neutrinoceros
Copy link
Contributor Author

... but now it does ! The fix is actually orthogonal to the initial goal of this PR but it indeed felt related enough to be bundled with it. Let me know if you'd like me to split the PR instead.

@neutrinoceros neutrinoceros changed the title ENH: add support for reading IERS_A/B from pathlib.Path objects ENH/BUG: improve support for pathlib.Path inputs in iers Sep 5, 2024
@neutrinoceros neutrinoceros force-pushed the utils.iers/enh/14893/improve_support_for_path_objects branch from 6aa2f29 to 6e3c04a Compare September 5, 2024 09:22
@neutrinoceros
Copy link
Contributor Author

fine to adjust one of the existing ones to pass in a path instead of a string.

done ! I parametrized the only existing test using IERS_B.read directly.

@neutrinoceros neutrinoceros marked this pull request as ready for review September 5, 2024 09:24
@neutrinoceros neutrinoceros force-pushed the utils.iers/enh/14893/improve_support_for_path_objects branch from 6e3c04a to c1941ad Compare September 5, 2024 09:37
Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

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

This seems ok to me - thanks!

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

Super, great that you could fix the leap seconds too!

@mhvk mhvk merged commit 839363b into astropy:main Sep 5, 2024
@neutrinoceros neutrinoceros deleted the utils.iers/enh/14893/improve_support_for_path_objects branch September 5, 2024 13:55
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.

BUG: astropy.time.update_leap_seconds doesn't warn for corrupt files passed as pathlib.Path objects

4 participants