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

Review for DM-3811(HSC backport: Include documentation strings for config parameters when they are dumped) #2

Merged
merged 3 commits into from Oct 10, 2015

Conversation

jdswinbank
Copy link
Contributor

No description provided.

@PaulPrice
Copy link
Contributor

I'm surprised about "Add unnitest for None as docstring", because I don't think we want to allow empty docs. Ever. I think that instead, we should assert that the doc entry is non-None in Field.__init__.

@@ -44,6 +44,7 @@ class Simple(pexConfig.Config):
d = pexConfig.DictField("dict test", str, str, default={"key":"value"},
itemCheck=lambda x: x.startswith('v'))
n = pexConfig.Field("nan test", float, default=float("NAN"))
m = pexConfig.Field(None, int, optional=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The HSC commit you're cherry-picking this from is described as "allow None as documentation string". Is that actually something we want? It doesn't sound like a very good idea.

@laurenam
Copy link
Contributor

laurenam commented Oct 9, 2015

@PaulPrice & @jdswinbank,
The HSC issue:
https://hsc-jira.astro.princeton.edu/jira/browse/HSC-1175
certainly implies that this case was encountered & allowed for, although I admit I couldn't glean from the comments exactly what the particular "case" was (i.e what config had no doc string and why this was deemed ok). Perhaps @RobertLuptonTheGood could weigh in here?

@RobertLuptonTheGood
Copy link
Member

The correct solution is to enforce doc strings to never be None (that's probably in pipe_base), but until that's propagated through everywhere this was necessary defensive programming -- I found cases that the code failed on without this check.

rearmstr and others added 3 commits October 9, 2015 17:34
Following the discussion on DM-3811, the consensus was that
having the doc strings print as true comments (i.e. first
character in line is '#') is the best option.
@laurenam laurenam merged commit da6fc20 into master Oct 10, 2015
@ktlim ktlim deleted the tickets/DM-3811 branch August 25, 2018 05:50
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

6 participants