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

[DOCS] Updated docstring for date2num #467

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

ukmo-ccbunney
Copy link
Contributor

🚀 Pull Request

The underlying cftime package will now preferentially return an integer rather than a float if if encoded datetime(s) can be expressed exactly as an integer.

Description

Docstring for num2date updated to reflect this underlying change in behaviour.
Extra example added showing outputs of type integer where encoded allows.

Fixes: #202

Change in cfunits mean it will now preferentially return an integer
rather than a float if if encoded datetime(s) can be expressed exactly using ints.
Copy link
Member

@pp-mo pp-mo left a comment

Choose a reason for hiding this comment

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

👍 aced it !
🎯

@pp-mo pp-mo merged commit 0ba8231 into SciTools:main Sep 24, 2024
14 checks passed
@pp-mo pp-mo mentioned this pull request Sep 24, 2024
@pp-mo pp-mo changed the title [DOCS] Updated docstring for num2date [DOCS] Updated docstring for date2num Sep 24, 2024
pp-mo pushed a commit that referenced this pull request Sep 24, 2024
@ukmo-ccbunney ukmo-ccbunney deleted the docs/date2num_return_type branch September 26, 2024 12:57
stephenworsley added a commit to stephenworsley/cf-units that referenced this pull request Sep 27, 2024
* main:
  [DOCS] Update docstring for date2num (module function) (SciTools#483)
  Modernise setup scripts (SciTools#484)
  Make antlr optional (SciTools#423)
  Ruff: smaller steps (SciTools#364)
  Updated docstring for num2date. (SciTools#467)
  updated conda lock files (SciTools#479)
  Revert to 00:03 Mondays for lockfile updates. (SciTools#480)
  New trigger time for GMT. (SciTools#478)
  Check lockfile updates @ 3pm daily (temporary for testing). (SciTools#477)
  Fixlocks (SciTools#470)

# Conflicts:
#	pyproject.toml
#	requirements/cf-units.yml
#	requirements/locks/py310-lock-linux-64.txt
#	requirements/locks/py310-lock-osx-64.txt
#	requirements/locks/py310-lock-win-64.txt
#	requirements/locks/py311-lock-linux-64.txt
#	requirements/locks/py311-lock-osx-64.txt
#	requirements/locks/py311-lock-win-64.txt
#	requirements/locks/py312-lock-linux-64.txt
#	requirements/locks/py312-lock-osx-64.txt
#	requirements/locks/py312-lock-win-64.txt
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.

Wrong dtype of return in date2num
2 participants