Skip to content

Commit 2873e7c

Browse files
committed
Cross-referencing and cleaning
1 parent 710a321 commit 2873e7c

13 files changed

Lines changed: 38 additions & 52 deletions

TODO.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/gen_fortran_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
# fh.writelines("* [example_fgen_basic](home.html)")
5656

5757
# Remove the ford files (which were just copied)
58-
shutil.rmtree(REPO_ROOT / FORD_OUTPUT_DIR)
58+
# shutil.rmtree(REPO_ROOT / FORD_OUTPUT_DIR)
5959

6060
# Put back the gitkeep file
6161
gitkeep = REPO_ROOT / FORD_OUTPUT_DIR / ".gitkeep"
62-
gitkeep.parent.mkdir()
62+
# gitkeep.parent.mkdir()
6363
gitkeep.touch()

docs/how-to-guides/run-code-in-a-notebook.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
# Here we show how you can make your docs via notebooks.
1919

2020
# %% editable=true slideshow={"slide_type": ""}
21-
from example_fgen_basic.operations import add_two
2221

2322
# %% editable=true slideshow={"slide_type": ""}
24-
add_two(3.2, 4.3)
23+
c = 1 + 2

src/example_fgen_basic/error_v/creation.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ module m_error_v_creation
1818
function create_error(inv) result(err)
1919
!! Create an error
2020
!!
21-
!! If an odd number is supplied, the error code is no error (TODO: cross-ref).
22-
!! If an even number is supplied, the error code is 1.
23-
!! If a negative number is supplied, the error code is 2.
21+
!> If an odd number is supplied, the error code is [[m_error_v:NO_ERROR_CODE(variable)]].
22+
!> If an even number is supplied, the error code is `1`.
23+
!> If a negative number is supplied, the error code is `2`.
2424

2525
integer, intent(in) :: inv
2626
!! Value to use to create the error
@@ -44,9 +44,9 @@ end function create_error
4444
function create_errors(invs, n) result(errs)
4545
!! Create a number of errors
4646
!!
47-
!! If an odd number is supplied, the error code is no error (TODO: cross-ref).
48-
!! If an even number is supplied, the error code is 1.
49-
!! If a negative number is supplied, the error code is 2.
47+
!> If an odd number is supplied, the error code is [[m_error_v:NO_ERROR_CODE(variable)]].
48+
!> If an even number is supplied, the error code is `1`.
49+
!> If a negative number is supplied, the error code is `2`.
5050

5151
integer, dimension(n), intent(in) :: invs
5252
!! Values to use to create the error

src/example_fgen_basic/error_v/creation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Wrappers of `m_error_v_creation` [TODO think about naming and x-referencing]
2+
Wrappers of [`m_error_v_creation`](/fortran-api/module/m_error_v_creation.html)
33
44
At the moment, all written by hand.
55
We will auto-generate this in future.
@@ -41,7 +41,6 @@ def create_error(inv: int) -> ErrorV:
4141
Input value
4242
4343
If odd, the error code is
44-
[NO_ERROR_CODE][example_fgen_basic.error_v.NO_ERROR_CODE].
4544
If even, the error code is 1.
4645
If a negative number is supplied, the error code is 2.
4746

src/example_fgen_basic/error_v/creation_wrapper.f90

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ module m_error_v_creation_w
2525
contains
2626

2727
function create_error(inv) result(res_instance_index)
28-
!! Wrapper around `m_error_v_creation.create_error` (TODO: x-ref)
28+
!> Wrapper around `m_error_v_creation.create_error` ([[m_error_v_creation(module):create_error(function)]])
2929

3030
integer, intent(in) :: inv
31-
!! Input value to use to create the error
32-
!!
33-
!! See docstring of `m_error_v_creation.create_error` for details.
34-
!! [TODO: x-ref]
31+
!> Input value to use to create the error
32+
!>
33+
!> See docstring of [[m_error_v_creation(module):create_error(function)]] for details.
3534

3635
integer :: res_instance_index
3736
!! Instance index of the result
@@ -56,13 +55,12 @@ function create_error(inv) result(res_instance_index)
5655
end function create_error
5756

5857
function create_errors(invs, n) result(res_instance_indexes)
59-
!! Wrapper around `m_error_v_creation.create_errors` (TODO: x-ref)
58+
!> Wrapper around `m_error_v_creation.create_errors` ([[m_error_v_creation(module):create_errors(function)]])
6059

6160
integer, dimension(n), intent(in) :: invs
6261
!! Input value to use to create the error
6362
!!
64-
!! See docstring of `m_error_v_creation.create_error` for details.
65-
!! [TODO: x-ref]
63+
!> See docstring of [[m_error_v_creation(module):create_errors(function)]] for details.
6664

6765
integer, intent(in) :: n
6866
!! Number of values to create

src/example_fgen_basic/error_v/error_v.f90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module m_error_v
2323
character(len=128) :: message = ""
2424
!! Error message
2525
! TODO: think about making the message allocatable to handle long messages
26+
!character(len=:), allocatable :: message --- would not work?
2627

2728
! TODO: think about adding idea of critical
2829
! (means you can stop but also unwind errors and traceback along the way)
@@ -34,7 +35,7 @@ module m_error_v
3435

3536
private
3637

37-
procedure, public:: build, finalise
38+
procedure, public :: build, finalise
3839
! get_res sort of not needed (?)
3940
! get_err sort of not needed (?)
4041

@@ -68,7 +69,7 @@ subroutine build(self, code, message)
6869
integer, intent(in) :: code
6970
!! Error code
7071
!!
71-
!! Use [TODO: figure out xref] `NO_ERROR_CODE` if there is no error
72+
!> Use [[m_error_v:NO_ERROR_CODE(variable)]] if there is no error.
7273

7374
character(len=*), optional, intent(in) :: message
7475
!! Error message

src/example_fgen_basic/error_v/error_v.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Python equivalent of the Fortran `ErrorV` class [TODO: x-refs]
2+
Python equivalent of the Fortran [ErrorV](/fortran-api/type/errorv.html) class.
33
44
At the moment, all written by hand.
55
We will auto-generate this in future.
@@ -46,8 +46,8 @@ def from_instance_index(cls, instance_index: int) -> ErrorV:
4646
4747
Returns
4848
-------
49-
:
50-
Initialised index
49+
ErrorV
50+
Python instance containing Fortran data
5151
"""
5252
# Different wrapping strategies are needed
5353

src/example_fgen_basic/error_v/error_v_manager.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
!> Manager of `ErrorV` (TODO: xref) across the Fortran-Python interface
1+
!> Manager of [[m_error_v(module)]] across the Fortran-Python interface
22
!>
33
!> Written by hand here.
44
!> Generation to be automated in future (including docstrings of some sort).
@@ -12,9 +12,9 @@ module m_error_v_manager
1212
type(ErrorV), dimension(:), allocatable :: instance_array
1313
logical, dimension(:), allocatable :: instance_available
1414

15-
! TODO: think about ordering here, alphabetical probably easiest
16-
public :: build_instance, finalise_instance, get_available_instance_index, get_instance, set_instance_index_to, &
17-
ensure_instance_array_size_is_at_least
15+
public :: build_instance, ensure_instance_array_size_is_at_least, finalise_instance, &
16+
get_available_instance_index, get_instance, set_instance_index_to
17+
1818

1919
contains
2020

@@ -143,7 +143,7 @@ subroutine ensure_instance_array_size_is_at_least(n)
143143
! Race conditions ?
144144
instance_available = .true.
145145

146-
elseif (size(instance_available) < n) then
146+
else if (size(instance_available) < n) then
147147

148148
allocate(tmp_instances(n))
149149
tmp_instances(1:size(instance_array)) = instance_array

src/example_fgen_basic/error_v/error_v_wrapper.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
!> Wrapper for interfacing `m_error_v` with Python
1+
!> Wrapper for interfacing [[m_error_v(module)::ErrorV(type)]] with Python
22
!>
33
!> Written by hand here.
44
!> Generation to be automated in future (including docstrings of some sort).
@@ -27,9 +27,9 @@ subroutine build_instance(code, message, instance_index)
2727
!! Build an instance
2828

2929
integer, intent(in) :: code
30-
!! Error code
30+
!> Error code
3131
!!
32-
!! Use [TODO: figure out xref] `NO_ERROR_CODE` if there is no error
32+
!> Use [[m_error_v:NO_ERROR_CODE(variable)]] if there is no error
3333

3434
character(len=*), optional, intent(in) :: message
3535
!! Error message

0 commit comments

Comments
 (0)