-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Prototypical docscraping using numpydoc #3859
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
Conversation
What do you think about a primitive extraction using following regex:
It would match typical docstrings for parameters in numpydoc format and also google style, if the first line only contains a short description/type |
Ok, this is getting insane. It is bad enough that we do the whole property On Fri, Nov 28, 2014 at 1:17 PM, Lennart Fricke notifications@github.com
|
That requires enough introspection to know what the first parameter is? I suspect we are going to end up implementing/copying over a hacked down version of numpydoc which just does the Parameters section. I wonder if this is an application for pyparsing (which we already have as a dependency) , but that might be a quagmire. |
@WeatherGod I would not call it expanding, just trying to not break what already exists while updating docstrings to numpydoc format. |
sigh... yeah, I see what you mean. So, I would think that using pyparsing On Fri, Nov 28, 2014 at 1:41 PM, Thomas A Caswell notifications@github.com
|
@tacaswell If you introspect the function the first parameter using @WeatherGod Would adding the accepted values and/or alias as a method attribute be an idea? |
For me a remaining issue is that some setter methods accept more than one parameter. |
method attributes? intriguing thought. I would prefer if it was the same On Fri, Nov 28, 2014 at 1:47 PM, Lennart Fricke notifications@github.com
|
Do you mean the |
As it seems using numpydoc is mostly ruled out. Shall I close the PR then or do we leave it open to track the issue. |
Yes, the docstring.Substitutions. The property lists (probably should have I would leave this open for the moment in case a better solution can't be On Fri, Nov 28, 2014 at 2:01 PM, Lennart Fricke notifications@github.com
|
On a related note. There is an issue with scraping of set_boxstyle in patches.py as seen in the doc builds
Happens because the accepts line is:
Which inserts a complete pretty printed table as far as I can see. It also results in the ACCEPTS being missing from http://matplotlib.org/api/patches_api.html |
Just more evidence that doc-scraping is a bad idea. On Sat, Nov 29, 2014 at 5:58 AM, Jens Hedegaard Nielsen <
|
In the defense of docstring scraping, it does provide single point of information. That said, having a dictionary of docstrings that everything refers back to is probably better path, something like doc_string_dict = {'set_color':{'full_doc': '....', 'table_row': '...'}, ... } we can then assign the doc-strings as needed and probably write a smarter table generator. |
I am going to close this in favor of going the other way of hanging information off of functions/objects that is machine-readable and use that as the authoritative source to construct both the docstrings, the kwarg tables, and do validation, not the other way around. Please don't be discouraged from contributing in the future, this is not a bad idea (we are doing something like this in my day-job), just not the right solution in this case. |
This is a prototype for adding numpydoc format docstring parsing for the property tables.