You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Config class with static fields for all the required input parameters for the model.
Context
Configuration files for this pipeline are generated by this very handy config generator. However, because it is in a different repo, differences in the required fields between the repos can sneakily make their way in, only to be found at run time. From personal experience doing a test run of the pipeline, I found two fields that had gotten out of sync, and had to manually fix them in the config files.
At the moment, all of the requried parameters that go in the input configuration JSON file can be found by reading through the code, and seeing what fields are accessed from the config list. For example, grepping through the repo for config[[:
Since this pipeline is the "source of truth" for all the input parameters, I suggest creating a Config class, where all of the fields are explicitly defined, all in one place. This would make it much simpler to keep both repos in sync, ideally moving config sync issues to dev time vs. run time.
The goal of this is not to lock down the config generator repo into this class only. In the very near future, we hope to have other models doing Rt estimation for us, and the symmetric difference of their parameters will probably not be the empty set. The goal is only to make the job ensuring the two are synced up simpler, and remove run time errors.
Requirements
A Config class (maybe R6 or S7?) with all of the fields defined in one place.
A function to convert the raw list data from a JSON file into a Config instance.
Use the resulting Config instance throughout the code.
Nice to haves
Method for serialization of an instance into JSON.
Method for creating a JSON schema based on the class definition. Would make syncing the repos even simpler.
Automatic validation of used parameters, letting in unused parameters that might be necessary for other models. Perhaps also warning the user that that those parameters are not being used.
Out of scope
Anything outside of replacing the current config list that is used.
Related
This conversation about where validation should happen. Quorum was reached that it should happen outside this repo default.
The text was updated successfully, but these errors were encountered:
Goal
Create a
Config
class with static fields for all the required input parameters for the model.Context
Configuration files for this pipeline are generated by this very handy config generator. However, because it is in a different repo, differences in the required fields between the repos can sneakily make their way in, only to be found at run time. From personal experience doing a test run of the pipeline, I found two fields that had gotten out of sync, and had to manually fix them in the config files.
At the moment, all of the requried parameters that go in the input configuration JSON file can be found by reading through the code, and seeing what fields are accessed from the
config
list. For example, grepping through the repo forconfig[[
:This works, but could be easier.
Since this pipeline is the "source of truth" for all the input parameters, I suggest creating a
Config
class, where all of the fields are explicitly defined, all in one place. This would make it much simpler to keep both repos in sync, ideally moving config sync issues to dev time vs. run time.The goal of this is not to lock down the config generator repo into this class only. In the very near future, we hope to have other models doing Rt estimation for us, and the symmetric difference of their parameters will probably not be the empty set. The goal is only to make the job ensuring the two are synced up simpler, and remove run time errors.
Requirements
Config
class (maybe R6 or S7?) with all of the fields defined in one place.Config
instance.Config
instance throughout the code.Nice to haves
Out of scope
Anything outside of replacing the current
config
list that is used.Related
The text was updated successfully, but these errors were encountered: