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

2060_acceptance_review #84

Merged
merged 34 commits into from Aug 2, 2017
Merged

2060_acceptance_review #84

merged 34 commits into from Aug 2, 2017

Conversation

ijiraq
Copy link
Collaborator

@ijiraq ijiraq commented Jul 26, 2017

Improved documentation. Passes most integration tests.

ijiraq and others added 30 commits June 6, 2017 12:16
… avoid re-mapping the word builtins in setup.
Also cleaned up some blank space issues.
In the previous commit the chance that the variable 'cutout' might
be undefined, because this isn't a cutout call, was overlooked. Just
catch this possibility and ignore the cutout building step.

Also, the new path matching pattern is a bit more generic but also
weaker if the path contains characters that are not normal so the path
needed to be normalized first.
The astropy template uses the definition of the _PACKAGE_SETUP_
variable to help the test system to know if a module is being called
during the setup.py process.  This is no longer used by vostools
This changes are all to bring code in line with PEP 8 format
and add documentation.  Also added some TODOs where code modifications
would be good for long term maintenance.
This also involved re-arranging how the parameters are set as we're migrating to argparser.
…sage reporting

The open command in some of the methods were being passed unicode strings but expected str so I cast to str.
Copy errors now reported more cleanly to the user.
This is a major rework of how the help messages are handled and how arguments are parsed.
Now rely on argparse to get required arguments and do counting of these arguments.
This commit also did minor PEP8 cleanup.
Copy link
Contributor

@andamian andamian left a comment

Choose a reason for hiding this comment

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

I don't like relative imports. They come handy when code within the package is moved around. However, the can be a big pain if you for example want to do a quick test in the file by throwing in a "main". In that case the relative imports stop working unless you invoke the file as a module or define a package var. IMO, at least in our case, the drawbacks of using relative imports outweigh the benefits and I've decided to avoid using them.


(opt, args) = parser.parse_args()
parser.process_informational_options()
parser = CommonParser(description=description)
Copy link
Contributor

Choose a reason for hiding this comment

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

description is not defined and it's currently failing.

Isn't it simpler to make the description the doctring of the vcat function and pass it to CommonParser as CommonParser(description=vcat.doc)? (double underscore around doc)

where RA, DEC and RAD are all given in degrees

If no X509 certificate given on commnad line then default location will be used.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the default location?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Default location should be spelled out as ${HOME}/.ssl/cadcproxy.pem

"(?P<ra>[\-\+]?\d*(\.\d*)?),"
"(?P<dec>[\-\+]?\d*(\.\d*)?),"
"(?P<ra>[\-+]?\d*(\.\d*)?),"
"(?P<dec>[\-+]?\d*(\.\d*)?),"
Copy link
Contributor

Choose a reason for hiding this comment

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

Backslash removed unintentionally? They seem to be needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The backslashes are not needed here. At least that's what my testing shows.

else:
length = str(int(size))
return "%12s " % length
def get_terminal_size():
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used anywhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm. I think get_terminal_size was in use at one time. Perhaps not any more. The idea was to do column display of file names. I think I couldn't get this working the way I wanted and so never used in production.


class CommonParser(argparse.ArgumentParser):
Copy link
Contributor

Choose a reason for hiding this comment

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

Too bad we could not come to a common approach with the rest of the CADC apps. In essence, this does the same thing (although differently) with the code in cadcutils.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One parser to rule them all!

@ijiraq
Copy link
Collaborator Author

ijiraq commented Jul 28, 2017

I've pushed changes to address the issues you raised and fix the DESCRIPTION variable. However I still use imports with implicit path structure. We should discuss this and figure out if there is best practise somewhere.

@andamian
Copy link
Contributor

andamian commented Jul 28, 2017 via email

@ijiraq ijiraq merged commit d33ec7e into master Aug 2, 2017
@ijiraq ijiraq deleted the 2060_acceptance_review branch August 2, 2017 22:44
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

2 participants