home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 1351995978

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/issues/7378#issuecomment-1351995978 https://api.github.com/repos/pydata/xarray/issues/7378 1351995978 IC_kwDOAMm_X85QldJK 35968931 2022-12-14T19:05:19Z 2022-12-14T19:05:19Z MEMBER

That's a useful observation, thank you @maawoo!

This comes from the way we generate our code for the many different aggregations xarray can perform. We actually use this script to automatically generate all the source code for all the aggregations in this file. That script has a template that is filled in for each method.

Currently the template looks like this

python TEMPLATE_REDUCTION_SIGNATURE = ''' def {method}( self, dim: Dims = None, *,{extra_kwargs} keep_attrs: bool | None = None, **kwargs: Any, ) -> {obj}: """ Reduce this {obj}'s data by applying ``{method}`` along some dimension(s). Parameters ----------''' where in the case of variance the method is just var so "variance" isn't in the generated docstring anywhere.

How might we fix this? One immediate thought that might help is to change the template to use a method_name and a long_name, where method_name is var but long_name is variance for example. This shouldn't be particularly difficult, and we would welcome a PR if you would be interested in contributing? We would help you out :slightly_smiling_face:

Or we might change the docstrings in some other, more granular way. Adding examples to aggregation methods would also have to deal with the fact they are autogenerated https://github.com/pydata/xarray/issues/6793

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