Okay *that* worked! Thank you very much!> If _generate_ufuncs.py is in your repo then you aren't working with the master branch of SciPy. It was changed to _generate_pyx.py recently and is now run automatically as part of the build process. Make sure you update (or there will be a ton of merge conflicts when you submit the PR).My repo actually does have _generate_pyx.py which is what I meant; I copied _generate_ufuncs.py from the comment header of add_newdocs.py. In my PR, I'll change these comments so they refer to the new _generate_pyx.py...I'll also fix the reference to "Computation of Special Functions" in my PR unless someone objects...On Fri, 2017-10-27 at 16:46 -0500, Joshua Wilson wrote:Looks like it.Maybe try make html-scipyorg. The first time you try it will probably complain that you are missing a git submodule, but it should also give instructions on how to fix that.> it appears I wasn't running _generate_ufuncs.py beforehandIf _generate_ufuncs.py is in your repo then you aren't working with the master branch of SciPy. It was changed to _generate_pyx.py recently and is now run automatically as part of the build process. Make sure you update (or there will be a ton of merge conflicts when you submit the PR).
> Is there a way of generating HTML that renders the latex equations?
> Is the 2nd author of the first reference misspelledOn Fri, Oct 27, 2017 at 3:56 PM, Adam <Former@physicist.net> wrote:
I figured it out and it appears I wasn't running _generate_ufuncs.py beforehand...That said, the generated HTML still doesn't render my equations as a latex equation. That is to say, my output looks like:Is there a way of generating HTML that renders the latex equations? Like it appears on the https://docs.scipy.org/doc/scipy/reference/generated/sci py.special.hyp2f1.html Bonus question: Is the 2nd author of the first reference misspelled, i.e., Jjie [sic]? Shouldn't the entire reference be:S. Zhang, J. Jin "Computation of Special Functions", Wiley, 1996? See https://books.google.com/books/about/Computation_of_spec ial_functions.html?id=ASfvAAAA MAAJ I can fix the first reference in my PR as well...--AdamOn Thu, 2017-10-26 at 20:52 -0500, Joshua Wilson wrote:I do in fact get a bunch of html in the folders build/html, but the html for hyp2f1 doesn't contain my editsIf I recall correctly, Sphinx doesn't detect changes in the `_ufuncs`extension module. Maybe try forcing a complete rebuild with `makeSPHINXOPTS=-Ea html`.On Thu, Oct 26, 2017 at 8:26 PM, Adam <Former@physicist.net> wrote:Hey guys,How do I view the html version of a functions docstring? I've added myBuhring reference to the docstring and I want to see how it renders in HTML.I've tried both methods described inhttps://github.com/scipy/scipy/blob/master/doc/README.txt but neither ofthem worked.When I try:(scipy-dev) adam@adam-P7xxDM-G:~/scipy-dev/scipy$ python setup.py build_sphinxI get:(...blah...blah...)usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]or: setup.py --help [cmd1 cmd2 ...]or: setup.py --help-commandsor: setup.py cmd --helperror: invalid command 'build_sphinx'When I try :(scipy-dev) adam@adam-P7xxDM-G:~/scipy-dev/scipy/doc$ make html I do in fact get a bunch of html in the folders build/html, but the html forhyp2f1 doesn't contain my edits. I've tried building html afterreinstalling my dev version of scipy, but that didn't change anything.Thanks for any help!--AdamOn Fri, 2017-10-20 at 18:23 -0700, Adam wrote:I can certainly add the formulas to the doc string if that's what peoplewant. My only concern is that the a-b=m case involves about a page offormula's and would take a lot of space in the doc string (I've attached thepdf from my latex file of the formulas). Originally I was thinking that thedocstring would just contain some reference to the pdf document, e.g., "Seethe pdf at location X for the method used when a-b is an integer."But like I said, I can put them wherever they need to go; I justed wanted tomake sure that future maintainers have some reference as to what the code istrying to do...--AdamOn Fri, 2017-10-20 at 08:54 -0400, josef.pktd@gmail.com wrote:One possibility:Currently the only more extensive Latex based documentation is in thetutorial.I think it would be possible to add a technical appendix or something likethatto the scipy.special tutorial, a bit similar to the distributions formulasattached to thestats tutorial.For example Boost, last time I checked, had long documentation for thespecialfunctions, which might be too long to fit in docstrings.I don't know how much there would be for special functions and whether it isdifficult to maintain those notes. However, I think it would be good to havenotes that developers have already written available for futuredevelopers and users that are interested in technical details.JosefOn Fri, Oct 20, 2017 at 2:01 AM, Ralf Gommers <ralf.gommers@gmail.com>wrote:On Thu, Oct 19, 2017 at 8:04 PM, Ted Pudlik <tpudlik@gmail.com> wrote:Concerning the actual formulas: there's a compromise between leaving themimplicit and creating a separate LaTeX doc. You could add the formulas tothe docstring. The LaTeX will render in the HTML version of thedocumentation (example). I'm not sure how the maintainers feel about this,though (this is just a suggestion from a "private citizen").In general: using LaTeX can be a good idea, the one thing that has to bekept in mind is readability as plain text (important both for readingdocstrings in IPython terminal and when working on the code in an editor).Best to add LaTeX formulas to the Notes section rather than in the firstsentences. And avoid usage of things like \left[ that make the rendered htmlslightly prettier but the actual math much harder to read as plain text.Here's a recent PR with discussion about various LaTeX styles:https://github.com/scipy/scipy/pull/7756 . The style that got merged is aboutright.Cheers,RalfOn Thu, Oct 19, 2017 at 11:59 AM Adam <Former@physicist.net> wrote:Okay cool; thanks for the helpful reply!I'll look at Gosper's method and see how it compares with Buhring's method.For now I'll plan on doing a PR that implements one of these two methods. Iwas just worried that I might end up doing a lot of work on a PR thatimplements Buhring's series only to have a reviewer reject it saying "Well,you should have used such-and-such's algorithm which is must faster, muchmore accurate, etc."I'll also hold off on adding a latex doc to the repo of the actual formulasused for the b-a=integer special case (unless I hear otherwise).Thanks again!--Adam-----Original Message-----From: Joshua WilsonSent: Thursday, October 19, 2017 9:35 AMTo: SciPy Developers ListSubject: Re: [SciPy-Dev] Fixing a bug with scipy's hypergeometric functionhyp2f1Hey Adam,Does this sound like a worthwhile PR?Yes, definitelyDoes the implementation sound reasonable?It's been a while since I've thought about this, but if I recallcorrectly the problematic region you've found is one that comes upquite frequently--see e.g. page 14 inFloating around in the ether is a method credited to Bill Gosper forhandling that region which also uses a recurrence relation (mayberelated to/the same as in the paper you cited)? I can never seem tofind the original reference (dead link), but I've attached someone'swriteup of it.So, your implementation sounds reasonable, but if you really want todig into it you could check out the Gosper stuff and see how theycompare.Can the PR implement formulas/methods that don't appear in the literature?Is it going to be a problem if I implement this limit case in the PR?It's implicit in the literature, so I think it's fine.I don't what reference I would place hyp2f1's doc stringThe Buhring paper. The formula is something that an informed readercould figure out after reading it.I would be wiling to maybe add a latex doc to the PR (placed somewhere inthe doc folder?)If I recall correctly people were opposed to adding LaTeX docs. (Butmaybe I recall incorrectly; if so please someone correct me.) I alsohave various special function write ups that might be handy for futuredevs... maybe in a separate repo?On Wed, Oct 18, 2017 at 6:47 PM, Adam <Former@physicist.net> wrote:Hello guys,I've found a small region in the complex plane where scipy'simplementationof the hypergeometric function hyp2f1 fails. I've documented this error inissue 8054 on github.I am willing to submit a PR that fixes this issue. My PR would basicallyimplement the analytic continuation formula given in this paper: (Buhring,An Analytic Continuation of the Hypergeometric Series). I've alreadyimplemented this series in some prototype code written in Fortran and itagrees well with the values returned by mpmath's implementation of hyp2f1.Before I attempt a PR, I just wanted to touch base and ask the group thefollowing:1) Does this sound like a worthwhile PR? The failure region is somewhatsmall and I don't know with what urgency people would want this fixed.2) Does the implementation sound reasonable? My background is physics andsoI haven't done a complete literature search looking for the *fastest*algorithm. All I can say that the Buhring's formula works and myimplementation only seems to be about %50 slower than the current hyp2f1(atpoints in the complex plane where both methods converge). I would onlyapplyBuhring's series in the region where hyp2f1 currently diverges.3) Can the PR implement formulas/methods that don't appear in theliterature? Buhring's paper *only* gives the analytic continuation for thecase where the difference between the a/b parameters is NOT an integer.Whena-b=m, the limit case of his series can be derived using a methoddescribedin "The Special Functions and Their Approximations" by Y. Luke (as Buhlingmentions in his paper). I've derived the formula for this limit case andhave an implementation of it that produces values in agreement withmpmath.Is it going to be a problem if I implement this limit case in the PR? Iaskbecause I don't what reference I would place hyp2f1's doc string. I wouldbewiling to maybe add a latex doc to the PR (placed somewhere in the docfolder?) that contains the formula so that future scipy devs havesomethingto reference when reviewing hyp2f1's source code.Anyways, let me know if my idea for a PR sounds like a good idea! Iapologize for the longish email, but this is my first time trying tocontribute to scipy...--Adam_______________________________________________ SciPy-Dev mailing list_______________________________________________ SciPy-Dev mailing list_______________________________________________ SciPy-Dev mailing list_______________________________________________ SciPy-Dev mailing list_______________________________________________ SciPy-Dev mailing list_______________________________________________ SciPy-Dev mailing list_______________________________________________ SciPy-Dev mailing list_______________________________________________ SciPy-Dev mailing list_______________________________________________ SciPy-Dev mailing list
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev@python.org
https://mail.python.org/mailman/listinfo/scipy-dev _______________________________________________ SciPy-Dev mailing list SciPy-Dev@python.org https://mail.python.org/ mailman/listinfo/scipy-dev
_______________________________________________
SciPy-Dev mailing list
SciPy-Dev@python.org
https://mail.python.org/mailman/listinfo/scipy-dev