Skip to content

DOC: Use only one blank line to separate sections or paragraphs #23870

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

Closed
alexander-ponomaroff opened this issue Nov 23, 2018 · 24 comments · Fixed by #23871
Closed

DOC: Use only one blank line to separate sections or paragraphs #23870

alexander-ponomaroff opened this issue Nov 23, 2018 · 24 comments · Fixed by #23871
Labels
CI Continuous Integration Code Style Code style, linting, code_checks Docs good first issue

Comments

@alexander-ponomaroff
Copy link
Contributor

When checking for errors with ./scripts/validate_docstrings.py, There is an error that comes up:

GL03
Use only one blank line to separate sections or paragraphs

I started working on this and will create a pull request for this issue shortly to go into more detail on what I fixed.

@datapythonista

@datapythonista
Copy link
Member

Reopening. Most of the issues have been fixed, but still some left, see: #23871 (comment)

@gfyoung gfyoung added Docs CI Continuous Integration Code Style Code style, linting, code_checks good first issue labels Nov 24, 2018
@abkosar
Copy link
Contributor

abkosar commented Mar 2, 2019

Hey @datapythonista, I am new to open source and would like to work on this! Just curious if someone is working on it? If not I can give it a shot!

Thanks!

@datapythonista
Copy link
Member

I think this is trickier than it looks, but surely a good first issue, and you can definitely work on it.

Executing ./scripts/validate_docstrings.py --errors=GL03 should give you the errors, and should return nothing once you fixed this issue.

Thanks @abkosar

@abkosar
Copy link
Contributor

abkosar commented Mar 4, 2019

Thanks!

@abkosar
Copy link
Contributor

abkosar commented Mar 4, 2019

So started working on the issue. When I run ./scripts/validate_docstrings.py --errors=GL03 there are 98 errors:

  • pandas.Series.to_numpy: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.agg: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.aggregate: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.cummax: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.cummin: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.cumprod: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.cumsum: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.kurt: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.mad: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.mean: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.median: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.skew: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.kurtosis: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.compound: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.dayofweek: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.weekday: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.is_month_start: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.is_month_end: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.is_quarter_start: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.is_quarter_end: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.is_year_start: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.is_year_end: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.dt.is_leap_year: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Timedelta: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Timedelta.max: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Timedelta.min: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.SparseArray: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.read_feather: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.resample.Resampler.apply: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.resample.Resampler.aggregate: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.resample.Resampler.pipe: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.resample.Resampler.mean: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.cummax: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.cummin: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.cumprod: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.cumsum: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.mean: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.median: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.skew: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.swaplevel: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.plotting.andrews_curves: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.describe_option: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.reset_option: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.get_option: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.set_option: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.melt: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Index.reindex: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.dayofweek: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.weekday: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.is_month_start: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.is_month_end: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.is_quarter_start: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.is_quarter_end: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.is_year_start: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.is_year_end: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DatetimeIndex.is_leap_year: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.window.Rolling.aggregate: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.window.Expanding.aggregate: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.GroupBy.head: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.GroupBy.mean: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.GroupBy.nth: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.GroupBy.tail: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.corr: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.cov: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.diff: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.fillna: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.hist: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.idxmax: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.idxmin: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.mad: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.skew: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.take: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.tshift: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.SeriesGroupBy.nlargest: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.SeriesGroupBy.nsmallest: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.SeriesGroupBy.unique: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.SeriesGroupBy.is_monotonic_increasing: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.SeriesGroupBy.is_monotonic_decreasing: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.core.groupby.DataFrameGroupBy.corrwith: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.agg: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.aggregate: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.compound: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.cummax: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.cummin: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.cumprod: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.cumsum: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.kurt: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.kurtosis: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.mad: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.mean: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.median: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.skew: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.DataFrame.to_html: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Series.ptp: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.compound: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.kurt: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.kurtosis: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
  • pandas.Panel.mad: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings

@NatholBMX
Copy link

Hi @abkosar
Have you mady any progress on this?

@abkosar
Copy link
Contributor

abkosar commented Jun 7, 2019

Hi @NatholBMX

I recently started working on this again. I would still like to work on it and sorry for not updating it for a long time.

@abkosar
Copy link
Contributor

abkosar commented Jun 18, 2019

Hi @NatholBMX

When I run ./scripts/validate_docstrings.py --errors=GL03 I get this error:

Traceback (most recent call last):
  File "./scripts/validate_docstrings.py", line 989, in <module>
    args.ignore_deprecated))
  File "./scripts/validate_docstrings.py", line 889, in main
    result = validate_all(prefix, ignore_deprecated)
  File "./scripts/validate_docstrings.py", line 843, in validate_all
    doc_info = validate_one(func_name)
  File "./scripts/validate_docstrings.py", line 799, in validate_one
    errs, wrns, examples_errs = get_validation_data(doc)
  File "./scripts/validate_docstrings.py", line 747, in get_validation_data
    if not doc.see_also:
  File "./scripts/validate_docstrings.py", line 476, in see_also
    for funcs, desc in self.doc['See Also']:
ValueError: too many values to unpack (expected 2)

I synced my fork before doing this.

Is there anything that I should do differently?

@datapythonista
Copy link
Member

This is working for me with master. Can you make sure you run conda env update in the root of the pandas repo to use the correct versions of everything. Or may be you've got changes in the docstrings that can be causing this?

@abkosar
Copy link
Contributor

abkosar commented Jun 20, 2019

Hey @datapythonista, thanks for the reply.

So I ran conda env update and I don't get the error now; however I think there is still something going on. Now when I ran it runs but I get this output instead of the output I posted at the very beginning:

./scripts/validate_docstrings.py:799: PerformanceWarning: indexing past lexsort depth may impact performance.
  errs, wrns, examples_errs = get_validation_data(doc)
./scripts/validate_docstrings.py:1: FutureWarning: Series.to_sparse is deprecated and will be removed in a future version
  #!/usr/bin/env python
./scripts/validate_docstrings.py:1: FutureWarning: Series.to_sparse is deprecated and will be removed in a future version
  #!/usr/bin/env python
./scripts/validate_docstrings.py:559: DtypeWarning: Columns (0) have mixed types. Specify dtype option on import or set low_memory=False.
  runner.run(test, out=f.write)
./scripts/validate_docstrings.py:1: FutureWarning: the 'box' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'box'
  #!/usr/bin/env python
./scripts/validate_docstrings.py:1: FutureWarning: DataFrame.ftypes is deprecated and will be removed in a future version. Use DataFrame.dtypes instead.
  #!/usr/bin/env python
./scripts/validate_docstrings.py:799: PerformanceWarning: indexing past lexsort depth may impact performance.
  errs, wrns, examples_errs = get_validation_data(doc)
/Users/ardkosar/Documents/Personal_Projects/open_source/pandas/pandas/plotting/_matplotlib/converter.py:96: FutureWarning: Using an implicitly registered datetime converter for a matplotlib plotting method. The converter was registered by pandas on import. Future versions of pandas will require you to explicitly register matplotlib converters.

To register the converters:
        >>> from pandas.plotting import register_matplotlib_converters
        >>> register_matplotlib_converters()
  warnings.warn(msg, FutureWarning)
./scripts/validate_docstrings.py:1: FutureWarning: Series.nonzero() is deprecated and will be removed in a future version.Use Series.to_numpy().nonzero() instead
  #!/usr/bin/env python

I haven't made any changes yet so I don't think that's causing any issues.

I think I'll start working on the output I got the first time I ran this but I'm just curious why it doesn't give the same output again.

@datapythonista
Copy link
Member

Those are warnings, they should be fixed eventually, but not relevant for what you're doing.

If that's all what you get, I think there are no GL03 errors. You can also run:

./scripts/validate_docstrings.py --errors=GL03 && echo "NO ERRORS FOUND"

If the message gets printed means that no errors are found indeed (validate_docstrings.py returns an exit code 0 if no errors are found, and the && will make the echo just be executed if that's the case)

@abkosar
Copy link
Contributor

abkosar commented Jun 20, 2019

Yep that's exactly what happened:

./scripts/validate_docstrings.py:799: PerformanceWarning: indexing past lexsort depth may impact performance.
  errs, wrns, examples_errs = get_validation_data(doc)
./scripts/validate_docstrings.py:1: FutureWarning: Series.to_sparse is deprecated and will be removed in a future version
  #!/usr/bin/env python
./scripts/validate_docstrings.py:1: FutureWarning: Series.to_sparse is deprecated and will be removed in a future version
  #!/usr/bin/env python
./scripts/validate_docstrings.py:559: DtypeWarning: Columns (0) have mixed types. Specify dtype option on import or set low_memory=False.
  runner.run(test, out=f.write)
./scripts/validate_docstrings.py:1: FutureWarning: the 'box' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'box'
  #!/usr/bin/env python
./scripts/validate_docstrings.py:1: FutureWarning: DataFrame.ftypes is deprecated and will be removed in a future version. Use DataFrame.dtypes instead.
  #!/usr/bin/env python
./scripts/validate_docstrings.py:799: PerformanceWarning: indexing past lexsort depth may impact performance.
  errs, wrns, examples_errs = get_validation_data(doc)
/Users/ardkosar/Documents/Personal_Projects/open_source/pandas/pandas/plotting/_matplotlib/converter.py:96: FutureWarning: Using an implicitly registered datetime converter for a matplotlib plotting method. The converter was registered by pandas on import. Future versions of pandas will require you to explicitly register matplotlib converters.

To register the converters:
        >>> from pandas.plotting import register_matplotlib_converters
        >>> register_matplotlib_converters()
  warnings.warn(msg, FutureWarning)
./scripts/validate_docstrings.py:1: FutureWarning: Series.nonzero() is deprecated and will be removed in a future version.Use Series.to_numpy().nonzero() instead
  #!/usr/bin/env python
NO ERRORS FOUND

@datapythonista
Copy link
Member

I just saw now that this issue is for GL03 and that we're already validating those in ci/code_checks.sh, so it's normal that you don't get any error.

Closing this issue, but you can work on GL01 and GL02 (I'd take care of them together, since they are related). There are several errors, if you manage to fix them all (feel free to open a PR just for a subset), then please add the codes in ci/code_checks.sh so they start being validated in the CI.

Any question let me know.

@datapythonista
Copy link
Member

You can get the errors with: ./scripts/validate_docstrings.py --errors=GL01,GL02, the idea is that:

def foo():
    """This is incorrect."""

it should be

def foo():
    """
    This is correct.
    """

@abkosar
Copy link
Contributor

abkosar commented Jun 20, 2019

Sure, I'd be happy to work on those, thanks!

@datapythonista
Copy link
Member

@abkosar just realized that #26526 wasn't merged until now, which fixes some of those. You should update your branch (i.e. git fetch upstream && git merge upstream/master) before start working on those. Good news is that you'll have many less to fix. :)

@datapythonista
Copy link
Member

@abkosar I created #26982 for part of the issues, you may want to work in some of the others

@abkosar
Copy link
Contributor

abkosar commented Jun 21, 2019

@datapythonista Sounds good to me. Should I also create seperate issues for each category like you or an issue for everything I fixed?

@datapythonista
Copy link
Member

Feel free to do it, but probably it's simpler that you just fix as many cases as you want not in that issue, and open a PR. The reason for creating the issue is that I think there are two many cases for a single PR (and probably a single person), so we can have someone else working on that.

@abkosar
Copy link
Contributor

abkosar commented Jun 21, 2019

Ok sounds good, thanks!

@abkosar
Copy link
Contributor

abkosar commented Jul 9, 2019

Hey @datapythonista -- So I want to start working on GL01 and GL02 however when I tried to do ./scripts/validate_docstrings.py --errors=GL01,GL02 again I am getting the following error:

(pandas-dev) WKMUS3584619:pandas ardkosar$ ./scripts/validate_docstrings.py --errors=GL01,GL02
Traceback (most recent call last):
  File "./scripts/validate_docstrings.py", line 1047, in <module>
    args.ignore_deprecated,
  File "./scripts/validate_docstrings.py", line 931, in main
    result = validate_all(prefix, ignore_deprecated)
  File "./scripts/validate_docstrings.py", line 877, in validate_all
    api_items += list(get_api_items(f))
  File "./scripts/validate_docstrings.py", line 229, in get_api_items
    func = getattr(func, part)
AttributeError: type object 'pandas._libs.interval.Interval' has no attribute 'is_empty'

I did the following steps before running the script:

  • conda env update
  • git fetch upstream && git merge upstream/master

I didn't want to create another issue just for this so wanted to ask here.

Am I doing something wrong?

Thanks!

@WillAyd
Copy link
Member

WillAyd commented Jul 9, 2019

You need to rebuild the C extensions, so python setup.py build_ext --inplace

@abkosar
Copy link
Contributor

abkosar commented Jul 9, 2019

@WillAyd Thanks, it worked!

@abkosar
Copy link
Contributor

abkosar commented Jul 13, 2019

Hey @datapythonista -- I have another question.

So for example the validate_docstrings.py script gives me:

pandas.PeriodIndex.day: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.day: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.dayofweek: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.dayofweek: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.dayofyear: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.dayofyear: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.days_in_month: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.days_in_month: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.daysinmonth: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.daysinmonth: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.hour: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.hour: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.minute: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.minute: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.month: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.month: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.quarter: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.quarter: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.second: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.second: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.week: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.week: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.weekday: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.weekday: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.weekofyear: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.weekofyear: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.PeriodIndex.year: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.PeriodIndex.year: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)

I thought that I'd find these methods at pandas.core.indexes.period in the PeriodIndex class. However in that class I can't find these attributes.

Am I looking at the wrong place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Code Style Code style, linting, code_checks Docs good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants