4141 remove f90 references from both docstrings and docs#4283
4141 remove f90 references from both docstrings and docs#4283chris-ashe wants to merge 10 commits into
Conversation
|
@timothy-nunn Tagging you here is there is lots of Fortran talked about in the vmcon stuff and not sure if it should be touched |
There was a problem hiding this comment.
Pull request overview
This pull request updates the codebase documentation and inline docstrings/comments to remove or replace legacy references to Fortran (.f90) with Python (.py), aligning wording with the current Python-centric implementation.
Changes:
- Replace
.f90references in documentation pages with.pyequivalents (solver, physics, stellarator, costs, development docs). - Remove/adjust Fortran-specific phrasing in docstrings and comments across models, core solver/input, and tests.
- Minor cleanup of legacy explanatory comments tied to the former Fortran implementation.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tracking/tracking_data.py | Removes Fortran-specific guidance from tracking-related docstrings/comments. |
| tests/unit/models/test_pfcoil.py | Updates test docstrings/comments to remove “Fortran module variables” phrasing. |
| tests/unit/models/test_divertor.py | Updates module-level test docstring from .f90 to .py. |
| tests/unit/models/test_availability.py | Removes Fortran-specific comments around test isolation. |
| tests/unit/models/physics/test_plasma_geom.py | Updates module-level test docstring from .f90 to .py. |
| tests/unit/models/physics/test_physics.py | Updates module-level test docstring from .f90 to .py. |
| tests/unit/models/physics/test_impurity_radiation.py | Fixes docstring referencing .f90.py to .py. |
| tests/integration/test_vmcon.py | Updates fixture docstring to remove Fortran phrasing. |
| process/models/tfcoil/superconducting.py | Removes legacy Fortran behavior notes from comments. |
| process/models/tfcoil/base.py | Updates docstrings/comments to remove Fortran references. |
| process/models/stellarator/coils/coils.py | Removes comment referencing .f90 provenance for constants. |
| process/models/power.py | Removes “only used in costs.f90” note from comment. |
| process/models/physics/physics.py | Removes Fortran-loop commentary and updates output-related docstring text. |
| process/models/pfcoil.py | Updates model init docstrings and removes Fortran-specific TODO/commentary. |
| process/models/blankets/hcpb.py | Removes “only used by old routines in … .f90” comment. |
| process/models/blankets/dcll.py | Updates .f90 reference in docstring line to .py. |
| process/main.py | Rewrites top-level module docstring away from Fortran runtime description; updates various method docstrings. |
| process/data_structure/tfcoil_variables.py | Updates variable docstring references from initial.f90 to initial.py. |
| process/data_structure/numerics.py | Removes Fortran-specific comments about iteration variables and dictionary generation. |
| process/core/solver/solver_handler.py | Removes Fortran-specific initialization/output comments and adjusts docstring wording. |
| process/core/solver/iteration_variables.py | Removes Fortran-specific doc/comment text in iteration variable metadata and loading logic. |
| process/core/scan.py | Updates class docstring to remove “Fortran scan module” phrasing. |
| process/core/process_output.py | Removes a “remove when Fortran is gone” TODO comment. |
| process/core/output.py | Removes Fortran-specific parameter description in docstring. |
| process/core/io/vary_run/tools.py | Removes Fortran numbering conversion comment. |
| process/core/io/in_dat/base.py | Removes large block comments describing legacy Fortran init/indexing issues. |
| process/core/io/data_structure_dicts.py | Updates docstrings to reference input.py rather than input.f90. |
| process/core/input.py | Updates docstrings and error messages to remove “Fortran module” wording. |
| process/core/caller.py | Removes Fortran-vs-Python distinction in caller docstring. |
| documentation/source/solver/solver-guide.md | Updates solver guide reference from evaluators.f90 to evaluators.py. |
| documentation/source/physics-models/fusion_reactions/plasma_reactions.md | Updates constants.f90 references to constants.py. |
| documentation/source/fusion-devices/stellarator.md | Updates stellarator source reference from stellarator.f90 to stellarator.py. |
| documentation/source/development/standards.md | Updates standards references/examples from Fortran to Python. |
| documentation/source/development/add-vars.md | Updates variable/iteration-variable add instructions from .f90 to .py and replaces examples. |
| documentation/source/cost-models/cost-models.md | Updates costs model source reference from costs.f90 to costs.py. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """Subroutine to output the plasma physics information | ||
| self.outfile : input integer : Fortran output unit identifier | ||
| self.outfile : file to write to | ||
| This routine writes the plasma physics information | ||
| to a file, in a tidy format. | ||
| """ |
| models : process.main.Models | ||
| physics and engineering model objects | ||
| _outfile : int | ||
| Fortran output unit identifier | ||
|
|
||
| """ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4283 +/- ##
=======================================
Coverage 48.79% 48.79%
=======================================
Files 151 151
Lines 29383 29383
=======================================
Hits 14337 14337
Misses 15046 15046 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| if isinstance(value, np.ndarray): | ||
| value = value.item() | ||
| if isinstance(value, bytes): | ||
| # TODO: remove when Fortran is gone |
There was a problem hiding this comment.
Does the line below need removing, or has this TODO already been done?
|
@chris-ashe I'm going to pass this PR off to Clair while I am on AL. |
Yep fine to leave the VMCON stuff. This should probably be its own issue as a lot of this docs has been moved to the VMCON repository |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… mapping descriptions
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
3d24903 to
bdd254b
Compare
clmould
left a comment
There was a problem hiding this comment.
Majority are suggested changes, then a couple qs and also checking some things with @timothy-nunn where I am uncertain
| continue | ||
|
|
||
| # matches (variable name, array index, value) | ||
| # NOTE: array index is Fortran-based hence starts at 1. |
There was a problem hiding this comment.
@timothy-nunn I am unsure if this comment regarding indexing is still required?
| if isinstance(value, np.ndarray): | ||
| value = value.item() | ||
| if isinstance(value, bytes): | ||
| # TODO: remove when Fortran is gone |
There was a problem hiding this comment.
@timothy-nunn can this be removed? I am unsure if it is referring to this if statement or something else that was removed already ?
| # Initialise iteration variables and bounds in Python: relies on Fortran | ||
| # iteration variables being defined above | ||
| # Trim maximum size arrays down to actually used size | ||
| # Initialise solver variables from numerics module |
There was a problem hiding this comment.
| # Initialise solver variables from numerics module | |
| # Initialise iteration variables from numerics module | |
| # Trim maximum size arrays down to actually used size |
Think it's worth explaining the slicing
| This file, process.py, is now analogous to process.f90, which contains the | ||
| Fortran "program" statement. This Python module effectively acts as the Fortran | ||
| "program". | ||
| """Run `PROCESS` by calling into the Python module. |
There was a problem hiding this comment.
should it say 'Python module' or 'Python modules' ?
| n_pf_coil_groups = 4 | ||
| n_pf_coils_in_group = np.array([1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0]) | ||
|
|
||
| # This 2D array argument discovered via gdb prints as a 1D array, therefore |
There was a problem hiding this comment.
Think it's worth keeping the first sentence here to explain the reshaping, but the 2nd can be deleted
| Refrain from declaring or typing known numerical constants directly in the code. Instead call the value from `constants.py` | ||
| If the constants doesn't exist then add it with a source link and uncertainty value. |
There was a problem hiding this comment.
| Refrain from declaring or typing known numerical constants directly in the code. Instead call the value from `constants.py` | |
| If the constants doesn't exist then add it with a source link and uncertainty value. | |
| Refrain from declaring or typing known numerical constants directly in the code. Instead call the value from `constants.py`. | |
| If the constant doesn't exist then add it with a source link. |
The constants in constants.py just seem to have a source link?
| @@ -100,7 +97,5 @@ def output(self): | |||
| Objective function value, solution vector and constraints vector. | |||
| """ | |||
| self.data.numerics.norm_objf = self.solver.objf | |||
There was a problem hiding this comment.
| self.data.numerics.norm_objf = self.solver.objf | |
| self.data.numerics.norm_objf = self.solver.objf | |
| # Slicing required to trim maximum sized arrays down to actually used size |
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>


Description
Checklist
I confirm that I have completed the following checks: