Skip to content

DOC: Fixes after #17482 #17554

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 1 commit into from
Sep 17, 2017
Merged

DOC: Fixes after #17482 #17554

merged 1 commit into from
Sep 17, 2017

Conversation

jschendel
Copy link
Member

  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

Some doc fixes related to #17482:

@gfyoung gfyoung added the Docs label Sep 15, 2017
@codecov
Copy link

codecov bot commented Sep 16, 2017

Codecov Report

Merging #17554 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17554      +/-   ##
==========================================
- Coverage   91.25%   91.23%   -0.02%     
==========================================
  Files         163      163              
  Lines       49606    49606              
==========================================
- Hits        45266    45257       -9     
- Misses       4340     4349       +9
Flag Coverage Δ
#multiple 89.01% <100%> (ø) ⬆️
#single 40.19% <100%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/datetimes.py 95.53% <ø> (ø) ⬆️
pandas/core/indexes/interval.py 93.57% <ø> (ø) ⬆️
pandas/core/api.py 100% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.77% <0%> (-0.1%) ⬇️

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 328c7e1...72bccc6. Read the comment docs.

@jorisvandenbossche
Copy link
Member

One question for cdate_range is whether we actually want to add this to the top-level API.
Can't you just specify a custom frequency with date_range ?

@jschendel
Copy link
Member Author

@jorisvandenbossche

Yes, cdate_range can be replicated by specifying a custom frequency with date_range; this is essentially what cdate_range does under the hood. The advantage to using cdate_range is purely convenience: the user does not need create a custom frequency, and can instead just use parameters of cdate_range (which aren't valid parameters for date_range).

Really, there's even less of a case for bdate_range; the only difference between bdate_range and date_range is the default value of freq. Seems like both bdate_range and cdate_range could be deprecated fairly easily, if we want to go that route.

@@ -63,7 +63,7 @@ class TestPDApi(Base):
# top-level functions
funcs = ['bdate_range', 'concat', 'crosstab', 'cut',
'date_range', 'interval_range', 'eval',
'factorize', 'get_dummies',
'factorize', 'get_dummies', 'cdate_range',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think cdate_range needs to be in api.rst as well?

Copy link
Member

Choose a reason for hiding this comment

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

that's the issue being solved here: it was already added to api.rst in a previous PR, but wasn't actually yet included in the api

Copy link
Contributor

Choose a reason for hiding this comment

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

ok great

@jreback jreback added this to the 0.21.0 milestone Sep 17, 2017
@jreback jreback merged commit 643fc1e into pandas-dev:master Sep 17, 2017
@jreback
Copy link
Contributor

jreback commented Sep 17, 2017

thanks @jschendel you are very responsive! keep em' coming!

jorisvandenbossche added a commit that referenced this pull request Sep 17, 2017
@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Sep 17, 2017

@jreback we were still discussing this. I am -1 (at this point) on adding this to the API.

@jorisvandenbossche
Copy link
Member

@jschendel Ah, I didn't notice that cdate_range has those extra keywords (I thought it was just the different default frequency, like bdate_range).
You are correct that bdate_range even gives less 'added' value (only the default freq), but I was wondering: can't we just merge the two functions? (I mean adding the functionality of the keywords to bdate_range) As it are both 'business-day'-related functions? Then we don't need to have both in the top-level namespace.

.. warning:: EXPERIMENTAL

The CustomBusinessDay class is not officially supported and the API is
likely to change in future versions. Use this at your own risk.
Copy link
Member

Choose a reason for hiding this comment

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

I also don't think we should remove this, unless we also remove the actual 'experimental' status of the CustomBusinessDay itself (which might be OK to do, I just don't know it)

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, once we reach a consensus, I can either add this back or remove the additional warnings.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes this is ok
we have had this for quite a long time

@jschendel
Copy link
Member Author

@jorisvandenbossche

I was wondering: can't we just merge the two functions?

From a technical standpoint this would be straightforward, and I'd be happy to submit a PR to do so, if that's what's ultimately decided.

Really, both bdate_range and cdate_range could be merged into date_range without a lot of effort.
Doesn't look like bdate_range/ cdate_range are used within the codebase other than tests, and a brief mention in the docs. Aside from that, just a matter of adding the extra keywords to date_range, and directing users to change cdate_range(...) -> date_range(..., freq='C'), and bdate_range(...) -> date_range(..., freq='B'). The same holds for just merging cdate_range into bdate_range, if that would be preferable.

@jorisvandenbossche
Copy link
Member

I never use business frequency related functionality, so difficult to assess.

I would suggest cdate_range -> bdate_range merge, as this is the easiest (cdate_range was not yet top-level, so we can easily remove it again). Merging both cdate_range/bdate_range in date_range is a bit more 'invasive' as this needs deprecating of bdate_range (+ bdate_range is actually used in the docs, while cdate_range is not), so not sure that is worth.

@jschendel
Copy link
Member Author

@jorisvandenbossche : Okay, I'll open up an issue related to merging cdate_range -> bdate_range within the next day to give this more visibility, and to let others provide their input. I also never use business frequency related functionality, so difficult for me to assess too.

@jschendel jschendel deleted the fix-docs-17482 branch September 19, 2017 14:27
alanbato pushed a commit to alanbato/pandas that referenced this pull request Nov 10, 2017
No-Stream pushed a commit to No-Stream/pandas that referenced this pull request Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants