Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix ufunc documention#4400

Merged
charris merged 3 commits into
numpy:masterfrom
charris:fix-ufunc-documention
Mar 1, 2014
Merged

Fix ufunc documention#4400
charris merged 3 commits into
numpy:masterfrom
charris:fix-ufunc-documention

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Mar 1, 2014

Updates the fmod and remainder documentation, and inserted the frexp and ldexp documentation into
umathmodule where it currently needs to go.

Closes #3563 and closes #2354.

Some bits are also rephrased and nan is replaced by NaN where
appropriate.
The documentation needs to be in umathmodule.c as that is where ldexp
and frexp and defined. I moved the current documention from
add_newdocs.py to ufunc_docstrings.py, manually translated them into C
strings, and inserted them into umathmodule.c.

Closes numpy#2354.
charris added a commit that referenced this pull request Mar 1, 2014
@charris charris merged commit 50da92a into numpy:master Mar 1, 2014
@charris charris deleted the fix-ufunc-documention branch March 1, 2014 14:03
@juliantaylor
Copy link
Copy Markdown
Contributor

why does add_newdoc not work for ldexp/frexp?

@juliantaylor
Copy link
Copy Markdown
Contributor

ah right its in the commend, ufunc_docstrings.py is not used yet

@juliantaylor
Copy link
Copy Markdown
Contributor

no wait why does it work for the other stuff in ufunc then?

@charris
Copy link
Copy Markdown
Member Author

charris commented Mar 1, 2014

The docstrings need to be part of the C code. For most ufuncs the code is generated during build from the specs in generate_umath.py. The frexp and ldexp ufuncs aren't there, mostly (I think) because of the #ifdefs. In any case, they are still defined in umathmodule rather than generated. I've been planning to see if there was a fix for that for maybe 5 years, but have never gotten around to it. The current fix is basically duct tape but it gets the job done.

@charris
Copy link
Copy Markdown
Member Author

charris commented Mar 1, 2014

Also, frexp has two returns of mixed type, and ldexp has two arguments of mixed type. IIRC, the generate_umath.py machinery doesn't deal with those cases.

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.

Confusing documentation for remainder and fmod add docs for ldexp and frexp (Trac #1759)

2 participants