Open JrtPec opened 8 years ago
I think the problem lies in sensor._unit_conversion_factor()
, on lines like source = self.unit + '/' + resample
, which works great when resample
is something like 'min'
or 'hour
'. I just tried 'MS
', which is start of month, but was interpreted as MegaSiemens... :-/
get_data()
should have 4 arguments:
rule
: s, min, h, d, w, m, ...If the source is cumulative: power & energy imply a diff()
, energy cumulative implies no diff.
If the source is not cumulative: power & energy are ok, energy cumulative implies a sum()
.
We have to rewrite the conversion from power to energy.
I tried putting myself in the shoes of someone who's not so experienced with OpenGrid while trying to design an analysis. I want to do an analysis on monthly gas consumption, preferably in kWh.
gas_sensor.get_data(resample='M', unit='kWh')
gives meUndefinedUnitError: 'M' is not defined in the unit registry
, other combinations give me a range ofValueError
,DimensionalityError
, ...Little did I know that I had to flag
diff=False
, only so I can dodf.diff()
afterwards to get a monthly gas consumption in kWh.Anyhow... something we could work on this evening?