Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/example_fgen_basic/error_v/creation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module m_error_v_creation
function create_error(inv) result(err)
!! Create an error
!!
!! If an odd number is supplied, the error code is no error (TODO: cross-ref).
!! If an odd number is supplied, the error code is no error [[m_error_v:NO_ERROR_CODE(variable)]].
!! If an even number is supplied, the error code is 1.
!! If a negative number is supplied, the error code is 2.

Expand All @@ -42,7 +42,7 @@ end function create_error
function create_errors(invs, n) result(errs)
!! Create a number of errors
!!
!! If an odd number is supplied, the error code is no error (TODO: cross-ref).
!! If an odd number is supplied, the error code is no error [[m_error_v:NO_ERROR_CODE(variable)]].
!! If an even number is supplied, the error code is 1.
!! If a negative number is supplied, the error code is 2.

Expand Down
2 changes: 1 addition & 1 deletion src/example_fgen_basic/error_v/creation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Wrappers of `m_error_v_creation` [TODO think about naming and x-referencing]
Wrappers of [`m_error_v_creation`](/fortran-api/module/m_error_v_creation.html)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh very nice, I like it a lot

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Wrappers of [`m_error_v_creation`](/fortran-api/module/m_error_v_creation.html)
Wrappers of [`m_error_v_creation`](../fortran-api/module/m_error_v_creation.html)

might need to be something like this, at least the current link doesn't work on https://example-fgen-basic--32.org.readthedocs.build/en/32/api/example_fgen_basic/error_v/creation/

At the moment, all written by hand.
We will auto-generate this in future.
Expand Down
10 changes: 4 additions & 6 deletions src/example_fgen_basic/error_v/creation_wrapper.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ module m_error_v_creation_w
contains

function create_error(inv) result(res_instance_index)
!! Wrapper around `m_error_v_creation.create_error` (TODO: x-ref)
!> Wrapper around `m_error_v_creation.create_error` ([[m_error_v_creation(module):create_error(function)]])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> Wrapper around `m_error_v_creation.create_error` ([[m_error_v_creation(module):create_error(function)]])
!! Wrapper around `m_error_v_creation.create_error` ([[m_error_v_creation(module):create_error(function)]])

!> means document the thing below this. !! means document the thing above this. (this is mentioned somewhere in the Ford docs)

this is why the docs here for inv are wrong: https://example-fgen-basic--32.org.readthedocs.build/en/32/fortran-api/proc/create_error~2.html


integer, intent(in) :: inv
!! Input value to use to create the error
!!
!! See docstring of `m_error_v_creation.create_error` for details.
!! [TODO: x-ref]
!> See docstring of [[m_error_v_creation(module):create_error(function)]] for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> See docstring of [[m_error_v_creation(module):create_error(function)]] for details.
!! See docstring of [[m_error_v_creation(module):create_error(function)]] for details.

as above


integer :: res_instance_index
!! Instance index of the result
Expand All @@ -56,13 +55,12 @@ function create_error(inv) result(res_instance_index)
end function create_error

function create_errors(invs, n) result(res_instance_indexes)
!! Wrapper around `m_error_v_creation.create_errors` (TODO: x-ref)
!> Wrapper around `m_error_v_creation.create_errors` ([[m_error_v_creation(module):create_errors(function)]])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> Wrapper around `m_error_v_creation.create_errors` ([[m_error_v_creation(module):create_errors(function)]])
!! Wrapper around `m_error_v_creation.create_errors` ([[m_error_v_creation(module):create_errors(function)]])

as above


integer, dimension(n), intent(in) :: invs
!! Input value to use to create the error
!!
!! See docstring of `m_error_v_creation.create_error` for details.
!! [TODO: x-ref]
!> See docstring of [[m_error_v_creation(module):create_errors(function)]] for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> See docstring of [[m_error_v_creation(module):create_errors(function)]] for details.
!! See docstring of [[m_error_v_creation(module):create_errors(function)]] for details.

as above


integer, intent(in) :: n
!! Number of values to create
Expand Down
6 changes: 3 additions & 3 deletions src/example_fgen_basic/error_v/error_v.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ module m_error_v
end type ErrorV

interface ErrorV
!! Constructor interface - see build (TODO: figure out cross-ref syntax) for details
!> Constructor interface - see docs [[m_error_v(module):build(subroutine)]] of for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> Constructor interface - see docs [[m_error_v(module):build(subroutine)]] of for details.
!! Constructor interface - see docs [[m_error_v(module):build(subroutine)]] of for details.

docs not rendering here but not sure if this will just fix itself if we make the change above https://example-fgen-basic--32.org.readthedocs.build/en/32/fortran-api/interface/errorv.html

module procedure :: constructor
end interface ErrorV

contains

!> Constructor function: see docs of [[m_error_v(module):build(procedure)]] for details.
function constructor(code, message) result(self)
!! Constructor - see build (TODO: figure out cross-ref syntax) for details

integer, intent(in) :: code
character(len=*), optional, intent(in) :: message
Expand All @@ -68,7 +68,7 @@ subroutine build(self, code, message)
integer, intent(in) :: code
!! Error code
!!
!! Use [TODO: figure out xref] `NO_ERROR_CODE` if there is no error
!> Use [[m_error_v:NO_ERROR_CODE(variable)]] if there is no error.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> Use [[m_error_v:NO_ERROR_CODE(variable)]] if there is no error.
!! Use [[m_error_v:NO_ERROR_CODE(variable)]] if there is no error.

