home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 555033923

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/3516#issuecomment-555033923 https://api.github.com/repos/pydata/xarray/issues/3516 555033923 MDEyOklzc3VlQ29tbWVudDU1NTAzMzkyMw== 14808389 2019-11-18T14:17:36Z 2019-11-18T14:17:36Z MEMBER

I think I found the reasons for the numpy docstring warnings: 1. some of the numpy functions include signatures. I think that is because they are written in C? In the signature there is an asterisk which sphinx misinterprets. 2. the numpy docstrings are indented which somehow confuses sphinx, but only for some of the functions 3. some references are labeled, but not used

all of these can be silenced by rewriting the docstrings: ```python def _create_op(name): func = _UFuncDispatcher(name) func.name = name doc = textwrap.dedent(getattr(_np, name).doc) if doc.strip().startswith(name): start_location = doc.strip().find("\n\n") doc = doc[start_location + 2:]

for ref_num in range(5):
    if f".. [{ref_num}]" not in doc or f"[{ref_num}]_" in doc:
        continue

    doc = doc.replace(f".. [{ref_num}]", f"{ref_num}.    ")

func.__doc__ = (
    "xarray specific variant of numpy.%s. Handles "
    "xarray.Dataset, xarray.DataArray, xarray.Variable, "
    "numpy.ndarray and dask.array.Array objects with "
    "automatic dispatching.\n\n"
    "Documentation from numpy:\n\n%s" % (name, doc)
)
return func

``` However, I'm not sure this is a good idea.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  521887948
Powered by Datasette · Queries took 1.704ms · About: xarray-datasette