there are several settings that have to be removed from the parameters, that should be set in Meta, and can be removed from the class more easily than the way they currently are.
EG: DataSourceBase removes reader so it can get the properties and then if it's set in the subclass resets it. Instead set this in Meta
This would allow parameters to be read more easily and also even allow mixing of file params and class params.
This requires one of the common base meta classes to filter the meta out first, but it's already doing this for hardcoded settings.
There are several related TODO's like this in the SimEng2 project, for setting data reader parameters in the class so that the parameter structure is more consistent between readers. Currently, every reader has a different format. The idea of creating a parameter field class is in another issue somewhere too. Or reusing or repurposing a generic serializer like Marshmallow.
class solar_data(DataSource):
# TODO: make parameters consistent for all readers
# TODO: parameters set by attributes in data source model fields
ghi = FloatField('GHI', units='W/m**2')
solar_azimuth = FloatField('solar azimuth', units='degrees')
# TODO: some parameters set in class Meta
class Meta:
args = ['GHI', 'azimuth'] # names to use for the first two args are positional
data_reader = ArgumentReader
there are several settings that have to be removed from the parameters, that should be set in
Meta
, and can be removed from the class more easily than the way they currently are.EG:
DataSourceBase
removes reader so it can get the properties and then if it's set in the subclass resets it. Instead set this in MetaThis would allow parameters to be read more easily and also even allow mixing of file params and class params.
This requires one of the common base meta classes to filter the meta out first, but it's already doing this for hardcoded settings.
There are several related TODO's like this in the SimEng2 project, for setting data reader parameters in the class so that the parameter structure is more consistent between readers. Currently, every reader has a different format. The idea of creating a parameter field class is in another issue somewhere too. Or reusing or repurposing a generic serializer like Marshmallow.