Skip to content

Implement tslibs.__init__, move easy bits of tslib #21738

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

Merged
merged 4 commits into from
Jul 5, 2018

Conversation

jbrockmendel
Copy link
Member

Easy answers to where tslib.ints_to_pytimedelta and tslib.normalize_date belong, so this moves those.

Starts populating the tslibs.__init__ namespace; leaves updating imports for later.

Cleans up a couple of unnecessary imports elsewhere.

@gfyoung gfyoung added Internals Related to non-user accessible pandas implementation Clean Datetime Datetime data dtype Timedelta Timedelta data type labels Jul 5, 2018
@codecov
Copy link

codecov bot commented Jul 5, 2018

Codecov Report

Merging #21738 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21738      +/-   ##
==========================================
+ Coverage   91.92%   91.92%   +<.01%     
==========================================
  Files         158      159       +1     
  Lines       49705    49708       +3     
==========================================
+ Hits        45693    45696       +3     
  Misses       4012     4012
Flag Coverage Δ
#multiple 90.3% <100%> (ø) ⬆️
#single 42% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/generic.py 96.21% <ø> (-0.01%) ⬇️
pandas/_libs/tslibs/__init__.py 100% <100%> (ø)

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 1070976...94239a0. Read the comment docs.

# flake8: noqa

from .conversion import normalize_date, localize_pydatetime, tz_convert_single
from .nattype import NaT, iNaT
Copy link
Contributor

Choose a reason for hiding this comment

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

next PR should have a test that exercises what is in this API, name it test_api.py and check that the namespace is locked down)

@@ -1025,6 +1025,35 @@ cdef inline str _render_tstamp(int64_t val):
# ----------------------------------------------------------------------
# Normalization


def normalize_date(object dt):
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

we ought to fix these names (prob rename date_normalize) in future PR

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

going to merge, but pls followup the comments in next PR


Returns
-------
normalized : datetime.datetime or Timestamp
Copy link
Contributor

Choose a reason for hiding this comment

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

add a raises section

@jreback jreback added this to the 0.24.0 milestone Jul 5, 2018
@jreback jreback merged commit 9b24770 into pandas-dev:master Jul 5, 2018
@jbrockmendel jbrockmendel deleted the norm branch July 6, 2018 14:04
@jbrockmendel jbrockmendel mentioned this pull request Jul 6, 2018
jreback pushed a commit that referenced this pull request Jul 6, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Datetime Datetime data dtype Internals Related to non-user accessible pandas implementation Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants