Maintenance data refactor#443
Open
jmdowrick wants to merge 65 commits into
Open
Conversation
Also flatten node data structure to enable cleaner use of updateNodeData helper function from useVueFlow composable
Also update module array terminology to instance array
- only works for local variables currently
hsorby
requested changes
Jul 16, 2026
hsorby
left a comment
Collaborator
There was a problem hiding this comment.
Looking really nice.
I have made a few comments.
Some a trivial, some are personal preference, and some are queries.
It would be good to answer the queries and make sure we are on the same page.
Other than that it is looking pretty awesome and much more logical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated data structures to have the following structures:
module: {
moduleRef:
${module_type}:${module_subtype},mathRef:
${component_file}:${component_name},variables: [defined below],
ports: [defined below],
}
instance.data: {
name: '',
moduleRef:
${module_type}:${module_subtype},mathRef:
${component_file}:${component_name},variables: [defined below],
ports: [defined below],
handles: [defined below],
}
variables: {
name: '',
value: '',
units: '',
access: String with value 'access' or 'no_access',
type: String with value 'constant', 'global_constant', 'boundary_condition', or 'variable',
data_reference: '',
}
ports: {
portType: String with value 'general_port', 'entrance_port', or 'exit_port',
label: String of name,
variables: [list of variable names associated with the port], // note: different from variables above
multiportType: String with value 'None', 'Sum', or 'Multiply'
}
handles: {
uid: crypto.randomUUID(),
type: 'source' or 'target',
side: 'left', 'right', 'top', 'bottom'
name: string of instance name -> should probably be updated to be associated with an immutable node id
}
There should now be functions to build each of these data structures.
As you can see, constant parameters are now associated with the instance. Global constants remain in the library store. Also introduces a library proxy store that dictates the library area to support dynamic organisation.
The library is now broken into several maps:
availableCollections -> use mathRef to get a set of moduleRefs using the same math
availableModules -> use moduleRef as key to get the module with structure above
availableMath -> use mathRef as key to get raw xml string of model with a single component
availableUnits (not a map) -> array of units
globalConstants -> use variable name to get { value, units, data_reference }
This PR should fix the following issues:
Resolves #429
Resolves #413
Resolves #405
Resolves #290
Resolves #246
Resolves #248
Also works towars #380, but need ability to edit data reference in the parameter window before I feel comfortable to mark this resolved.
Remaining functionalities to restore: