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

Allow ud_convert() to work with class "difftime" (fix for #3012) #3168

Merged
merged 10 commits into from
Jun 8, 2023

Conversation

Aariq
Copy link
Collaborator

@Aariq Aariq commented May 16, 2023

Description

Fixes #3012 . Checks if argument x is difftime, and if it is converts it to a units object with as_units(). Units are inferred from the class, so argument u1 isn't actually used in the conversion in this case. UI is a little weird here, but seems like this is mostly an internal function so probably better than adding argument defaults and allowing u1 to be NULL or something like that.

Motivation and Context

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Aariq Aariq requested a review from infotroph May 16, 2023 19:36
Copy link
Member

@dlebauer dlebauer left a comment

Choose a reason for hiding this comment

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

Looks great- just make sure to update the change log!

@Aariq
Copy link
Collaborator Author

Aariq commented May 17, 2023

Looks great- just make sure to update the change log!

I can do this, but I'll just point out that the changelog already includes a bullet about this function being re-factored for this version. This bug was an unforseen side-effect of that refactoring

@Aariq Aariq requested a review from dlebauer May 17, 2023 18:56
@Aariq Aariq added the bug fix label May 25, 2023
@mdietze mdietze enabled auto-merge June 6, 2023 15:34
@mdietze mdietze dismissed dlebauer’s stale review June 8, 2023 15:09

changes addressed

@mdietze mdietze added this pull request to the merge queue Jun 8, 2023
Merged via the queue into develop with commit eb8ff8d Jun 8, 2023
@Aariq Aariq deleted the fix-3012 branch June 8, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

units::set_units cannot work with class "difftime"
4 participants