-
-
Notifications
You must be signed in to change notification settings - Fork 216
Documentation overhaul and restructuring #3505
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
Comments
We generally just do not document the kwargs that are internal. For ODESystem for example we do not document any of the keyword arguments. https://docs.sciml.ai/ModelingToolkit/dev/systems/ODESystem/#ModelingToolkit.ODESystem notice that no I think the bigger thing is that the API parts of the MTK documentation just need a complete overhaul. The issue that we had before was that there was no docstring repetitions allowed. This meant that if you used Now you can set a canonical location, so in theory all of those weird little "use these functions" things should be changed to the docstrings. And in the docstrings we then fully document the public API. But it would probably be nice to extend the SciMLStyle to have some documentation style for how to handle private API, since in MTK some of this is used to signal to other authors since the compiler can get complicated. So this is going to be a significant effort to get us onto the right track. I want to pull @asinghvi17 into some of this since he always has good ideas, at least for the design, and it's good to have a newer set of eyes that doesn't know everything already. @vyudu @asinghvi17 @AayushSabharwal let's come up with a plan next week for a documentation structure that will scale better here, and reset the docs to this structure. I think we have a lot of the content already written but I think the structure needs a rethink. |
Documentation is always the never ending task, isn't it? I guess one thing which makes MTK documentation tricky is that, as a package, it essentially serves two roles. It is both a modelling package that users can use to build their models directly, but also an internal representation for packages like Catalyst (and MTK itself). There is much overlap, but it might make sense to (at some point) have specific documentation aimed towards package developers who might like to use the MTK internal representation (either for building a new modelling package, or for hooking a package that does some form of analysis into the SciML system). Long-term, I think a goal should be to attract as many non-SciML developers to hook into the SciML intermediate representation, this could potentially amplify MTK's impact manyfold. As part of this it would make sense to point out that this is something the system is designed with in mind, and offering appropriate support. (Finally some pure dev docs for MTK itself would also be great, but that is probably something for further into the future) |
I just wanna make sure that this is known, that now documenter does allow for docstrings to be repeated: https://documenter.juliadocs.org/stable/man/syntax/#noncanonical-block |
Yes keyword |
Maybe I'm biased, but I've always been a fan of Agents.jl's documentation. I'm basing my suggestion below off of it.
I'm basically thinking out loud as I write this, so there is definitely scope for improvement. Hopefully it is a decent starting point. |
This generalizes well to an extra "integrations" page, that Agents.jl also has. The BifurcationKit.jl and Attractors.jl "Examples" can go there. So can a small example showcasing of Catalyst.jl? I don't know how many MTK users automatically know Catalyst as well. |
I think one problem is that MTK's doc (which has actually gotten quite good) have been written quite incohesively, and especially from different times of a package that have evolved quite a lot. I think if/when things stabilise it might make sense to sit down and think about how to do it. However, I still think it might be nice to split it into three sections:
Then within those one could split things further. |
That's a very good point. I think @AayushSabharwal 's proposal + the split of the Manual / API pages into those 3 groups is a nice format.
Not quite. SciML/SciMLDocs#108 is a good read and has a bit on this. We should have API material included, yes, that is a major issue with the current MTK pages. But, every page with API needs a high level summary that explains what the API pieces are going to mean. Two pages that I would point to are:
Notice that the meat of the information comes from API docs, very complete docstrings, but it's organized with summaries and such to make the page clearly flow. So when I look at for example https://docs.sciml.ai/ModelingToolkit/dev/systems/ODESystem/, the issue here is that it's not a complete API dump.
This section is just bad 😅 . What we need to do is make all of those just show docstrings that are completely documented according to the style guide (i.e. documenting arguments, etc.) https://github.com/SciML/SciMLStyle?tab=readme-ov-file#documentation . So the issue is that the system pages should be amazing. The ODESystem page should be "show me every function I can call on ODESystem, and organize it into different headers". What has gone wrong with the API pages is that Documenter.jl used to not allow for putting the same docstring onto two different pages. This meant that we could not put a docstring of I think one of the other things that has gone wrong is that https://docs.sciml.ai/ModelingToolkit/dev/basics/AbstractSystem/ is supposed to be a page on "things you can do to all systems", which I don't think comes across well. No one goes to this page. I think any function here should be repeated to the specific systems, it's okay to duplicate. This page should document the interface and the shared functions, but we shouldn't require someone to understand an AbstractSystem to know that ODEsystem can do |
Speaking generally I would agree with Aayush and Torkel's points: we need to speak different languages for different audiences. MTK can be arcane if not viewed with the proper context, so we need to lead first time users down the garden path to get that context in an engaging way before they lose interest. When I look at the ODESystem page, one thing I notice is that there are a lot of places where we should insert cross references. Having docstrings embedded in the page is IMO not immediately a good idea - there is too much for a user to go through. I actually quite like the "invocation and brief description" style of function index that we have there. But we could expand on that in two ways:
which would expand to something like [`get_eqs(sys)`](@ref get_eqs) or [`equations(sys)`](@ref equations): The equations that define the ODE.
get_unknowns(sys) or unknowns(sys): The set of unknowns in the ODE.
get_ps(sys) or parameters(sys): The parameters of the ODE.
get_iv(sys): The independent variable of the ODE.
get_u0_p(sys, u0map, parammap) Numeric arrays for the initial condition and parameters given var => value maps. (insert all the rest of the refs at your leisure, I didn't want to write all of them out :D) The next stage after that would be to have a short popup along with the docs. But I imagine even this would be a good start. The next step for that block would be to do something like this, a collapsed block of docs blocks: ![]() but with the "Function" word replaced by the short description of the function. That's probably the best of both worlds: you can view the docstring without a context switch but at the same time have a high level overview. If there are examples associated with the functions, we could also engineer some way to link those from later on in the page. |
I don't think we need (or should) rush into things, especially while MTK is seeing some amount of flux. But considering some stuff that Chris was mentioning about future workflows where Chris mentioned that users might not create specific systems or problems, but just do
Another thing that is a bit confusing is that models can be created using both macro and programmatical methods. But it feels a bit haphazardous when which approach is used is actually used, and these could be introduced better. |
I really second that, and for me this was always a struggle to navigate this in the docs and as a user and as a developer. Both as a user and as a developer I always want to rely on programmatical, and simplest, methods. So for me the |
Yeah so |
I don't think |
I would also prefer writing my models programmatically with |
I usually use the progrmmatic approach, but mostly because I haven't bothered learning the macro properly (and last time I read through the MTK docs from start to finish it wasn't that well described, but it might be different now). Long-term, I wouldn't be surprised if it became the standard approach, though. |
I would think that the best way to show the equations would be with their LaTeX rendered format, in which case the equations vector passed into the |
All my components are in one big Literate.jl file, which makes it easy to collabarate since there's only "one language". My non-programming colleagues can even do PRs every once in a while, it's a nice setup. In any case, |
…); Added troubleshooting guide for detection process (SciML#515)
I've submitted a PR that refactors the ODESystem composition and accessor function docs as discussed here: #3505. |
Per recent discussions we've been told that Catalyst has been using private kwargs in system constructors in some cases. For example,
observed
was mentioned (though as I previously mentioned, we use it because of the discussion in #1343 for which I thought we had been ok'ed to pass explicit observed equations -- as common in SBML and other bio file formats).It would be nice to update the API documentation or doc strings within the systems to make clear which kwargs are API and which are intended to be internal. This really isn't clear to me at this point, which makes it challenging to know which ones we can use from Catalyst.
The text was updated successfully, but these errors were encountered: