-
Notifications
You must be signed in to change notification settings - Fork 21
4141 remove f90 references from both docstrings and docs #4283
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
460a231
cc89be2
133957e
e879f86
bc9ed31
fb9d871
94ff90d
0427b25
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -82,7 +82,7 @@ ixc = 169 * Achievable Temperature of the ECRH at the ignition point | |||||
|
|
||||||
| ## Code specifics | ||||||
|
|
||||||
| The stellarator model is largely contained within source file `stellarator.f90`. | ||||||
| The stellarator model is largely contained within source file `stellarator.py`. | ||||||
|
Collaborator
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 model call is in the following order | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,7 +94,7 @@ variable values that maximises or minimises a certain function of them, | |
| known as the figure of merit. | ||
|
|
||
| Several possible figures of merit are available, all of which are in the | ||
| source file `evaluators.f90`. | ||
| source file `evaluators.py`. | ||
|
Collaborator
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. Should this reference the figures of merit enum instead? |
||
|
|
||
| Switch `minmax` is used to control which figure of merit is to be used. If the | ||
| figure of merit is to be minimised, `minmax` should be **positive**, and if a | ||
|
|
||
|
Collaborator
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. @timothy-nunn I do not know if any of the old comments are still necessary here (some are definitely outdated, but others are unclear to me) |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ class IterationVariable: | |||||||
| name: str | ||||||||
| """The name of the variable""" | ||||||||
| module: str | Any | ||||||||
| """The Fortran module that this variable should be set on.""" | ||||||||
| """The module that this variable should be set on.""" | ||||||||
| lower_bound: float | ||||||||
| """The default lower bound of the iteration variable""" | ||||||||
| upper_bound: float | ||||||||
|
|
@@ -33,7 +33,6 @@ class IterationVariable: | |||||||
| """If `module.name` is an array, the iteration variable can only modify | ||||||||
| `array_index` of that array. | ||||||||
|
|
||||||||
| NOTE: The indexes start at 0 (despite indexing Fortran arrays). | ||||||||
| """ | ||||||||
|
|
||||||||
|
|
||||||||
|
|
@@ -271,9 +270,6 @@ def load_iteration_variables(data): | |||||||
| variable_index = data.numerics.ixc[i] | ||||||||
| iteration_variable = ITERATION_VARIABLES[variable_index] | ||||||||
|
|
||||||||
|
Collaborator
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
|
||||||||
| # use ... as the default return value because | ||||||||
| # None might be a valid return from Fortran? | ||||||||
|
|
||||||||
| module = ( | ||||||||
| getattr(data, iteration_variable.module) | ||||||||
| if isinstance(iteration_variable.module, str) | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -29,13 +29,10 @@ def __init__(self, models, solver_name, data): | |||||||
|
|
||||||||
| def run(self): | ||||||||
| """Run solver and retry if it fails in certain ways.""" | ||||||||
| # Initialise iteration variables and bounds in Fortran | ||||||||
| load_iteration_variables(self.data) | ||||||||
| load_scaled_bounds(self.data) | ||||||||
|
|
||||||||
| # Initialise iteration variables and bounds in Python: relies on Fortran | ||||||||
|
chris-ashe marked this conversation as resolved.
|
||||||||
| # iteration variables being defined above | ||||||||
| # Trim maximum size arrays down to actually used size | ||||||||
| # Initialise solver variables from numerics module | ||||||||
|
Collaborator
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
Think it's worth explaining the slicing |
||||||||
| n = self.data.numerics.nvar | ||||||||
| x = self.data.numerics.xcm[:n] | ||||||||
| bndl = self.data.numerics.itv_scaled_lower_bounds[:n] | ||||||||
|
|
@@ -100,7 +97,5 @@ def output(self): | |||||||
| Objective function value, solution vector and constraints vector. | ||||||||
| """ | ||||||||
| self.data.numerics.norm_objf = self.solver.objf | ||||||||
|
chris-ashe marked this conversation as resolved.
|
||||||||
| # Slicing required due to Fortran arrays being maximum possible, rather | ||||||||
| # than required, size | ||||||||
| self.data.numerics.xcm[: self.solver.x.shape[0]] = self.solver.x | ||||||||
| self.data.numerics.rcm[: self.solver.conf.shape[0]] = self.solver.conf | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -155,9 +155,6 @@ class NumericsData: | |||||||
| active_constraints: list[bool] = field(default_factory=lambda: [False] * IPEQNS) | ||||||||
| """Logical array showing which constraints are active""" | ||||||||
|
|
||||||||
| # TODO Do not change the comments for lablcc: they are used to create the | ||||||||
| # Python-Fortran dictionaries. This must be improved on. | ||||||||
|
|
||||||||
| lablcc: list[str] = field( | ||||||||
|
Collaborator
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
|
||||||||
| default_factory=lambda: [ | ||||||||
| "⟨β⟩ consistency ", | ||||||||
|
|
@@ -538,7 +535,6 @@ class NumericsData: | |||||||
| * (174) NOT USED | ||||||||
| * (175) NOT USED | ||||||||
| """ | ||||||||
| # Issue 287 iteration variables are now defined in module define_iteration_variables in iteration variables.f90 | ||||||||
| # WARNING These labels are used as variable names by new_indat(), and possibly | ||||||||
| # other python utilities, so they cannot easily be changed. | ||||||||
|
|
||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
The constants in constants.py just seem to have a source link?