You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When looking at the documentation for various functions in the MetPy Reference Guide, in the right column there is an icon followed by "Show Source". However, the information revealed by clicking on "Show Source" is not particularly useful.
I would find a display of the actual source code that implements the read_colortable function to be more useful in this context, or perhaps the "raw" text of its docstring.
So for this particular function, I think:
defread_colortable(fobj):
r"""Read colortable information from a file. Reads a colortable, which consists of one color per line of the file, where a color can be one of: a tuple of 3 floats, a string with a HTML color name, or a string with a HTML hex color. Parameters ---------- fobj : file-like object A file-like object to read the colors from Returns ------- List of tuples A list of the RGB color values, where each RGB color is a tuple of 3 floats in the range of [0, 1]. """ret= []
try:
forlineinfobj:
literal=_parse(line)
ifliteral:
ret.append(mcolors.colorConverter.to_rgb(literal))
returnretexcept (SyntaxError, ValueError) ase:
raiseRuntimeError(f'Malformed colortable (bad line: {line})') frome
or a subset of the above would be better. But maybe I'm completely missing the point behind these "Show Source" links.
The text was updated successfully, but these errors were encountered:
Oops, we were supposed to hide that, but I misspelled the config never did. This button from the theme is only for the doc source. However, I'll go see about enabling the linkcode extension to add a source button a la NumPy, Pandas, etc.
What can be better?
When looking at the documentation for various functions in the MetPy Reference Guide, in the right column there is an icon followed by "Show Source". However, the information revealed by clicking on "Show Source" is not particularly useful.
For instance, for read_colortable, "Show Source" shows:
I would find a display of the actual source code that implements the
read_colortable
function to be more useful in this context, or perhaps the "raw" text of its docstring.So for this particular function, I think:
or a subset of the above would be better. But maybe I'm completely missing the point behind these "Show Source" links.
The text was updated successfully, but these errors were encountered: