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
eemeter==4.0.7
pandas==2.0.3
scipy==1.10.1
numpy==1.24.4
(This is happening in the test suite of the current repo as well)
Describe the bug
When fitting data that contains heating degree days, the model will serialize the hdd_beta as negative for a c_hdd_tidd model but positive for a hdd_tidd_cdd. This is not consistent with how it was in eemeter 2.0, where it was always serialized as positive, and also isn't internally consistent.
importpandasaspdimportrandomimporteemeterfromdatetimeimportUTCrandom.seed(1)
hpp=65df=pd.DataFrame(index=pd.date_range('2021-01-01','2021-12-31',freq='D', tz=UTC))
df['temperature'] =np.random.normal(balance_point, 5, len(df)) # random temperaturesdf['observed'] =100- (df['temperature']).clip(0,hpp) # usage decreasing from 100 at 0 degrees -> 35 at hppdf2=df.copy()
cpp=70df2.loc[df2['temperature']>cpp,'observed'] =df['temperature'] -35# adds increasing usage from 35 at cpp to 65 at 100
df represents a heating only model, while df2 is the same data but also with cooling load.
The heating-degree-days slope in the serialized model to be the same sign (always positive) for both c_hdd_tidd and cdd_tidd_hdd models, which also aligns with what is was for CalTrack 2.0 (always positive).
Report installed package versions
Describe the bug
When fitting data that contains heating degree days, the model will serialize the
hdd_beta
as negative for ac_hdd_tidd
model but positive for ahdd_tidd_cdd
. This is not consistent with how it was in eemeter 2.0, where it was always serialized as positive, and also isn't internally consistent.df represents a heating only model, while df2 is the same data but also with cooling load.
This outputs the following, note the negative sign on
hdd_beta
:When we run using df2, which is the same heating data but with a cooling load too (which means eemeter uses an HDD_TIDD_CDD model instead):
Note that now
hdd_beta
is positive:This was not true of eemeter 2.0
Returned the following for a heating-only model:
And the following for a heating+cooling model:
Returned the followign for a heating and cooling model:
Expected behavior
The heating-degree-days slope in the serialized model to be the same sign (always positive) for both c_hdd_tidd and cdd_tidd_hdd models, which also aligns with what is was for CalTrack 2.0 (always positive).
Additional context
I believe this has to do with the fact that this line exists in the
hdd_tidd_cdd
model code: https://github.com/openeemeter/eemeter/blob/master/eemeter/eemeter/models/daily/base_models/hdd_tidd_cdd.py#L326 but no equivalent line exists in thec_hdd_tidd
code. However when I tried to simply add it, it seemed to break lots of tests.The text was updated successfully, but these errors were encountered: