Skip to content

REF: strictness/simplification in DatetimeArray/Index _simple_new #23431

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 3 commits into from
Nov 2, 2018

Conversation

jbrockmendel
Copy link
Member

Broken off of #23426. The edits to DatetimeIndex._simple_new go beyond what is done there.

@pep8speaks
Copy link

Hello @jbrockmendel! Thanks for submitting the PR.

@gfyoung gfyoung added Refactor Internal refactoring of code API Design Clean Datetime Datetime data dtype and removed Clean labels Oct 31, 2018
assert isinstance(values, np.ndarray), "values is not an np.ndarray"
assert is_datetime64_dtype(values)
# DatetimeArray._simple_new will accept either i8 or M8[ns] dtypes
assert isinstance(values, np.ndarray), type(values)
Copy link
Member

@gfyoung gfyoung Oct 31, 2018

Choose a reason for hiding this comment

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

Same questions for all your assert statements:

  • Are these internal? If not, it would be nice to have user-friendly error messages.
  • Can these assert statements be tested in any way?

@codecov
Copy link

codecov bot commented Oct 31, 2018

Codecov Report

Merging #23431 into master will increase coverage by <.01%.
The diff coverage is 96.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23431      +/-   ##
==========================================
+ Coverage   92.21%   92.22%   +<.01%     
==========================================
  Files         161      161              
  Lines       51173    51174       +1     
==========================================
+ Hits        47190    47196       +6     
+ Misses       3983     3978       -5
Flag Coverage Δ
#multiple 90.66% <96.55%> (ø) ⬆️
#single 42.23% <58.62%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/period.py 92.15% <100%> (ø) ⬆️
pandas/core/indexes/datetimes.py 96.4% <100%> (-0.04%) ⬇️
pandas/core/arrays/datetimes.py 98.84% <100%> (+0.94%) ⬆️
pandas/core/indexes/base.py 96.46% <80%> (-0.16%) ⬇️
pandas/core/indexes/range.py 96.99% <0%> (+1.2%) ⬆️

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 de39bfc...17d7600. Read the comment docs.

@jbrockmendel
Copy link
Member Author

This (and to a lesser extent #23430) is turning into a blocker for work on DatetimeArray.

(its easy to re-implement this in that branch, but still)

@jreback jreback added this to the 0.24.0 milestone Nov 2, 2018
@jreback jreback merged commit 53831e0 into pandas-dev:master Nov 2, 2018
@jreback
Copy link
Contributor

jreback commented Nov 2, 2018

thanks

@jbrockmendel jbrockmendel deleted the simple3 branch November 2, 2018 15:00
thoo added a commit to thoo/pandas that referenced this pull request Nov 3, 2018
…xamples

* repo_org/master: (66 commits)
  CLN: doc string (pandas-dev#23469)
  DOC: Add cookbook entry for triangular correlation matrix (GH22840) (pandas-dev#23032)
  add number of Errors, Warnings to scripts/validate_docstrings.py (pandas-dev#23150)
  BUG: Allow freq conversion from dt64 to period (pandas-dev#23460)
  ENH: Add FrozenList.union and .difference (pandas-dev#23394)
  REF: cython cleanup, typing, optimizations (pandas-dev#23464)
  strictness and checks for Timedelta _simple_new (pandas-dev#23433)
  Fixing flake8 problems new to flake8 3.6.0 (pandas-dev#23472)
  DOC: Updating the docstring of Series.dot  (pandas-dev#22890)
  TST: Fixturize series/test_analytics.py (pandas-dev#22755)
  BUG/ENH: Handle NonexistentTimeError in date rounding (pandas-dev#23406)
  PERF: speed up concat on Series by making _get_axis_number() a classmethod (pandas-dev#23404)
  REF: Remove DatetimelikeArrayMixin._shallow_copy (pandas-dev#23430)
  REF: strictness/simplification in DatetimeArray/Index _simple_new (pandas-dev#23431)
  REF: cython cleanup, typing, optimizations (pandas-dev#23456)
  TST: tweak Hypothesis configuration and idioms (pandas-dev#23441)
  BUG: fix HDFStore.append with all empty strings error (GH12242) (pandas-dev#23435)
  TST: Skip 32bit failing IntervalTree tests (pandas-dev#23442)
  BUG: Deprecate nthreads argument (pandas-dev#23112)
  style: fix import format at pandas/core/reshape (pandas-dev#23387)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Datetime Datetime data dtype Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants