-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Add missing period to pandas.Series.interpolate docstring #22217
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
Conversation
Previously, the _new in version_ message seemed like a run-on sentence: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.interpolate.html Also added code formatting for BPoly.from_derivatives reference.
pandas/core/generic.py
Outdated
@@ -6110,13 +6110,13 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None, | |||
<http://docs.scipy.org/doc/scipy/reference/interpolate.html#univariate-interpolation>`__ | |||
and `tutorial documentation | |||
<http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html>`__ | |||
* 'from_derivatives' refers to BPoly.from_derivatives which | |||
* 'from_derivatives' refers to ``BPoly.from_derivatives`` which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just use double backticks for literals so this is probably better served with just single back ticks. @datapythonista
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few lines above, I see scipy.interpolate.interp1d
wrapped in double backticks. I figured we would want to do the same for scipy.interpolate.BPoly.from_derivatives
. Do you want me to change scipy.interpolate.interp1d
to single backticks?
P.S. Should these additionally be hyperlinks to the actual scipy docs? Or do the scipy docs reorganize enough that it wouldn't be stable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaik double backticks are mainly used for code, as they are rendered in monospace. While single backticks don't have a specific meaning, as they can be customized. So, for my understanding, we should use single backticks in this case. But I think in many cases we're using double backticks for similar things.
About the links, they are built automatically for other parts of the documentation, by prefixing :class:
, :meth:
, :ref:
... But I'm not sure if for external packages we've got it set up.
May be @TomAugspurger knows. Otherwise, I'll research and see what's the best we can do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Links to scipy should work, since they're in our intersphinx mapping:
Lines 366 to 374 in 2156431
intersphinx_mapping = { | |
'statsmodels': ('http://www.statsmodels.org/devel/', None), | |
'matplotlib': ('http://matplotlib.org/', None), | |
'pandas-gbq': ('https://pandas-gbq.readthedocs.io/en/latest/', None), | |
'python': ('https://docs.python.org/3/', None), | |
'numpy': ('https://docs.scipy.org/doc/numpy/', None), | |
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None), | |
'py': ('https://pylib.readthedocs.io/en/latest/', None) | |
} |
:meth:
is probably best.
Codecov Report
@@ Coverage Diff @@
## master #22217 +/- ##
==========================================
+ Coverage 92.06% 92.06% +<.01%
==========================================
Files 169 169
Lines 50694 50698 +4
==========================================
+ Hits 46671 46676 +5
+ Misses 4023 4022 -1
Continue to review full report at Codecov.
|
Alright, see if this is better. I added links to the actual scipy docs for those functions. I wasn't sure if you can do something like |
Not sure about the |
@datapythonista I got the I tried building the docs but got the following error message: $ ./make.py html
Running Sphinx v1.7.5
Configuration error:
There is a programable error in your configuration file:
Traceback (most recent call last):
File "/Users/Adam/pandas/pandas/__init__.py", line 26, in <module>
from pandas._libs import (hashtable as _hashtable,
File "/Users/Adam/pandas/pandas/_libs/__init__.py", line 4, in <module>
from .tslibs import (
File "/Users/Adam/pandas/pandas/_libs/tslibs/__init__.py", line 4, in <module>
from .conversion import normalize_date, localize_pydatetime, tz_convert_single
ModuleNotFoundError: No module named 'pandas._libs.tslibs.conversion'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/Adam/anaconda3/lib/python3.6/site-packages/sphinx/config.py", line 161, in __init__
execfile_(filename, config)
File "/Users/Adam/anaconda3/lib/python3.6/site-packages/sphinx/util/pycompat.py", line 150, in execfile_
exec_(code, _globals)
File "conf.py", line 140, in <module>
import pandas
File "/Users/Adam/pandas/pandas/__init__.py", line 35, in <module>
"the C extensions first.".format(module))
ImportError: C extension: No module named 'pandas._libs.tslibs.conversion' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first. What am I missing here? |
You need to build the C extensions: python setup.py build_ext --inplace |
Thanks, but now I'm having troubles with $ python setup.py build_ext --inplace
running build_ext
pandas._libs.algos: -> [['pandas/_libs/algos.c']]
Traceback (most recent call last):
File "setup.py", line 755, in <module>
**setuptools_kwargs)
File "/Users/Adam/anaconda3/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/Users/Adam/anaconda3/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/Adam/anaconda3/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/Users/Adam/anaconda3/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/Adam/anaconda3/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "setup.py", line 369, in build_extensions
self.check_cython_extensions(self.extensions)
File "setup.py", line 366, in check_cython_extensions
""".format(src=src))
Exception: Cython-generated file 'pandas/_libs/algos.c' not found.
Cython is required to compile pandas from a development branch.
Please install Cython or download a release package of pandas. I do have $ pip install cython
Requirement already satisfied: cython in /Users/Adam/anaconda3/lib/python3.6/site-packages (0.27.3)
$ python
Python 3.6.5 |Anaconda custom (64-bit)| (default, Apr 26 2018, 08:42:37)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cython
>>> cython.__version__
'0.27.3' |
Maybe try starting with a clean before building: python setup.py clean --all lmk |
Same error message. I also tried adding the |
Are you running within an activated virtual environment? Set up looks OK but maybe something surprising going on with path resolution if not |
No virtual environment. I just updated Cython from 0.27.3 to 0.28.4 and it seems to be working now?? |
Makes sense. We just upped our min version dependency to 0.28.2 |
Alright, I ran: $ python make.py --num-jobs 4 --single Series.interpolate and everything looks good: However, the scipy function links aren't clickable. Is this just because it's a preview? P.S. I also tried replacing |
Yes, just :func:
If you're curious, the :py: is a domain
http://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html We
use the default Python domain.
…On Tue, Aug 7, 2018 at 3:19 PM Adam J. Stewart ***@***.***> wrote:
Alright, I ran:
$ python make.py --num-jobs 4 --single Series.interpolate
and everything looks good:
[image: screen shot 2018-08-07 at 3 15 40 pm]
<https://user-images.githubusercontent.com/12021217/43800038-d88217fa-9a54-11e8-98ec-49bc102dec6a.png>
However, the scipy function links aren't clickable. Is this just because
it's a preview?
P.S. I also tried replacing :py:func: with :func: and it looks identical.
If they both work, is :func: preferred?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22217 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIpkR-xUU-YINtjPKSwfrJy4n30Q8ks5uOfZYgaJpZM4VwqGB>
.
|
@adamjstewart I think sphinx does not create the links when we build with |
@datapythonista I cleaned and rebuilt all of the docs this time but still no links. 🤷♂️ |
@adamjstewart did you check if the rest of the links (e.g. |
The "See Also" links are working. Links to |
pandas/core/generic.py
Outdated
``scipy.interpolate.interp1d``. Both 'polynomial' and 'spline' | ||
require that you also specify an `order` (int), | ||
e.g. df.interpolate(method='polynomial', order=4). | ||
:func:`scipy.interpolate.interp1d`. Both 'polynomial' and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like scipy.interpolate.interp1d
is a class. May be that's the problem, as it requires :class:
instead of :func:
?
https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html
pandas/core/generic.py
Outdated
@@ -6110,13 +6110,14 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None, | |||
<http://docs.scipy.org/doc/scipy/reference/interpolate.html#univariate-interpolation>`__ | |||
and `tutorial documentation | |||
<http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html>`__ | |||
* 'from_derivatives' refers to BPoly.from_derivatives which | |||
* 'from_derivatives' refers to | |||
:func:`scipy.interpolate.BPoly.from_derivatives` which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this seems to be a method, so :meth:
instead of :func:
.
@datapythonista That did the trick, thanks! For the record, Sphinx creates the links even with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
It's good to know that --single
creates the links now, I think it didn't before (may be the problem was a different thing).
Thanks @adamjstewart for the contribution, this is a useful change.
thanks @adamjstewart |
Previously, the new in version message seemed like a run-on sentence:
https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.interpolate.html
Also added code formatting for
BPoly.from_derivatives
reference.