Right now in every function of the openmeteo_api we have a part of the code which does the same unit conversion.
It would be good to put this functionality into a separated function which can work for all.
This function should get as input
a dataframe
a mapping of variables and units conversion
It should also read the original units from the relevant array, which should always be in the dataframe attrs.
It should return the original dataframe with just the conversion and anything else the same.
Right now in every function of the
openmeteo_api
we have a part of the code which does the same unit conversion. It would be good to put this functionality into a separated function which can work for all. This function should get as inputIt should also read the original units from the relevant array, which should always be in the dataframe
attrs
.It should return the original dataframe with just the conversion and anything else the same.