Skip to content
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

Docstring for color related methods are incorrect #249

Open
zshaheen opened this issue Sep 6, 2017 · 16 comments
Open

Docstring for color related methods are incorrect #249

zshaheen opened this issue Sep 6, 2017 · 16 comments
Milestone

Comments

@zshaheen
Copy link

zshaheen commented Sep 6, 2017

The docstring for vcs.colormap.Cp.setcolorcell() and other related methods needs to be updated. The RGB values need to be between 0-100, not 0-255.

In [3]: c.setcolorcell?
Signature: c.setcolorcell(index, red, green, blue, alpha=100.0)
Docstring:
Sets the R,G,B,A values of a colorcell

:Example:

    .. doctest:: colormap_setcolorcell

        >>> a = vcs.init() # Create a vcs Canvas
        >>> cmap = a.createcolormap('scc_cmap') # Create a colormap
        >>> cmap.setcolorcell(40,80,95,1.0) # Set RGBA values

:param index: Integer from 0-255.
:type index: `int`_

:param red: Integer from 0-255 representing the concentration of red in the colorcell.
:type red: `int`_

:param green: Integer from 0-255 representing the concentration of green in the colorcell.
:type green: `int`_

:param blue: Integer from 0-255 representing the concentration of blue in the colorcell.
:type blue: `int`_

:param alpha: Float representing the percentage of opacity in the colorcell.
:type alpha: `float`_

However, vcs.setcolorcell seems okay, but don't state the valid range of values.

In [4]: vcs.setcolorcell?
Signature: vcs.setcolorcell(obj, num, r, g, b, a=100)
Docstring:
Set a individual color cell in the active colormap. If default is
the active colormap, then return an error string.

.. note::

    If the the visual display is 16-bit, 24-bit, or 32-bit TrueColor,
    then a redrawing
    of the VCS Canvas is made every time the color cell is changed.

:Example:

    .. doctest:: utils_setcolorcell

        >>> vcs.setcolorcell("AMIP",11,0,0,0)
        >>> vcs.setcolorcell("AMIP",21,100,0,0)
        >>> vcs.setcolorcell("AMIP",31,0,100,0)
        >>> vcs.setcolorcell("AMIP",41,0,0,100)
        >>> vcs.setcolorcell("AMIP",51,100,100,100)
        >>> vcs.setcolorcell("AMIP",61,70,70,70)

:param obj: String name of a colormap, or a VCS object
:type obj: `str`_ or VCS object

:param num: Integer specifying which color cell to change.
    Must be from 0-239.
:type num: `int`_

:param r: Integer specifying the red value for the colorcell
:type r: `int`_

:param g: Integer specifying the green value for the colorcell
:type g: `int`_

:param b: Integer specifying the blue value for the colorcell
:type b: `int`_

:param a: Integer specifying the opacity value for the colorcell.
    Must be from 0-100.
:type a: `int`_
File:      ~/miniconda2/envs/acme_diags_env/lib/python2.7/site-packages/vcs/utils.py
Type:      function
@ghost
Copy link

ghost commented Sep 7, 2017

sigh Sorry, guys.

@doutriaux1
Copy link
Contributor

don't worry @embrown you did SOOOO much for this doc that we are forever in debt!

@ghost
Copy link

ghost commented Sep 7, 2017

@doutriaux1 I've been meaning to ask, are the doctests playing nicely with the suite of vcs tests?

@doutriaux1
Copy link
Contributor

@embrown I have all the plugs in, I need to turn this option on now

@zshaheen
Copy link
Author

zshaheen commented Sep 7, 2017

@embrown You really did a great job with the doc strings!! Seriously, they were a total life saver. :)

@ghost
Copy link

ghost commented Jan 2, 2018

@charlesdoutriaux @zshaheen
Wanted to tag you both here, rather than open up a new issue, because I don't know if it's a known problem.
The readthedocs entry isn't rendering any of the API documentation:
http://cdat-vcs.readthedocs.io/en/stable/API/Canvas.html

@zshaheen
Copy link
Author

zshaheen commented Jan 2, 2018

@embrown @doutriaux1 Ah, that sucks. We'll look into this. Hope to see you soon!

@doutriaux1
Copy link
Contributor

@chaosphere2112 @aashish24 says you have admin privileges for readthedoc can you transfer this to me please. Thanks.

@chaosphere2112
Copy link
Contributor

Yup, I can do that; what's your readthedocs account?

@doutriaux1
Copy link
Contributor

doutriaux1 Thanks @chaosphere2112 .

@chaosphere2112
Copy link
Contributor

screen shot 2018-01-05 at 6 50 25 am
Did you make an account on readthedocs.org?

@doutriaux1
Copy link
Contributor

I log in with my lab email address:

The trial period for CDAT is almost over, be sure to add a subscription to your organization if you with to continue using Read the Docs.
Successfully signed in as doutriaux1.

@doutriaux1
Copy link
Contributor

@doutriaux1
Copy link
Contributor

ok figured it out, I was on the .com site not .org got it setup on .org as well, please give it another shot. Thanks.

@chaosphere2112
Copy link
Contributor

Done! You can feel free to remove me as a maintainer now.

@doutriaux1
Copy link
Contributor

Thanks @chaosphere2112 . We'll keep you on board, in case you're bored 😉

@doutriaux1 doutriaux1 added this to the Next Release milestone Mar 29, 2018
@doutriaux1 doutriaux1 modified the milestones: 8.1, 8.2 Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants