ukaea / PROCESS

PROCESS is a systems code at UKAEA that calculates in a self-consistent manner the parameters of a fusion power plant with a specified performance, ensuring that its operating limits are not violated, and with the option to optimise to a given function of these parameters.
https://ukaea.github.io/PROCESS/
MIT License
36 stars 11 forks source link

Documentation update - [merged] #2441

Closed jonmaddock closed 1 year ago

jonmaddock commented 3 years ago

In GitLab by @timothy-nunn on Oct 28, 2021, 16:28

_Merges forked_documentationi -> develop

Supersedes !534

Closes #1403

Closes #1398

Add f2py specific documentation

Fix missing/outdated documentation

Document python-fortran interface

^ all above done within MkDocs to allow as many of our pages as possible to be generated one way

jonmaddock commented 3 years ago

In GitLab by @timothy-nunn on Oct 28, 2021, 16:32

@jonmaddock Find an example of the new docs here: http://tnunn.gitpages.ccfe.ac.uk/process/

jonmaddock commented 3 years ago

In GitLab by @timothy-nunn on Oct 28, 2021, 16:35

added 2 commits

Compare with previous version

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Nov 16, 2021, 12:17

marked as a Work In Progress

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Nov 16, 2021, 12:17

unassigned @jonmaddock

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Nov 18, 2021, 13:26

gdb, f2py turning things optional

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Nov 24, 2021, 10:43

added 264 commits

Compare with previous version

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Dec 8, 2021, 11:27

added 73 commits

Compare with previous version

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Dec 8, 2021, 15:09

unmarked as a Work In Progress

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Dec 8, 2021, 15:15

NOTE: the tracking page will not work on this fork because it does not have the correct CI key

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Dec 20, 2021, 14:18

added 1 commit

Compare with previous version

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Dec 21, 2021, 11:10

added 1 commit

Compare with previous version

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Dec 21, 2021, 11:12

added 1 commit

Compare with previous version

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 11, 2022, 10:03

added 1 commit

Compare with previous version

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 11, 2022, 10:33

added 1 commit

Compare with previous version

jonmaddock commented 2 years ago

klassic!

jonmaddock commented 2 years ago

Will this make a newline in the body for each __ dunder function (for each "" in list at :66)? No big deal if it does, but could look weird if there are lots of dunder funcs.

jonmaddock commented 2 years ago

What char is ord(c) == 0 and why are we asserting its absence? Could I get a comment please?

jonmaddock commented 2 years ago

So the presence of non-empty doc attribute is the qualifier for a function rather than a variable, right? Could you comment that?

jonmaddock commented 2 years ago

Is it perhaps worth putting a docstring at the top of the produced file so it's obvious it's a dummy Python module only for auto-documentation purposes? It's not totally clear what the difference between process.fortran and process._fortran are otherwise. Perhaps a file rename? Just something to make it obvious would be great.

jonmaddock commented 2 years ago

As you know, I usually get antsy when I don't see docstrings, but this is so well-written and clear (and a script), so I'm happy without.

jonmaddock commented 2 years ago

document_fortran_interface.py is an excellent solution for getting all our Python and Fortran docs into the same Python auto-documentation tool. Brilliant!

jonmaddock commented 2 years ago

Hey, mkdocstrings is neat!

jonmaddock commented 2 years ago

Should test-setup-py38 (or test-setup, even) depend on make-py38 instead? Isn't this an indirect dependency as it stands?

jonmaddock commented 2 years ago

These could probably go into requirement.txt, as I understand it. But I'm happy to be corrected! Perhaps this could be included in your larger CI cleanup task instead.

jonmaddock commented 2 years ago

Do we need to cd here?

jonmaddock commented 2 years ago

Ok, re-install once _fortran.py is in the process package so it can be read by mkdocstrings? Nice! Can you doc why the re-install is required here

jonmaddock commented 2 years ago

Don't quite understand this I'm afraid. Which files are required for the docs? Should they be included in the package when it's built? Maybe I'm missing something obvious!

jonmaddock commented 2 years ago

Surely should quack?

jonmaddock commented 2 years ago

Really? Nice spot

jonmaddock commented 2 years ago

These f2py docs are excellently written, great examples!

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 17, 2022, 09:08

Commented on scripts/document_fortran_interface.py line 76

create_function_signature creates a Python signature for a wrapped subroutine. The auto documenter then documents this Python file. This will cause each dunder method to cause a new line in the script which does not matter since that script is just an intermediate form. No dunder methods on these wrapped modules are documented.

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 17, 2022, 09:09

Commented on scripts/document_fortran_interface.py line 80

I will comment this in the code - I was having an issue with corrupted/weird characters in the docstring of some of the wrapped subroutines, I believe I can safely remove this.

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 17, 2022, 09:10

Commented on scripts/document_fortran_interface.py line 100

Absolutely, I will make it clear that _fortran contains abstract definitions.

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 17, 2022, 09:11

Commented on .gitlab-ci.yml line 367

Yes it is but as you will see in some of my upcoming requests, I will add this in a lot to increase the parallel running of the slow bits of the CI (like the tracker).

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 17, 2022, 09:11

Commented on .gitlab-ci.yml line 295

Very true, I am also not sure if this is needed anymore - I must check

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 17, 2022, 09:14

Commented on documentation/proc-pages/development/f2py-standards.md line 26

I will slip this in with another commit - I dont know if I want "make duck quack" as a commit in the history -- or maybe I do actually :D

jonmaddock commented 2 years ago

In GitLab by @timothy-nunn on Jan 17, 2022, 09:17

Commented on .gitlab-ci.yml line 145

Again, this may be a relic from remote building on PROCESS-STEP - I will check. Or, it could be to do with the fact we perform a reinstall.

jonmaddock commented 2 years ago

This is the same docstring as FortranModuleMember above; I'm guessing this is for variables only!

jonmaddock commented 2 years ago

List[FortranModuleMember], right?

jonmaddock commented 2 years ago

Is it List[FortranModule]?

jonmaddock commented 2 years ago

Does this have a defined type, e.g. the same as type(fortran.main_module)?

jonmaddock commented 2 years ago

Excellent use of NamedTuples here, really clear.

jonmaddock commented 2 years ago

This is correct, but can you make it clear this is for documentation purposes only?

jonmaddock commented 2 years ago

Nice, Fortran subroutines/functions analogous to class methods.

jonmaddock commented 2 years ago

Why [0]?

jonmaddock commented 2 years ago

When using gdb, I use:

run process/main.py -i tracking/baseline_2019/baseline_2019_IN.DAT

without trouble, not requiring the process_wrapper.py script. I'm fine with this as it is, but am I missing something or is this equivalent?

jonmaddock commented 2 years ago

This is great!

jonmaddock commented 2 years ago

You read my mind!

jonmaddock commented 2 years ago

You amended this in the next commit, so ignore me!

jonmaddock commented 2 years ago

Is it worth renaming this process.fortran to be consistent with the naming convention in this folder?