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

Wrong dtype of return in date2num #202

Closed
zklaus opened this issue Oct 27, 2021 · 2 comments · Fixed by #467 or #483
Closed

Wrong dtype of return in date2num #202

zklaus opened this issue Oct 27, 2021 · 2 comments · Fixed by #467 or #483
Assignees
Labels
community Good First Issue A good issue to take on if you're just getting started with cf-units development New: Documentation Highlight a new community raised "documentation" issue Type: Documentation

Comments

@zklaus
Copy link

zklaus commented Oct 27, 2021

📚 Documentation

The documentation for cf_units.Unit.date2num and cf_units.date2num stipulates that both functions return a float, or numpy.ndarray of floats. However, since the return value comes directly from cftime.date2num, this will regularly return "an array of integers" since cftime version 1.4.0 (see the changelog).

@zklaus zklaus added New: Documentation Highlight a new community raised "documentation" issue Type: Documentation labels Oct 27, 2021
@rcomer rcomer added the Good First Issue A good issue to take on if you're just getting started with cf-units development label Oct 31, 2021
@rcomer rcomer mentioned this issue May 26, 2022
@scitools-ci scitools-ci bot removed this from 🚴 Peloton Dec 15, 2023
@pp-mo pp-mo assigned ukmo-ccbunney and pp-mo and unassigned ukmo-ccbunney and pp-mo Sep 20, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Autumn 2024 cf-units Sep 24, 2024
@pp-mo pp-mo reopened this Sep 24, 2024
@pp-mo
Copy link
Member

pp-mo commented Sep 24, 2024

Re-opened

I just realised that in addition to Unit.date2num(dates), we also have a cf_units.date2num(dates, unit, calendar),
which is basically a different package for the same behaviours.

So unfortunately I think that docstring needs updating too.

and... we really need a whatsnew entry for these changes, too.
Sorry @ukmo-ccbunney I was so enthusiastic about #467 that I seem to have failed to review carefully !

@ukmo-ccbunney
Copy link
Contributor

Fixed by #483

@github-project-automation github-project-automation bot moved this from In review to Done in Autumn 2024 cf-units Sep 26, 2024
@scitools-ci scitools-ci bot removed this from 🚴 Peloton Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Good First Issue A good issue to take on if you're just getting started with cf-units development New: Documentation Highlight a new community raised "documentation" issue Type: Documentation
Projects
No open projects
Status: Done
4 participants