Skip to content

DOC: use substitution decorator for business month classes (#25828) #25868

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
Mar 26, 2019

Conversation

Batalex
Copy link
Contributor

@Batalex Batalex commented Mar 25, 2019

Validation script
CustomBusinessMonthEnd

################################################################################
########## Docstring (pandas.tseries.offsets.CustomBusinessMonthEnd)  ##########
################################################################################
                                                                                
DateOffset subclass representing one custom business month, incrementing        
between end of month dates.                                                     
                                                                                
Parameters                                                                      
----------                                                                      
n : int, default 1                                                              
normalize : bool, default False                                                 
    Normalize start/end dates to midnight before generating date range          
weekmask : str, Default 'Mon Tue Wed Thu Fri'                                   
    weekmask of valid business days, passed to ``numpy.busdaycalendar``         
holidays : list                                                                 
    list/array of dates to exclude from the set of valid business days,         
    passed to ``numpy.busdaycalendar``                                          
calendar : pd.HolidayCalendar or np.busdaycalendar                              
offset : timedelta, default timedelta(0)                                        
                                                                                
################################################################################
################################## Validation ##################################
################################################################################
                                                                                
9 Errors found:                                                                 
        Summary should fit in a single line                                     
        Parameter "n" has no description                                        
        Parameter "normalize" description should finish with "."                
        Parameter "weekmask" description should start with a capital letter     
        Parameter "weekmask" description should finish with "."                 
        Parameter "holidays" description should start with a capital letter     
        Parameter "holidays" description should finish with "."                 
        Parameter "calendar" has no description                                 
        Parameter "offset" has no description                                   
2 Warnings found:                                                               
        See Also section not found                                              
        No examples section found                                                                                                                   

CustomBusinessMonthBegin

################################################################################
######### Docstring (pandas.tseries.offsets.CustomBusinessMonthBegin)  #########
################################################################################
                                                                                
DateOffset subclass representing one custom business month, incrementing        
between beginning of month dates.                                               
                                                                                
Parameters                                                                      
----------                                                                      
n : int, default 1                                                              
normalize : bool, default False                                                 
    Normalize start/end dates to midnight before generating date range          
weekmask : str, Default 'Mon Tue Wed Thu Fri'                                   
    weekmask of valid business days, passed to ``numpy.busdaycalendar``         
holidays : list                                                                 
    list/array of dates to exclude from the set of valid business days,         
    passed to ``numpy.busdaycalendar``                                          
calendar : pd.HolidayCalendar or np.busdaycalendar                              
offset : timedelta, default timedelta(0)                                        
                                                                                
################################################################################
################################## Validation ##################################
################################################################################
                                                                                
9 Errors found:                                                                 
        Summary should fit in a single line                                     
        Parameter "n" has no description                                        
        Parameter "normalize" description should finish with "."                
        Parameter "weekmask" description should start with a capital letter     
        Parameter "weekmask" description should finish with "."                 
        Parameter "holidays" description should start with a capital letter     
        Parameter "holidays" description should finish with "."                 
        Parameter "calendar" has no description                                 
        Parameter "offset" has no description                                   
2 Warnings found:                                                               
        See Also section not found                                              
        No examples section found                                               

@codecov
Copy link

codecov bot commented Mar 25, 2019

Codecov Report

Merging #25868 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25868      +/-   ##
==========================================
- Coverage   91.48%   91.48%   -0.01%     
==========================================
  Files         175      175              
  Lines       52885    52885              
==========================================
- Hits        48381    48380       -1     
- Misses       4504     4505       +1
Flag Coverage Δ
#multiple 90.04% <100%> (ø) ⬆️
#single 41.82% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/tseries/offsets.py 96.69% <100%> (ø) ⬆️
pandas/util/testing.py 89.74% <0%> (-0.11%) ⬇️

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 923ac2b...540e18e. Read the comment docs.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Substitution looks correct. The docstring errors are orthogonal but do you see an easy way to fix them? May be worth knocking out as part of this if simple

@WillAyd WillAyd added the Docs label Mar 25, 2019
@Batalex Batalex force-pushed the doc/substitution-offset branch 4 times, most recently from be8c313 to d5c50d3 Compare March 25, 2019 17:43
@Batalex
Copy link
Contributor Author

Batalex commented Mar 25, 2019

@WillAyd I juste force pushed somes changes:

  • Removed uneeded entry in whatsnew
  • Fixed isort linting
  • Fixed docstring validation. I picked some description elements from offsets.DateOffset & np.busdaycalendar

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Nice job! FYI for next contribution shouldn't need to force push changes so long as you merge in master

@Batalex Batalex force-pushed the doc/substitution-offset branch from d5c50d3 to 8df84fb Compare March 26, 2019 08:19
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Very minor stuff. If you can clean up and ping on green can get this merged

@WillAyd
Copy link
Member

WillAyd commented Mar 26, 2019

@Batalex just to clarify previous comment force pushing is less than desirable. Assuming you are rebasing which requires a force push an alternate workflow on top of your local branch is:

git fetch upstream
git merge upstream/master

Resolve any conflicts and git merge --continue if applicable. Should then be able to push without forcing

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm ping on green

@WillAyd WillAyd added this to the 0.25.0 milestone Mar 26, 2019
@Batalex
Copy link
Contributor Author

Batalex commented Mar 26, 2019

@WillAyd ping

@WillAyd WillAyd merged commit d404460 into pandas-dev:master Mar 26, 2019
@WillAyd
Copy link
Member

WillAyd commented Mar 26, 2019

Thanks @Batalex !

@Batalex
Copy link
Contributor Author

Batalex commented Mar 26, 2019

Thanks for your guidance!

@Batalex Batalex deleted the doc/substitution-offset branch March 27, 2019 07:59
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.

Use Substitution Decorator for CustomBusinessMonthEnd
2 participants