-
Notifications
You must be signed in to change notification settings - Fork 297
Populate DimCoord.__init__ docstring
#3681
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
|
While I was getting to grips with the monotonicity rules, I realised it is possible to create a dimcoord whose points and bounds are monotonic in opposite directions. Not sure that's quite right, but it's beyond the scope of this PR. |
|
Travis failed on image comparisons. I'm pretty sure I can't have caused this! |
| Args: | ||
| * points: | ||
| 1D numpy array-like of values (or single value in the case of a |
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.
Given that it’s specifically 1D, perhaps simply “Sequence of...” would be better?
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 it would be wiser to stick with "numpy array-like", because I think that has come to be recognised as a common usage meaning "I can do an as_array() on it".
The idea may extend to other array types like CUDA or dask, as well as numpy.
In addition to iterables (of iterables), it can mean an object that provides .shape + .dtype, or __array_interface__ or __array__.
There's a nice discussion here : https://stackoverflow.com/a/40380014
Yes, not your fault. Working on it ... #3682 |
f33f382 to
104a84a
Compare
|
Rebased 😎 |
|
@rcomer Thanks for this.... Don't quite understand why this is still unmerged, so I'm banking it 👍 |
* master: Support for climatological in Coord.from_coord() and DimCoord.from_regular(). (SciTools#3802) clarify unit handling (SciTools#3803) Add quality flags to whatsnew (SciTools#3801) add args/kwargs to DimCoord.__init__ docstring (SciTools#3681) Merge launch_ancils feature branch. Modify parsing of ff headers to avoid numpy.fromfile. (SciTools#3791)
* master: Whatsnew for effects on aux factories of units defaulting to 'unknown'. (SciTools#3870) Whatsnew entry for SciTools#3867. (SciTools#3868) Developer guide overhaul (SciTools#3852) Update CF standard name table to v75 (SciTools#3867) Link to new classes and methods in the Ancillary variables whatsnew. (SciTools#3865) update black version (SciTools#3866) Fix whatsnew api links. (SciTools#3856) Add additional pre-commit hooks (SciTools#3862) update pre-commit flake8 version (SciTools#3863) whatsnew - update announcement (SciTools#3861) whatsnew - remove contents directive (SciTools#3859) whatsnew - links and versions (SciTools#3853) Replace deprecated IndexFormatter (SciTools#3857) whatsnew for SciTools#3681 (SciTools#3858) Whatsnew entry for SciTools#3846. (SciTools#3855) Image tests: set agg backend after rcdefaults (SciTools#3846) whatnew - announcements (SciTools#3850)
Adds some detail about the args and kwargs to the
DimCoord.__init__docstring. I noticed this omission this morning while helping an inexperienced user who needs to create aDimCoordfrom scratch.I've given some thought to the descriptions for
points,boundsandcircular, but everything else is a direct copy/paste from the equivalentCoorddocstring. I also tweaked the description forpointsin theCoordversion, as this way scans better in my head.A couple of things I'm not sure of:
Coord.__init__docstring?circularattribute, so what I've written could be nonsense!Closes #3520