Skip to content
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

Generate documentation #43

Open
3 tasks
EmiliaJarochowska opened this issue Aug 5, 2024 · 10 comments
Open
3 tasks

Generate documentation #43

EmiliaJarochowska opened this issue Aug 5, 2024 · 10 comments
Assignees

Comments

@EmiliaJarochowska
Copy link
Contributor

We want to work towards a release, so a simple documentation is needed. I guess only for users, not developers. Perhaps a few typical tasks are expected:

  • changing the solver
  • setting what is saved as output (how many dts are saved, we ourselves struggled with it a bit]
  • saving U at the bottom

Plotting doesn't need to be addresses because we have a separate repo for this, Cross-comparison. This will need to be tidied up a bit separately. This issue is related to #37

@HannoSpreeuw
Copy link
Contributor

  • saving U at the bottom

Will be left out, see remark from PR #44 .

@EmiliaJarochowska
Copy link
Contributor Author

Let's make it pragmatic. What documentation system (for python) are you (most) familiar with, @HannoSpreeuw ?

@HannoSpreeuw
Copy link
Contributor

No recent experience in writing user documentation, only developer documentation, in my case that just meant writings docstrings, sorry.

So I asked the colleague sitting next to me: Which documentation system would you use when writing a tutorial from scratch?

readthedocs, he replied and he especially liked a recent project where a Jupyter notebook was integrated in this documentation system.

Pls let me know how you feel about this.

@HannoSpreeuw
Copy link
Contributor

But there are quite a few options available with e.g. GitBook and Doxygen being viable alternatives.

@EmiliaJarochowska
Copy link
Contributor Author

That is a nice example, but using a responsive format such as a notebook is applicable if there is an API, in our case user sets all the parameters in one script and then runs one command. For running one command, you don't need a notebook.

This is scientific, not utility software, so the users will engage with the code. So that's ok to only write developer documentation, but the current one is not sufficient. Docstrings can be the biggest part of it, but maybe you could move them a bit closer to PEP 257? As for the rest, I think I could try to list the tasks users (including future us) would typically try to do, but I need a week or so.

I think it is also ok if you don't want to write documentation.

@HannoSpreeuw
Copy link
Contributor

After consulting @jhidding I will go for pdoc.

@EmiliaJarochowska
Copy link
Contributor Author

Looks as good as anything else; I imagined @jhidding would recommend entangled, but I guess there was a reason not to.

@jhidding
Copy link
Contributor

jhidding commented Oct 7, 2024

Entangled doesn't include a document generator (i.e. in CarboKitten this is Documenter.jl). The most used document generator for documenting Python projects is Sphinx, which has many options and extensions but is not so nice to work with. I've seen some projects that used MkDocs, but its API documentation generation is less than stellar. For smaller projects I have worked with pdoc which has a more minimalistic approach. It requires no configuration. Rather, it will read the doc-strings in your module and generate a documentation page from that. Combine that with sourcing an extensive README into that documentation and that's perfect for small projects (that are not written in Entangled 😀).

@HannoSpreeuw
Copy link
Contributor

@jhidding The only thing that worries me now is the rendering.
Suppose I have this docstring snippet:

    Parameters:
    -----------
    solver_parms: dict 
        Parameters about solver settings.
    tracker_parms: dict 
        Parameters about the progress bar and time interval for storage
    pde_parms: dict
        Model parameters, which govern e.g. the physical processes, but
        also the discretization, such as the number of grid cells.

Then it gets rendered like this in the corresponding .html:

Parameters:

solver_parms: dict Parameters about solver settings. tracker_parms: dict Parameters about the progress bar and time interval for storage pde_parms: dict Model parameters, which govern e.g. the physical processes, but also the discretization, such as the number of grid cells.

i.e. it seems to be turned into one line of text.

@HannoSpreeuw
Copy link
Contributor

Allright, you need to write your docstring like this:

    Parameters:
    -----------
    
    - **solver_parms** (*dict*):  
      Parameters about solver settings.
    
    - **tracker_parms** (*dict*):  
      Parameters about the progress bar and time interval for storage.
    
    - **pde_parms** (*dict*):  
      Model parameters, which govern e.g. the physical processes, but 
      also the discretization, such as the number of grid cells.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants