-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index out of bounds error if cpi on data containing partial days #1
Comments
Thank you for your feedback. This is currently not handled as we just used data that starts and ends with whole days. |
Yeah right, now I see that half days are actually not useful for cpi at all. A quickfix would be filling start and end with nans to integer length, applying cpi and discarding the imputed start and end provided there are missing values in the start and end partial days that should be imputed |
It would be helpful to output a warning in the console and stop the algorithm if one tries to apply CPI on data containing partial days: e.g. in cpi.py fit method line 45 after vpd is determined: if ets.shape[0] % self.vpd != 0: plus "import logging" at the beginning (And I could not push to your repo due to git discrepancy on my side) |
Implementing logger outputs, another reasonable measure is to output whether the given energy time series is non-decreasing and not flawed: e.g. you also could add in the fit method in cpi.py after line 46 (energy was assigned) for i in range(1, energy.size): |
Thank you for your suggestions. I looked into the mentioned problems and started implementing your suggested solutions. I think, a rewrite with those edge cases in mind would result in a more useful package for more users. I can't give an estimate on the time frame on that tough. For now, I'll add a paragraph to the readme. |
If I use cpi on data that doesn't comprise an integer length of days (e.g. 7.5 days) _calc_energy_per_day throws an index-out-of-bounds error. I could correct that by changing line 151 in cpi.py to
daily = np.zeros(int(np.ceil(power.shape[0] / self.vpd)))
and wanted to pose a pull request, but could not push my local branch.
With my current understanding processing data, that contains partial days is no problem for cpi, but of course that should also be thought through (maybe that leads to other problems).
The text was updated successfully, but these errors were encountered: