You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@cadenmyers13 when this is done let me know and I will merge to main. Let's do the docs on a separate PR. Please could you do me a favor and make an issue to do that?
@sbillinge
Running make html in the upstream/migration raises
AttributeError: module 'docutils.nodes' has no attribute 'reprunicode'
It can be fixed by replacing m2r in docs/source/conf.py with m2r2. After removing the two diffpy.srfit.example_package.rst and diffpy.srfit.rst example files, there are still a lot of errors. Mainly due to that sphinx can't parse the old docstring style in the src.
e.g. diffpy.srfit.equation.builder.EquationFactory.makeEquation
Arguments
eqstr -- An equation in string form using standard python
syntax. The equation string can use any function
registered literal or function, including numpy ufuncs
that are automatically registered.
It will get ERROR: Unexpected indentation.
These kinds of errors are everywhere because the docstring is not written a way sphinx can parse. Do we want to rewrite all the docstrings, or come up with some temporary solutions?
Temporary solutions like
Arguments
---------
eqstr -- An equation in string form using standard python
syntax. The equation string can use any function
registered literal or function, including numpy ufuncs
that are automatically registered.
can mute the errors. But the api still can not be rendered because sphinx can't parse them correctly.
We can also remove the section for the package API in this release and rewrite the docstring later.
Here is my suggestion. If the docstrings are sufficiently "normalized" in a format, could we write a quick converter function that will put them to the desired format?
Please could you also check other packages that were written around the same time, like diffpy.structure and so on. What do the docstrings look like there?
Initially, we can release without API docs built, but it would sure be nice to have the API docs rendering properly in the long run. Could you look into it and we can decide. If we do this, chatgpt can help, but we should test on just a few docsstrings and really check it carefully before running on everything.
Please could you also check other packages that were written around the same time, like diffpy.structure and so on. What do the docstrings look like there?
diffpy.pdffit2, diffpy.srfit, and diffpy.srreal use a similar dostring style that sphinx can not read. pyobjcryst uses rst style docstring instead of numpy docstring style.
sounds good. I expect that sphinx can handle rst so let's not change those, but if we can find a way to "auto-fix" the others it will be very beneficial. Can you see a way to get there with a script? Before applying it to everything, let's iterate all the way to building the API docs but just for 2 or 3 docstrings. When we are confident it is working quite well we can apply it to everything.
Just take one module and put it into a separate directory to do the testing, sthg like that.
Activity
sbillinge commentedon Jun 26, 2025
We should talk to Andrew about this. Ideally we want to move away from the old manual workflow.
sbillinge commentedon Jun 26, 2025
....but thanks for pointing this out, I had overlooked it.
sbillinge commentedon Jun 26, 2025
@cadenmyers13 do you have any cmi scripts you can quickly run to test the code in the migration branch?
cadenmyers13 commentedon Jun 26, 2025
@sbillinge Let me look
Also, i realized this was done in the migration branch (sweet!) so we can close this issue
sbillinge commentedon Jun 26, 2025
workflow:
sbillinge commentedon Jun 26, 2025
@cadenmyers13 when this is done let me know and I will merge to main. Let's do the docs on a separate PR. Please could you do me a favor and make an issue to do that?
cadenmyers13 commentedon Jun 26, 2025
@sbillinge Okay I tested some (rather horrible lol) fits for Jon Owen's group and got the same results for the same data so it looks like its working!
diffpy.srfit on python 3.7


diffpy.srfit on python 3.12
sbillinge commentedon Jun 27, 2025
urgh, the fits are hoorible, but also the colors. Please don't tell me you are not using the group matplotlib style files......?
but thanks for testing!
cadenmyers13 commentedon Jun 27, 2025
@sbillinge no these are the python default colors
[-]skpkg: Move `doc/manual/source` to `doc/source`[/-][+]doc: fix documentation rendering[/+]ycexiao commentedon Jul 25, 2025
@sbillinge
Running
make htmlin theupstream/migrationraisesIt can be fixed by replacing
m2rindocs/source/conf.pywithm2r2. After removing the twodiffpy.srfit.example_package.rstanddiffpy.srfit.rstexample files, there are still a lot of errors. Mainly due to thatsphinxcan't parse the old docstring style in thesrc.e.g.
diffpy.srfit.equation.builder.EquationFactory.makeEquationIt will get
ERROR: Unexpected indentation.These kinds of errors are everywhere because the docstring is not written a way
sphinxcan parse. Do we want to rewrite all the docstrings, or come up with some temporary solutions?Temporary solutions like
can mute the errors. But the
apistill can not be rendered becausesphinxcan't parse them correctly.We can also remove the section for the package API in this release and rewrite the docstring later.
sbillinge commentedon Jul 25, 2025
yah, we didn't work on the docs for this.
Here is my suggestion. If the docstrings are sufficiently "normalized" in a format, could we write a quick converter function that will put them to the desired format?
Please could you also check other packages that were written around the same time, like diffpy.structure and so on. What do the docstrings look like there?
Initially, we can release without API docs built, but it would sure be nice to have the API docs rendering properly in the long run. Could you look into it and we can decide. If we do this, chatgpt can help, but we should test on just a few docsstrings and really check it carefully before running on everything.
ycexiao commentedon Jul 25, 2025
diffpy.pdffit2,diffpy.srfit, anddiffpy.srrealuse a similar dostring style thatsphinxcan not read.pyobjcrystusesrststyle docstring instead of numpy docstring style.sbillinge commentedon Jul 25, 2025
sounds good. I expect that
sphinxcan handle rst so let's not change those, but if we can find a way to "auto-fix" the others it will be very beneficial. Can you see a way to get there with a script? Before applying it to everything, let's iterate all the way to building the API docs but just for 2 or 3 docstrings. When we are confident it is working quite well we can apply it to everything.Just take one module and put it into a separate directory to do the testing, sthg like that.
sbillinge commentedon Jul 25, 2025
this kind of hack is a good use of chatgpt too