as above


character(len=*), optional, intent(in) :: message
!! Error message
Expand Down
2 changes: 1 addition & 1 deletion src/example_fgen_basic/error_v/error_v.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Python equivalent of the Fortran `ErrorV` class [TODO: x-refs]
Python equivalent of the Fortran [ErrorV](/fortran-api/type/errorv.html) class.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, all written by hand.
We will auto-generate this in future.
Expand Down
2 changes: 1 addition & 1 deletion src/example_fgen_basic/error_v/error_v_manager.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!> Manager of `ErrorV` (TODO: xref) across the Fortran-Python interface
!> Manager of [[m_error_v(module)]] across the Fortran-Python interface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> Manager of [[m_error_v(module)]] across the Fortran-Python interface
!> Manager for passing [[m_error_v(module)::ErrorV(type)]] instances across the Fortran-Python interface

!>
!> Written by hand here.
!> Generation to be automated in future (including docstrings of some sort).
Expand Down
4 changes: 2 additions & 2 deletions src/example_fgen_basic/error_v/error_v_wrapper.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!> Wrapper for interfacing `m_error_v` with Python
!> Wrapper for interfacing [[m_error_v(module)::ErrorV(type)]] with Python
!>
!> Written by hand here.
!> Generation to be automated in future (including docstrings of some sort).
Expand Down Expand Up @@ -29,7 +29,7 @@ subroutine build_instance(code, message, instance_index)
integer, intent(in) :: code
!! Error code
!!
!! Use [TODO: figure out xref] `NO_ERROR_CODE` if there is no error
!> Use [[m_error_v:NO_ERROR_CODE(variable)]] if there is no error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> Use [[m_error_v:NO_ERROR_CODE(variable)]] if there is no error
!! Use [[m_error_v:NO_ERROR_CODE(variable)]] if there is no error


character(len=*), optional, intent(in) :: message
!! Error message
Expand Down
2 changes: 1 addition & 1 deletion src/example_fgen_basic/error_v/passing.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!> Error passing
!> *Error passing*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a convention? Always put the title in * ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I was messing around, with the formatting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok cool let's undo this before merging then

!>
!> A very basic demo to get the idea.
!
Expand Down
4 changes: 2 additions & 2 deletions src/example_fgen_basic/error_v/passing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Wrappers of `m_error_v_passing` [TODO think about naming and x-referencing]
Wrappers of [`m_error_v_passing`](/fortran-api/module/m_error_v_passing.html).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above re links being broken in the preview


At the moment, all written by hand.
We will auto-generate this in future.
Expand Down Expand Up @@ -76,7 +76,7 @@ def pass_errors(invs: tuple[ErrorV, ...]) -> NP_ARRAY_OF_BOOL:
"""
# Controlling memory from the Python side
m_error_v_w.ensure_at_least_n_instances_can_be_passed_simultaneously(len(invs))
# TODO: consider adding `build_instances` too, might be headache

instance_indexes: NP_ARRAY_OF_INT = np.array(
[m_error_v_w.build_instance(code=inv.code, message=inv.message) for inv in invs]
)
Expand Down
12 changes: 5 additions & 7 deletions src/example_fgen_basic/error_v/passing_wrapper.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ module m_error_v_passing_w
contains

function pass_error(inv_instance_index) result(res)
!! Wrapper around `m_error_v_passing.pass_error` (TODO: x-ref)
!> Wrapper around `m_error_v_passing.pass_error` [[m_error_v_passing(module):pass_error(function)]].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> Wrapper around `m_error_v_passing.pass_error` [[m_error_v_passing(module):pass_error(function)]].
!! Wrapper around `m_error_v_passing.pass_error` [[m_error_v_passing(module):pass_error(function)]].


integer, intent(in) :: inv_instance_index
!! Input values
!!
!! See docstring of `m_error_v_passing.pass_error` for details.
!! [TODO: x-ref]
!> See docstring of [[m_error_v_passing(module):pass_error(function)]] for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> See docstring of [[m_error_v_passing(module):pass_error(function)]] for details.
!!
!! See docstring of [[m_error_v_passing(module):pass_error(function)]] for details.


!! The trick here is to pass in the instance index, not the instance itself

logical :: res
Expand All @@ -48,13 +47,12 @@ function pass_error(inv_instance_index) result(res)
end function pass_error

function pass_errors(inv_instance_indexes, n) result(res)
!! Wrapper around `m_error_v_passing.pass_errors` (TODO: x-ref)
!> Wrapper around `m_error_v_passing.pass_error` [[m_error_v_passing(module):pass_errors(function)]].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!> Wrapper around `m_error_v_passing.pass_error` [[m_error_v_passing(module):pass_errors(function)]].
!! Wrapper around `m_error_v_passing.pass_error` [[m_error_v_passing(module):pass_errors(function)]].


integer, dimension(n), intent(in) :: inv_instance_indexes
!! Input values
!!
!! See docstring of `m_error_v_passing.pass_errors` for details.
!! [TODO: x-ref]
!! See docstring of [[m_error_v_passing(module):pass_errors(function)]] for details.

integer, intent(in) :: n
!! Number of values to pass
Expand Down
Loading