Closed dbanty closed 3 years ago
Overall this is looking great. Some other things I'm thinking about:
Can you configure this to publish somewhere, like RTD, similar to what pyQuil does? (and ensure the check runs on PRs, which could remove the need to add an explicit CI job to test make docs
)
I'm comfortable with the breaking API changes, as I trust your judgement here
The theme is great! Is there a way for users to select dark/light? The dark theme might be harder to read for a docs site. I see a light version on their github page, but it doesn't specify plainly how to select it.
Some items don't seem to be links like I would expect (e.g. Apply qiskit_rigetti_provider.gates.xy.XYGate
on the docs for QuilCircuit.xy
)
There are some pages that seem duplicated. e.g. clicking on the return type of RigettiQCSBackend.run
takes you to http://0.0.0.0:8000/autoapi/qiskit_rigetti_provider/_qcs_job/index.html#qiskit_rigetti_provider._qcs_job.RigettiQCSJob, but this class is already documented on the main page -- there is also no other way to "discover" this page via the menus
Can you configure this to publish somewhere, like RTD, similar to what pyQuil does? (and ensure the check runs on PRs, which could remove the need to add an explicit CI job to test make docs)
I think in order to do RTD this repo needs to be open source. Are we ready to do that yet?
The theme is great! Is there a way for users to select dark/light?
It's based on your system theme! I see the light version, you must be using the dark system theme (or auto and viewing at night).
Some items don't seem to be links like I would expect (e.g. Apply qiskit_rigetti_provider.gates.xy.XYGate on the docs for QuilCircuit.xy)
There are some pages that seem duplicated.
Ick... I think it's doing both of those things because it has the same behavior as autodoc & mkdocstrings in that it uses the fully qualified path for imported types 🙄 rather than using their re-exported path. I'll see if I can find a way to bypass that.
@ameyer-rigetti I believe everything other than deploying is resolved, and we can't deploy until this repo is public.
I think in order to do RTD this repo needs to be open source. Are we ready to do that yet?
OK, we can wait on this then (maybe just a brief GHA job to check that make docs
succeeds in the meantime?). We'll publish this soon, but will wait until after to get docs publishing. Given this, would you also document the make task in the readme, so users can view the docs in the meantime?
It's based on your system theme! I see the light version, you must be using the dark system theme (or auto and viewing at night).
🤯 😮 . Still wonder if there's a way to override -- as I think the light will be readable for most. Just my preference/opinion though, so willing to budge.
Ick... I think it's doing both of those things because it has the same behavior as autodoc & mkdocstrings in that it uses the fully qualified path for imported types 🙄 rather than using their re-exported path. I'll see if I can find a way to bypass that.
Not a blocker. This is all still better than no docs and is something we could improve.
Given this, would you also document the make task in the readme, so users can view the docs in the meantime?
It already is 😁.
🤯 😮 . Still wonder if there's a way to override -- as I think the light will be readable for most. Just my preference/opinion though, so willing to budge.
I think we should defer to what the users want, since that's the reason the browser setting exists and is considered best practice. If we do want to override it with this theme we'd have to manually set all the colors for the dark theme to something lighter (https://pradyunsg.me/furo/customisation/colors/#how-light-and-dark-mode-work).
Note that every browser defaults to light mode unless the user has set it to dark mode. So in my case (with Firefox) I specifically set it to adapt to the system theme, so when my system is dark so are all my websites (e.g. GitHub).
If the dark mode is hard to read, maybe we should just adjust the colors on that mode to still be dark but also be more readable?
@dbanty OK, no worries then. Not worth it to update. I personally like the dark theme on my macOS but prefer light webpages, but I'm guessing users could still change the browser setting independently. Perhaps all that we should do here is simply document in the readme that the light/dark is dependent on user OS/browser settings.
Also note that I merged a new PR. My apologies that there now may be a few more docs strings to update
Also note that I merged a new PR. My apologies that there now may be a few more docs strings to update
BTW, with this change comes some new packages: hooks.pre_compilation
and hooks.pre_execution
. I'm not sure the best approach regarding a single import path (like what you did for other packages/classes), as I'd like to preserve these paths because it makes it clearer whether the hook is meant for thebefore_execute
or before_compile
option when running a circuit (vs importing from the top-level, where the names don't distinguish whether it relates to compile vs execute). Hope that makes sense.
Ready for re-review @ameyer-rigetti
@ameyer-rigetti the typo has been fixed and pytest will run doctests now (good thing, since the example was causing an exception 😅. I also changed around the development docs in the README since:
It also occurs to me that our usage of Makefile is not super friendly to Windows users, so maybe we should link to a recommended way to install GNU make on that platform? I don't have a recommendation, but maybe someone does?
@dbanty
It also occurs to me that our usage of Makefile is not super friendly to Windows users, so maybe we should link to a recommended way to install GNU make on that platform?
Yeah, I don't like make
in general for this exact reason. Your suggestion in the meantime sounds like a reasonable mitigation.
:tada: This PR is included in version 0.3.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Breaking Changes
The breaking change here is to tighten up the public API and only export things from one spot (e.g. instead of exporting
RigettiQCSProvider
from bothqiskit_rigetti_provider
andqiskit_rigetti_provider.qcs_provider
it's only exported from the top module. Doing this early should prevent some of the mess we get in pyQuil with extra paths. It could be that the ideal way to shape this API is not the way I shaped in, so it's worth poking around to be sure.Docstring Changes
There are a few changes to docstrings to make them play nice:
::
down a couple lines) Sphinx does some weird stuff in the summaries.__init__
functions for classes was removed. This is because the docstring of__init__
is treated as an extension of the Class' docstring. I might have missed a couple of those but the intention was to get rid of them so the only thing in the__init__
docstrings areArgs
,Raises
, etc.Sphinx
The main components of the docs are:
sphinx.ext.napoleon
to allow Google-style docstringsHow to test this?
From the project root do
make docs && make serve-docs
then go to http://localhost:8000