Open sadamov opened 1 month ago
I agree that this is very useful to have. I would rather extend the Config
class with it than put it as part of the ARModel
. As mentioned above, this is very useful information that is needed in many places in the code. Therefore I would not want to associate it with the model class specifically. These maps are also direct consequences of the data config, making it logical to access from the same object.
Maybe it would be worth to wait with this until after #24 is done? But I would not be against introducing this now and just adapting it when we change that.
Description
Tracking of which feature-channel corresponds to which variable and vertical level of the input data is benefitial for plotting, verification and more...
precompute_variable_indices()
method to precompute the indices for each variable in the input tensor.selected_vars_units
attribute to store the short names and units of the selected variables.Implementation
Suggestion to add the following code to the ARModel class:
Benefits
precompute_variable_indices()
method will allow efficient lookup of indices for each variable in the input tensor, avoiding the need to recompute them during runtime. This is very flexible as the user can define it inconstants.py
selected_vars_units
attribute will provide easy access to the short names and units of the selected variables, which can be useful for plotting, logging, or other purposes.