-
Notifications
You must be signed in to change notification settings - Fork 25
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
Automatic HTML Documentation Mola #41
Comments
i tried this (for single files it works, but not for the package) |
I think pdoc3 is maybe a good and simple choice. |
I still get errors when i try to generate the html on my computer. any ideas? it should be straightforward. |
Changed the file structure a bit to have the repo contain the package, instead of "being" the package, see below. I also had to excluded
|
Amazing! We will check this. |
@tetov what was the trick with the doc creation? |
Not much of a trick, it's mainly moving python modules to a folder to make it more of a typical package. Try running it with the folder structure in this branch:
compas is only there so it can be imported for I would set up a travis job or github action to generate the docs and push them to branch
Code above would build docs, create a new repository inside the folder with the documentation and then force push that to branch gh-pages. |
hey anton @tetov thank you very much for the proposal. i cloned your fork and tested building the docs. works smoothly, great! before we publish it to gh-pages, i would have a question regarding layout: do you know how we would have to either change the docstrings or the css to have the html doc more closely reflecting the source code, i.e. have |
cool. will the break be visible in the colab popup window? |
In markdown one linebreak on it’s own is ignored, you need two. I would change it to use NumpyDoc/ReST-like instead since a lot of docs are quite close to that (or maybe closer to Google style). If you are ok with this folder structure change, then I can submit a PR to make mola pip installable. That will make integration into Rhino easier ( |
thanks. i would strongly suggest we keep different ideas separate. for the ACDC course (the primary use of mola) we don't need rhino integration and also no compas. so ideally we find a good solution for the docs first, as a reference for all students and pure mola only. compas/rhino/xy?? integration should be handled separately |
Haven't used colab much at all, but making it a package (and potentially publishing it to pypi) would make it easier to install there as well, right? |
how do you mean "instead", instead of pdoc3? or as a formatting style for docstrings like here? furthermore, i would suggest to have what do you think? |
yes, but as we keep adding features (and bugfixes) during the courses, it is even easier to just run as a first cell
then they always have the latest version |
This is the first time I've worked with pdoc3, so I haven't tested this but my assumption would be that adhering to a standard docstring format would make the docs render nicer output that just parsing it as markdown. And yes, I mean numpy docstyle or google docstyle (both are supported :). So far I haven't found a config option in pdoc3 to set the style so maybe this is a moot point though. |
Sorry, I managed to post before I finished the comment. I understand that workflow, but a) same could be done using |
Then it needs to be And if you have only one package in your repo you can skip having |
ok, i see and agree. so:
|
I agree, naming the folder |
having a pip installable package is a nice idea to definitely keep in mind for the (near) future as well! but first and foremost, let's build those docs. |
Yeah, I agree. I meant that more as an additional reason to restructure all files ;). (Only extra thing needed would be a short Let me know if you need my help with setting up CI. |
Looking closer at this, I'd guess that the docstring parser is confused by the variable name "x1,y1,z1" as it contains commas (because I don't think it will parse it as three different variables with the same description). |
indeed, this seems to be the reason as for single variables it works. good catch! |
No, that would not really be good practice. You should instead put mola top level directory in your python search path. So generic way would be:
Pip install would put the mola/mola folder in the environments site-packages folder which is in the python search path by default (which is how compas gets the packages under src on path).
EDIT: @worbit could you please share a colab notebook where mola is imported using the current setup? |
Ok! The current directory is always part of the python search path, so in colab you currently don’t have to worry about search paths at all.. I would suggest then that for the colab use case you should change the first import statement to
In other circumstances you either add the path to the repository to the search path or you install it using pip. |
Now I understand why the current repo has the python modules in the root folder :). It makes a lot of sense for a setup like colabs’. I’m sure we could get pdoc3 or another tool to work with current setup, but using a more conventional structure will make this tool as well as future tools easier to integrate. And it only requires changing one line in the colab environment :). |
From a user perspective, we believe that for auto-complete the separation of parts of the code via dot is most convenient. So if one writes mola. some (but not all) functions appear and if someone writes mola.colab3D. functions related to those render methods appear. I believe this aspect has the highest priority. Changing one or two lines in the import statement and changing folder structures within mola would be acceptable, if we, therefore, gain nice documentation and compatibility with other tools. |
No description provided.
The text was updated successfully, but these errors were encountered: