Skip to content

Update add-vars.md#4332

Open
timothy-nunn wants to merge 9 commits into
mainfrom
3664-update-add-varsmd
Open

Update add-vars.md#4332
timothy-nunn wants to merge 9 commits into
mainfrom
3664-update-add-varsmd

Conversation

@timothy-nunn

@timothy-nunn timothy-nunn commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Updated the guide for adding variables, inputs, scan vars, figures of merit, and iteration vars. They needed a refresh due to changes in the Python conversion, recent data structure changes, and enumification.

I have also reduced the need for users to manually increment some variables (was not possible for the scan variables due to circular imports).

@timothy-nunn timothy-nunn linked an issue Jun 17, 2026 that may be closed by this pull request
@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.87%. Comparing base (6af8115) to head (3af3782).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4332      +/-   ##
==========================================
+ Coverage   48.86%   48.87%   +0.01%     
==========================================
  Files         151      151              
  Lines       29417    29426       +9     
==========================================
+ Hits        14374    14383       +9     
  Misses      15043    15043              

☔ 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.

@timothy-nunn timothy-nunn marked this pull request as ready for review June 18, 2026 08:32
@timothy-nunn timothy-nunn requested a review from a team as a code owner June 18, 2026 08:32
@timothy-nunn

Copy link
Copy Markdown
Collaborator Author

Requesting a couple of reviews to ensure these docs make sense and are sufficiently detailed

@timothy-nunn timothy-nunn force-pushed the 3664-update-add-varsmd branch from 0aba1cf to d1dd370 Compare June 18, 2026 14:55

@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.

All minor things, mostly suggested changes, but otherwise happy with the content

Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread process/data_structure/numerics.py
Comment thread process/data_structure/numerics.py Outdated
Comment thread documentation/source/development/add-vars.md Outdated
@clmould clmould self-assigned this Jun 18, 2026
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md Outdated
```
minmax = 20
```
Remember, setting `minmax = -20` would minimise instead of maximise our new variable.

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.

Would be good the specify here that this is the case as it is the value of the second derivative?

Comment thread documentation/source/development/add-vars.md
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md Outdated
my_new_blanket_variable = 1.0
```

-----------------

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.

Do we need a bit here about how the value of an input variable is unchanged throughout a run ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This point is made at least twice in the document, I think that should be enough

## Add a constraint equation

Constraint equations are added to *PROCESS* in the `process/core/solver/constraints.py` file. They are registered with the `ConstraintManager` whenever the application is run. Each equation has a unique name that is currently an integer, however upgrades to the input file format in the future will allow arbitrary hashable constraint names.
Constraint equations are added to PROCESS in the `process/core/solver/constraints.py` file. They are registered with the `ConstraintManager` whenever the application is run. Each equation has a unique name that is currently an integer, however upgrades to the input file format in the future will allow arbitrary hashable constraint names.

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.

Will updates to the input file format mean changes for more things in this page other than just constraints? If so, probably worth a general note at the start of this page? Might not though, just thought I'd ask!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Tbh that information is probably not necessary and I will remove it

Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md
Comment thread documentation/source/development/add-vars.md Outdated
Comment thread documentation/source/development/add-vars.md Outdated
@timothy-nunn timothy-nunn requested a review from clmould July 9, 2026 14:30
timothy-nunn and others added 9 commits July 9, 2026 16:09
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
Co-authored-by: Christopher Ashe <91618944+chris-ashe@users.noreply.github.com>
Co-authored-by: clmould <86794332+clmould@users.noreply.github.com>
@timothy-nunn timothy-nunn force-pushed the 3664-update-add-varsmd branch from a18ef77 to 3af3782 Compare July 9, 2026 15:11
Comment on lines 173 to +177
The arguments to the `register_constraint` function are:

- Name (again, currently an integer)
- Unit (for output reporting purposes)
- Symbol (e.g. =, >=, <=. Again, for output reporting purposes)
- Symbol (e.g. `=`, `>=`, `<=`. Again, for output reporting purposes)

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
- Symbol (e.g. `=`, `>=`, `<=`. Again, for output reporting purposes)

think github might've messed up my suggestion ! not sure why it added it instead of overwriting !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update add-vars.md

4 participants