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

DM-15004: Upgrading display_ds9 to numpydoc status #12

Merged
merged 7 commits into from Mar 22, 2019
Merged

Conversation

ebellm
Copy link
Contributor

@ebellm ebellm commented Dec 19, 2018

No description provided.

@@ -61,8 +61,12 @@ class Ds9Error(IOError):


def getXpaAccessPoint():
"""Parse XPA_PORT and send return an identifier to send ds9 commands there, instead of "ds9"
If you don't have XPA_PORT set, the usual xpans tricks will be played when we return "ds9".
"""Parse XPA_PORT if set and return an identifier to send `ds9` commands.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think ds9 should be in double-backticks (here and elsewhere), since we're treating as the name of the external program rather than a cross-reference within this documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, probably in a :command: role, rather than double backticks.

Notes
-----
If you don't have XPA_PORT set, the usual xpans tricks will be played
when we return `ds9`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we are returning the string "ds9", not a cross reference.

@@ -78,7 +82,13 @@ def getXpaAccessPoint():


def ds9Version():
"""Return the version of ds9 in use, as a string"""
"""Get the version of `ds9` in use.
Copy link
Contributor

Choose a reason for hiding this comment

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

(Same comments as above)


Parameters
----------
size : `int`, optional
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look optional from the argument list above.

size of buffer.
Default is -1: largest possible given bugs in xpa
silent : `bool`, optional
Do not print error messages (default `True`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty sure Sphinx is smart enough to extract default values for us automatically, so we don't need to list them. Should check that though.

points : `list` of (`int`, `int`)
a list of points specified as (col,row)
ctype : `str`
the name of a colour (e.g. 'red')
Copy link
Contributor

Choose a reason for hiding this comment

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

How about:

e.g. ``"red"``

?

Parameters
-----------
points : `list` of (`int`, `int`)
a list of points specified as (col,row)
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs a space between col, and row.

----------
algorithm : `str`
Scale algorithm
e.g., linear|log|pow|sqrt|squared|asinh|sinh|histequ
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually e.g., or is this a complete list? Is this a list of algorithms understood by ds9, or understood by afwDisplay?

minimum value for scale
max : `float`
maximum value for scale
unit : unused
Copy link
Contributor

Choose a reason for hiding this comment

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

Should mention *args & **kwargs, although they seem to be unused.

cmd = selectFrame(self.display.frame) + "; "
# ds9 is 1-indexed. Grrr
cmd += "pan to %g %g physical; " % (colc + 1, rowc + 1)

ds9Cmd(cmd, flush=True)

def _getEvent(self):
"""Listen for a key press on frame in ds9, returning (key, x, y)"""
"""Listen for a key press on frame in ds9.
Copy link
Contributor

Choose a reason for hiding this comment

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

On a frame?

@ebellm ebellm merged commit 934e247 into master Mar 22, 2019
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.

None yet

4 participants