Skip to content
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

No carbonintensities when reporting actual usage #30

Closed
lfwa opened this issue Jul 31, 2020 · 6 comments
Closed

No carbonintensities when reporting actual usage #30

lfwa opened this issue Jul 31, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@lfwa
Copy link
Owner

lfwa commented Jul 31, 2020

Traceback (most recent call last):
  File "/home/manvi/Documents/carbontracker/carbontracker/tracker.py", line 284, in epoch_end
    self._output_actual()
  File "/home/manvi/Documents/carbontracker/carbontracker/tracker.py", line 358, in _output_actual
    _co2eq = self._co2eq(energy)
  File "/home/manvi/Documents/carbontracker/carbontracker/tracker.py", line 381, in _co2eq
    ci = self.intensity_updater.average_carbon_intensity(pred_time_dur)
  File "/home/manvi/Documents/carbontracker/carbontracker/tracker.py", line 55, in average_carbon_intensity
    ci.carbon_intensity = self.carbon_intensities[-1].carbon_intensity
IndexError: list index out of range

Originally posted by @agarwalmanvi in #29 (comment)

@lfwa lfwa added the bug Something isn't working label Jul 31, 2020
@lfwa
Copy link
Owner Author

lfwa commented Aug 4, 2020

@agarwalmanvi I was able to reproduce this error by using carbontracker in a Python shell in interactive mode. However, I could not reproduce it in script mode. Were you using an interactive shell when you stumbled upon this error?

@lfwa lfwa closed this as completed in 9fa096b Aug 5, 2020
@agarwalmanvi
Copy link

Hi @lfwa , apologies for taking some time to respond. I came across this error while running the plain Python script described in this comment. Were you able to figure out why the error showed up in interactive mode? Maybe that's the reason why it shows up with my script too.

@lfwa
Copy link
Owner Author

lfwa commented Aug 5, 2020

It looked to be an error from the changes introduced in commit 101f5fb. It seems to only occur for users for whom no live carbon intensity is available.

@agarwalmanvi
Are you using carbontracker version 1.1.2 installed from pip or did you pull the package directly from GitHub?

@agarwalmanvi
Copy link

I pulled directly from GitHub and installed it using the setup.py file.

@agarwalmanvi
Copy link

It looked to be an error from the changes introduced in commit 101f5fb. It seems to only occur for users for whom no live carbon intensity is available.

What's the recommended solution for this? Perhaps I can retry running my script with the solution to see if this error is solved!

@lfwa
Copy link
Owner Author

lfwa commented Aug 5, 2020

The error should be fixed if you pull the repo again. You can also pip install v1.1.2, where these late changes and errors do not exist.

Let me know if this solves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants