Skip to content

4141 remove f90 references from both docstrings and docs - #4283

Open
chris-ashe wants to merge 13 commits into
mainfrom
4141-remove-f90-references-from-both-docstrings-and-docs
Open

chris-ashe wants to merge 13 commits into
mainfrom
4141-remove-f90-references-from-both-docstrings-and-docs

Conversation

@chris-ashe

Copy link
Copy Markdown
Member

Description

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

Copilot AI review requested due to automatic review settings June 3, 2026 08:34
@chris-ashe
chris-ashe requested a review from a team as a code owner June 3, 2026 08:34
@chris-ashe chris-ashe added the Documentation Improvements or additions to documentation label Jun 3, 2026
@chris-ashe chris-ashe linked an issue Jun 3, 2026 that may be closed by this pull request
@chris-ashe
chris-ashe requested a review from timothy-nunn June 3, 2026 08:35
@chris-ashe

Copy link
Copy Markdown
Member Author

@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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 .f90 references in documentation pages with .py equivalents (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.

Comment thread process/main.py Resolved
Comment thread process/core/io/data_structure_dicts.py Resolved
Comment thread process/core/io/data_structure_dicts.py Resolved
Comment on lines 1695 to 1699
"""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.
"""
Comment thread process/core/output.py Outdated
Comment on lines 16 to 20
models : process.main.Models
physics and engineering model objects
_outfile : int
Fortran output unit identifier

"""
Comment thread process/models/blankets/dcll.py Resolved
@timothy-nunn timothy-nunn self-assigned this Jun 3, 2026
@codecov-commenter

codecov-commenter commented Jun 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.17%. Comparing base (c0d281c) to head (936441a).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
process/core/input.py 66.66% 1 Missing ⚠️
process/models/physics/physics.py 0.00% 1 Missing ⚠️
process/models/power.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4283      +/-   ##
==========================================
+ Coverage   51.13%   51.17%   +0.04%     
==========================================
  Files         181      181              
  Lines       30408    30426      +18     
==========================================
+ Hits        15548    15571      +23     
+ Misses      14860    14855       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@clmould
clmould self-requested a review June 3, 2026 13:54

@clmould clmould left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a few things from me

Can this comment be deleted:
Image

Can this comment also be deleted please:
Image

Comment thread process/core/input.py Resolved
Comment thread process/core/solver/solver_handler.py Resolved
Comment thread process/core/process_output.py Resolved
@timothy-nunn

Copy link
Copy Markdown
Collaborator

@chris-ashe I'm going to pass this PR off to Clair while I am on AL.

@timothy-nunn timothy-nunn assigned clmould and unassigned timothy-nunn Jun 5, 2026
@timothy-nunn

Copy link
Copy Markdown
Collaborator

@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

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

@chris-ashe
chris-ashe force-pushed the 4141-remove-f90-references-from-both-docstrings-and-docs branch from 3d24903 to bdd254b Compare June 19, 2026 11:05

@clmould clmould left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Majority are suggested changes, then a couple qs and also checking some things with @timothy-nunn where I am uncertain

Comment thread process/core/input.py Resolved
Comment thread process/core/output.py Outdated
@@ -16,7 +16,6 @@ def write(models, data, _outfile):
models : process.main.Models
physics and engineering model objects
_outfile : int

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
_outfile : int
_outfile : int
output unit identifier

Not sure if correct, but something like this could work?

Comment thread process/core/process_output.py Resolved
Comment thread process/core/solver/solver_handler.py Resolved
Comment thread process/main.py Resolved
Comment thread tests/unit/models/test_pfcoil.py Resolved
Comment thread tracking/tracking_data.py Resolved
Comment on lines 40 to 41
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.

@clmould clmould Jun 19, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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?

Comment thread process/core/solver/solver_handler.py Resolved

@clmould clmould left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry missed a couple bits !

This might need removing in neoclassics.py?
Image

Comment thread process/core/io/in_dat/base.py Resolved
Comment thread process/core/solver/solver_handler.py Resolved
Comment thread tracking/tracking_data.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would revert these changes for now because the tracker needs to be properly stripped of its fortran support

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Restored the original Fortran-support comments in tracking/tracking_data.py in commit 6e6d8846.

@clmould

clmould commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Can you also remove the following comment referencing cmake in process/core/io/plot/scans.py please:
image

@chris-ashe
chris-ashe force-pushed the 4141-remove-f90-references-from-both-docstrings-and-docs branch from 0c43df0 to 0427b25 Compare July 22, 2026 09:25
@chris-ashe
chris-ashe force-pushed the 4141-remove-f90-references-from-both-docstrings-and-docs branch from 0427b25 to 456ff14 Compare November 10, 2026 17:44
@chris-ashe
chris-ashe force-pushed the 4141-remove-f90-references-from-both-docstrings-and-docs branch from 7cbca72 to 22c56c2 Compare November 10, 2026 17:53

@timothy-nunn timothy-nunn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please also have a look at the comments I have not resolved from @clmould

Comment thread process/main.py Resolved
@je-cook je-cook added this to the Pre-functionalisation PRs milestone Nov 12, 2026
@clmould clmould mentioned this pull request Nov 17, 2026

@clmould clmould left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-commenting the unresolved things from above so they are all in once place!

Also:

  • Can you rebase please to fix the conflicts

  • Can this comment be removed in neoclassics.py ?

image
  • Can the tracking_data.py changes be reverted please as per @timothy-nunn's comment

Comment thread process/main.py
self : process.main.Models
physics and engineering model objects
_outfile : int
Fortran output unit identifier

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Output unit identifier

Comment thread process/core/input.py
Comment on lines -1444 to -1448
The way PROCESS input files are structured, each element of the array is provided on
one line
so this function just needs to set the `value` at `array_index` (-1)
because of Fortran-based indexing.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can this be added back please (it should be there when you rebase, as it's currently on main)

Comment thread process/models/physics/physics.py Resolved
# Superconducting CS
if i_pf_conductor == PFConductorModel.SUPERCONDUCTING:
# Getting the turn dimention from scratch
# as the TF is called before CS in caller.f90

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Think this should be added back as TF is still called before CS in caller.py, so would explain why these are 'from scratch' ?

Comment thread process/main.py Outdated
self.data.globals.fileprefix = self.input_path.resolve()

def set_output(self):
"""Set the output file name.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"""Set the output file name.
"""Set the output file path.

@@ -110,8 +108,6 @@ def output(self):
Objective function value, solution vector and constraints vector.
"""
self.data.numerics.norm_objf = self.solver.objf

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@timothy-nunn I think some parts of some comments might be good to add back in to provide some explanation for what is going on, eg esp for L1378 , what do you think?

chris-ashe and others added 10 commits November 17, 2026 15:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Co-authored-by: Timothy <75321887+timothy-nunn@users.noreply.github.com>
Co-authored-by: Timothy <75321887+timothy-nunn@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Comment on lines -528 to -529
# (self.data.times.t_burn_0).
# This is used to ensure that the burn time is used consistently;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are these 2 lines still necessary to explain why this value is being reset (if so can the lines be added back plz)?

Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove F90 references from both docstrings and docs

7 participants