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 cleanup #2056

Merged
merged 31 commits into from
Jul 13, 2016
Merged

Docstring cleanup #2056

merged 31 commits into from
Jul 13, 2016

Conversation

chaosphere2112
Copy link
Contributor

Cleaned up version of #2055

@chaosphere2112
Copy link
Contributor Author

@embrown OK, I've fixed this branch up so GitHub likes it more; I also fixed some code style issues. However, there are 41 lines that are longer than our limit for code style (maximum line length is 120 characters).

Canvas.py

Line 1733 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1739 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1751 ":param projection: Lets you specify a geographic projection used to convert x/y from spherical coordinates into 2D coordinates."
Line 1857 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1863 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1979 ":param index: Specifies which `pattern <http://uvcdat.llnl.gov/gallery/fullsize/pattern_chart.png>`_ to fill the fillarea with. Accepts ints from 1-20."
Line 1982 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1988 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 2000 ":param bg: Boolean value. If true, object is drawn in background (not shown on canvas). If false, object is shown on the canvas."
Line 2210 ":param index: Specifies which `pattern <http://uvcdat.llnl.gov/gallery/fullsize/pattern_chart.png>`_ to fill the fillarea with. Accepts ints from 1-20."
Line 2213 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 2219 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 2231 ":param bg: Boolean value. If true, object is drawn in background (not shown on canvas). If false, object is shown on the canvas."
Line 4487 ":param height: Float representing the desired height of the output, using the specified unit of measurement. Must be one of ['inches', 'in', 'cm', 'mm', None, 'pixel', 'pixels', 'dot', 'dots']."
Line 4538 ":param height: Float representing the desired height of the output png, using the specified unit of measurement. Must be one of ['inches', 'in', 'cm', 'mm', None, 'pixel', 'pixels', 'dot', 'dots']."
Line 4588 ":param units: String indicating units of measurement. Must be one of ['inches', 'in', 'cm', 'mm', 'pixel', 'pixels', 'dot', 'dots']. Default is 'inches'."
Line 4636 ":param units: Specifies units of measurement for the output image. One of ['inches', 'in', 'cm', 'mm', 'pixel', 'pixels', 'dot', 'dots']. Deafults to 'inches'."
Line 5314 ":returns: Returns a 1 if orientation is portrait. Otherwise, it will return a 0, indicating false (not in portrait mode)."
Line 1236 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"

manageElements.py

Line 1242 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1254 ":param projection: Lets you specify a geographic projection used to convert x/y from spherical coordinates into 2D coordinates."
Line 1327 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1333 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1423 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1429 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1515 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1521 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1605 ":param index: Specifies which `pattern <http://uvcdat.llnl.gov/gallery/fullsize/pattern_chart.png>`_ to fill the fillarea with. Accepts ints from 1-20."
Line 1608 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1614 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1691 ":param index: Specifies which `pattern <http://uvcdat.llnl.gov/gallery/fullsize/pattern_chart.png>`_ to fill the fillarea with. Accepts ints from 1-20."
Line 1694 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1700 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1789 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1795 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 1882 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 1888 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 2038 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 2044 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."
Line 2174 ":param color: A color name from the `X11 Color Names list <https://en.wikipedia.org/wiki/X11_color_names>`_, or an integer value from 0-255, or an RGB/RGBA tuple/list (e.g. (0,100,0), (100,100,0,50))"
Line 2180 ":param viewport: A list of 4 floats between 0 and 1. These specify the area that the X/Y values are mapped into inside of the canvas."

To get this current version of docstring_cleanup, you should do git reset --hard upstream/docstring_cleanup. Once you've got that, you can start making changes (which you should submit as a PR to this branch and I'll review).

@@ -1553,3 +1553,9 @@ def png_dimensions(self, path):
img = reader.GetOutput()
size = img.GetDimensions()
return size[0], size[1]

def canvasraised(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chaosphere2112 what is this? The name almost suggest this is a query I would expect it to return True/False shouldn't this be called raiseCanvas ?

Copy link
Contributor Author

@chaosphere2112 chaosphere2112 Jul 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the VTK implementation of this function, which previously said this:

    #############################################################################
    #                                                                           #
    # Raise VCS Canvas to the top of all its siblings.                          #
    #                                                                           #
    #############################################################################
    def canvasraised(self, *args):
        """
 Function: canvasraised                         # Raise the VCS Canvas to the top
 Description of Function:
    This function marks a VCS Canvas as eligible to be displayed and  
    positions the window at the top of the stack of its siblings.
 Example of Use:
    a=vcs.init()
    ...
    a.canvasraised()
"""

        return  apply(self.canvas.canvasraised, args)

https://github.com/UV-CDAT/uvcdat/blob/303c02a32095aa328b5aeba53ef20267e49a63c4/Packages/vcs/Lib/Canvas.py#L7819-L7839

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed handy, so I actually implemented it.

@doutriaux1
Copy link
Contributor

@chaosphere2112 I have one little question.

@chaosphere2112
Copy link
Contributor Author

@doutriaux1 I'm running the test suite on the branch just to double check, then I'll merge.

@aashish24
Copy link
Contributor

@chaosphere2112 is this reviewed by @doutriaux1 and someone else?

@chaosphere2112
Copy link
Contributor Author

@aashish24 It's @embrown's (our intern, Ed) PR, I just cleaned it up a little. It's been reviewed by @doutriaux1 and myself.

@chaosphere2112
Copy link
Contributor Author

@aashish24 I just want to get this merged into master so Ed can start a new branch and continue working ASAP

@chaosphere2112
Copy link
Contributor Author

@aashish24 Feel free to give it a quick perusal as well 😄

@aashish24
Copy link
Contributor

Sounds good @chaosphere2112 I did a quick pass, and it looks good to me.

@chaosphere2112 chaosphere2112 merged commit dedace8 into master Jul 13, 2016
@chaosphere2112 chaosphere2112 deleted the docstring_cleanup branch August 22, 2016 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants