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
Currently the Config class does not display any of its parameters when you type config.param_name. This is bothersome because I often forget the exact naming of a parameter and wish there were hints about what parameters may be within Config. To solve this I propose putting certain major parameters, specifically those that will be present for all diseases, as hints in the class statically. Something like this example:
class Config:
X: int
Y: str
def __init__(self):
self.X = 5
# Creating an instance of Config
config = Config()
# Accessing X as a class attribute
print(Config.X) # Output: <class 'int'>
# Accessing X as an instance attribute
print(config.X) # Output: 5
The reason we cant do this for all parameters is that a Config class may be loaded with a number of different json files, and thus have different parameters. The only file we require across all instances of MechanisticModel is a global file.
The text was updated successfully, but these errors were encountered:
I thought about this a bit more and also realized that we can create an inherited class of the Config class to provide more specific type hinting. This would be specific to each disease though and would likely be overboard.
Currently the
Config
class does not display any of its parameters when you typeconfig.param_name
. This is bothersome because I often forget the exact naming of a parameter and wish there were hints about what parameters may be withinConfig
. To solve this I propose putting certain major parameters, specifically those that will be present for all diseases, as hints in the class statically. Something like this example:The reason we cant do this for all parameters is that a
Config
class may be loaded with a number of differentjson
files, and thus have different parameters. The only file we require across all instances ofMechanisticModel
is a global file.The text was updated successfully, but these errors were encountered: