Skip to content

Conversation

@agarny
Copy link
Contributor

@agarny agarny commented Aug 6, 2024

Fixes #1243.

@agarny agarny force-pushed the issue1243 branch 5 times, most recently from 874f4a6 to 5628b66 Compare August 7, 2024 12:03
agarny added 8 commits August 7, 2024 16:21
…d algebraic variables for initialiseVariables().
…d algebraic variables for computeVariables().
…d algebraic variables for computeComputedConstants().
To do it manually is very time consuming while here it gets done automatically. From there, we can quickly confirm, using git, whether the new expected file contents is correct.
… an equation.

We will also need to keep track of states and constants.
@agarny agarny force-pushed the issue1243 branch 6 times, most recently from f21044c to 3f1e632 Compare August 9, 2024 16:00
@agarny agarny force-pushed the issue1243 branch 2 times, most recently from da8d589 to ab7db7e Compare November 4, 2025 03:36
@agarny
Copy link
Contributor Author

agarny commented Nov 4, 2025

@hsorby / @nickerso: I believe I have addressed Hugh's issues.

@hsorby
Copy link
Contributor

hsorby commented Nov 4, 2025

Can discuss that on Tuesday, if you want. (I am offline tomorrow).

I feel this may be a 4.15 Friday discussion?

This is more consistent with our `createXxxArray()` methods and `deleteArray()` method.
@agarny
Copy link
Contributor Author

agarny commented Nov 4, 2025

How do people feel about the API consistency we have create_algebriac_array() but initialise_variables(), which initialises states and constants. Do we just need initialise_arrays().
Not keen on initialise_arrays(), but agree that initialise_variables() is not great. What about initialise_model()?

Just remembered that we haven't got a consensus on this one. Thinking more about it, I guess we could have initialiseArrays(). At least, it would be consistent with our createXxxArray() methods and our deleteArray() method. Also, I think it would make more sense to use `initialiseComputedConstants

Ok, done in b4045c6.

@agarny
Copy link
Contributor Author

agarny commented Nov 4, 2025

By the way, we replaced instances like const AnalyserVariablePtr &variable with const AnalyserVariablePtr &analyserVariable, but if anything this has made our code less consistent. Indeed, if we are to do that then we should do something similar with things like const AnalyserModelPtr &model, const AnalyserEquationPtr &equation, const AnalyserEquationAstPtr &equationAst, const AnalyserExternalVariablePtr &externalVariable, etc. and... also with the internal variants (e.g., const AnalyserInternalVariablePtr &variable).

So... I guess I should replace all of those too...? @hsorby?

@hsorby
Copy link
Contributor

hsorby commented Nov 4, 2025

By the way, we replaced instances like const AnalyserVariablePtr &variable with const AnalyserVariablePtr &analyserVariable, but if anything this has made our code less consistent. Indeed, if we are to do that then we should do something similar with things like const AnalyserModelPtr &model, const AnalyserEquationPtr &equation, const AnalyserEquationAstPtr &equationAst, const AnalyserExternalVariablePtr &externalVariable, etc. and... also with the internal variants (e.g., const AnalyserInternalVariablePtr &variable).

So... I guess I should replace all of those too...? @hsorby?

I think this PR is heavy enough as is and maybe the case for a new issue and then do this separately to this PR.

@agarny
Copy link
Contributor Author

agarny commented Nov 4, 2025

I think this PR is heavy enough as is and maybe the case for a new issue and then do this separately to this PR.

Fair enough. Would then be good to merge this PR ASAP, so that I can submit a follow-up PR.

Copy link
Contributor

@hsorby hsorby left a comment

Choose a reason for hiding this comment

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

analyser_p.h needs adding to GIT_HEADER_FILES

Some minor edits for me then I think it will ge all good.

@agarny
Copy link
Contributor Author

agarny commented Nov 5, 2025

analyser_p.h needs adding to GIT_HEADER_FILES

Oops, done in 37e2b7b.

@agarny
Copy link
Contributor Author

agarny commented Nov 5, 2025

Ok, I believe we are good to go @hsorby and @nickerso.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code generator: use different arrays for constants, computed constants, and algebraic variables

2 participants