Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for overriding constants at runtime #470

Open
chrispcampbell opened this issue Apr 25, 2024 · 1 comment
Open

Allow for overriding constants at runtime #470

chrispcampbell opened this issue Apr 25, 2024 · 1 comment

Comments

@chrispcampbell
Copy link
Contributor

To enable rapid prototyping and calibration of our models, we would like to have:

  • a way to override any constant value at runtime (above and beyond the declared "input" variables)
  • a way to override data or lookup variables at runtime

The first one can be implemented similar to how I added support for capturing any variable as an output at runtime (see #105), i.e., generate a big switch statement that allows for overriding any constant value (referenced by "variable index").

The second one can also be implemented in a similar way. I prototyped this in my work-in-progress "generate JS" branch because I needed it for a small model we were working on. I believe that @ToddFincannonEI already has a related branch, so we should put our heads together on this.

I'm lumping these two things together into one feature because we will need to touch the same parts of the compile and runtime package, and it should be easier to implement them together instead of separately.

This will require changes to the code generation phase of the compiler, and will also require improvements and refactoring in the runtime packages.

@chrispcampbell chrispcampbell self-assigned this Apr 25, 2024
@chrispcampbell chrispcampbell changed the title Allow for overriding constants and data variables at runtime Allow for overriding constants at runtime Apr 30, 2024
@chrispcampbell
Copy link
Contributor Author

I started working on this but realized that it would be better if we divided the work into a few distinct parts, so I changed the focus of this issue to be on the first part only (overriding constants at runtime), and then filed two new issues:

I will come back to this issue once #471 is complete, and then after this issue is finished, it will be more straightforward to work on #472.

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

No branches or pull requests

1 participant