-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
While we have removed global variables and replaced them with dedicated data structures throughout the code, as @logan-nc has pointed out, we often just pass in many of these structs into functions that modify data in-place, giving the same issue as the globals in the Fortran - it is not clear to a new user what is getting modified and where! I think there are a lot of improvements that can be done for this (and will probably get delegated to AI).
Some thoughts:
- Replace function calls that include the full data structures but only use one entry of it with just that entry. This should especially be done if its an update in place function and is only modifying one entry in the function.
- If functions are modifying more than one entry in a data struct, think through if it can be separated into multiple functions, such that 1. can be achieved
- We have the main data structures of
ctrl, intr, equil, ffit, odet. During the hackathon, we made them all@kwdef mutable structtypes. However, I think we don't need them all to be mutable. For example, I thinkctrlshould be instantiated from the input toml and then left alone completely - any modifications that are needed can be stored as copied within the mutableintrstruct (e.g. psiedge, nn_low...). This way, users will know thatctrlwill never appear as the first entry of a!function. This could also be done withffit
Open to other suggestions
Reactions are currently unavailable