-
Notifications
You must be signed in to change notification settings - Fork 0
Added cross-references #32
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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)]]) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
this is why the docs here for |
||||||
|
|
||||||
| 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. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
as above |
||||||
|
|
||||||
| integer :: res_instance_index | ||||||
| !! Instance index of the result | ||||||
|
|
@@ -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)]]) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
as above |
||||||
|
|
||||||
| integer, intent(in) :: n | ||||||
| !! Number of values to create | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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 | ||||||
|
|
@@ -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. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
as above |
||||||
|
|
||||||
| character(len=*), optional, intent(in) :: message | ||||||
| !! Error message | ||||||
|
|
||||||
| 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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
| 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 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| !> | ||||||
| !> Written by hand here. | ||||||
| !> Generation to be automated in future (including docstrings of some sort). | ||||||
|
|
||||||
| 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). | ||||||
|
|
@@ -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 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| character(len=*), optional, intent(in) :: message | ||||||
| !! Error message | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| !> Error passing | ||
| !> *Error passing* | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a convention? Always put the title in
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really. I was messing around, with the formatting.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
| ! | ||
|
|
||
| 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). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
@@ -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] | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -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)]]. | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| 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. | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| !! The trick here is to pass in the instance index, not the instance itself | ||||||||
|
|
||||||||
| logical :: res | ||||||||
|
|
@@ -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)]]. | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| 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 | ||||||||
|
|
||||||||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/