Skip to content

Conversation

NelleV
Copy link
Contributor

@NelleV NelleV commented Sep 13, 2016

The previous behavior overwrote the content of the first section with the second.

Now, it raises a value error.

I also added some elements to gitignore for vim users.

closes #64

if not section.startswith('..'):
section = (s.capitalize() for s in section.split(' '))
section = ' '.join(section)
if self[section]:
Copy link
Member

Choose a reason for hiding this comment

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

self.get(section)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why would that be better? If section is not a key of the dictionary (nor starts with ..), an error will be raise later on (l.344). But maybe I am missing something.

Copy link
Member

Choose a reason for hiding this comment

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

you dont want keyerror here for unknown sections

14.9.2016 0.07 "Nelle Varoquaux" notifications@github.com kirjoitti:

In numpydoc/docscrape.py
#65 (comment):

@@ -327,6 +327,11 @@ def _parse(self):
if not section.startswith('..'):
section = (s.capitalize() for s in section.split(' '))
section = ' '.join(section)

  •            if self[section]:
    

Why would that be better? If section is not a key of the dictionary (nor
starts with ..), an error will be raise later on (l.344). But maybe I am
missing something.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/numpy/numpydoc/pull/65/files/c3e60b86bf6e493649d476ad5d5a60b557afaa02#r78653691,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AACI5h84FYPNrWGYb-dMfi3ciFvrIIpsks5qpx59gaJpZM4J76JG
.

@NelleV
Copy link
Contributor Author

NelleV commented Sep 20, 2016

Thanks @pv for the review! I've fixed the issue.

@stefanv stefanv merged commit 22e5080 into numpy:master Oct 4, 2016
@NelleV
Copy link
Contributor Author

NelleV commented Oct 4, 2016

Thanks!

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.

Having section "Notes" twice does not raise a warning, but only renders once

3 participants