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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

num2pydate #172

Merged
merged 11 commits into from Jun 22, 2021
Merged

num2pydate #172

merged 11 commits into from Jun 22, 2021

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Jun 9, 2021

馃殌 Pull Request

Hopefully a simple one!

Description

This PR exposes cftime's only_use_python_datetimes keyword in our num2date function and method. Also adds a convenience num2pydate function and method following cftime's num2pydate. This should make life easier for users who work exclusively with the standard calendar.

I couldn't find any existing tests for the num2date utility function, so added a new module. I've kept the new tests pretty minimal as they are really just checking that the args have been passed correctly to the next function down.

cf_units/tests/integration/test_num2date.py Outdated Show resolved Hide resolved
cf_units/tests/integration/test_num2date.py Outdated Show resolved Hide resolved
cf_units/tests/integration/test_num2pydate.py Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jun 9, 2021

Coverage Status

Coverage increased (+0.03%) to 91.651% when pulling dd42cf6 on rcomer:num2pydate into cc459a7 on SciTools:master.

@rcomer rcomer added this to the v3.0.0 milestone Jun 9, 2021
@rcomer
Copy link
Member Author

rcomer commented Jun 9, 2021

I'd like to get this into v3 if practicable, since users who might want it will likely have to update their num2date calls at v3 anyway.

@codecov
Copy link

codecov bot commented Jun 15, 2021

Codecov Report

Merging #172 (4314ae5) into master (0ca0921) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   90.59%   90.63%   +0.04%     
==========================================
  Files           7        7              
  Lines         829      833       +4     
  Branches      105      105              
==========================================
+ Hits          751      755       +4     
  Misses         64       64              
  Partials       14       14              
Impacted Files Coverage 螖
cf_units/__init__.py 89.58% <100.00%> (+0.08%) 猬嗭笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 0ca0921...4314ae5. Read the comment docs.

Copy link
Collaborator

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Great idea @rcomer, just a tiny change for you...

doc/source/utilities.rst Show resolved Hide resolved
@trexfeathers
Copy link
Collaborator

The pre-commit.ci failure is expected since I've activated it for this repo but the config file is still waiting in another PR.

@rcomer
Copy link
Member Author

rcomer commented Jun 21, 2021

Thanks @trexfeathers, I have made that change and also updated the license headers on the new test modules to the new style. I assume the pre-commit failure just means I need to rebase again once #179 is merged?

Edit: "jinx!"

@trexfeathers
Copy link
Collaborator

OK @rcomer, I promise to not make any more conflicting changes to the code base. If you can rebase one last time, this is the next PR to go in!

@rcomer
Copy link
Member Author

rcomer commented Jun 22, 2021

Thanks @trexfeathers! I have now rebased, blackened my changes and fixed some offending imports that were in the wrong order.

@trexfeathers trexfeathers merged commit e22e45c into SciTools:master Jun 22, 2021
@rcomer rcomer deleted the num2pydate branch June 22, 2021 10:08
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.

None yet

4 participants