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

CATS crashes when having low duration (5min) #119

Open
abhidg opened this issue Oct 3, 2024 · 0 comments
Open

CATS crashes when having low duration (5min) #119

abhidg opened this issue Oct 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@abhidg
Copy link
Contributor

abhidg commented Oct 3, 2024

At datetime Thu 3 Oct 2024 17:51:23 UTC, when running from 34c951e:

> python -m cats -d 4 --loc RG1
WARNING:root:config file not found
WARNING:root:Unspecified carbon intensity forecast service, using carbonintensity.org.uk
Traceback (most recent call last):
  File "/Users/abhidg/.pyenv/versions/3.10.12/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/abhidg/.pyenv/versions/3.10.12/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/abhidg/ghq/github.com/GreenScheduler/cats/cats/__main__.py", line 4, in <module>
    main()
  File "/Users/abhidg/ghq/github.com/GreenScheduler/cats/cats/__init__.py", line 288, in main
    now_avg, best_avg = get_avg_estimates(CI_forecast, duration=duration)
  File "/Users/abhidg/ghq/github.com/GreenScheduler/cats/cats/optimise_starttime.py", line 26, in get_avg_estimates
    return wf[0], min(wf)
  File "/Users/abhidg/ghq/github.com/GreenScheduler/cats/cats/forecast.py", line 147, in __iter__
    yield self.__getitem__(index)
  File "/Users/abhidg/ghq/github.com/GreenScheduler/cats/cats/forecast.py", line 97, in __getitem__
    self.data[index + 1],
IndexError: list index out of range

24 minutes works fine:

> python -m cats -d 24 --loc RG1
Best job start time 2024-10-05 17:22:48.424186+05:30
Carbon intensity if job started now       = 286.16 gCO2eq/kWh
Carbon intensity at optimal time          = 95.41 gCO2eq/kWh

As does higher values, with 2850 minutes being the maximum:

> python -m cats -d 2850 --loc RG1
Best job start time 2024-10-03 23:23:33.355866+05:30
Carbon intensity if job started now       = 167.13 gCO2eq/kWh
Carbon intensity at optimal time          = 167.13 gCO2eq/kWh

Attached cats_cache.sqlite.zip

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

1 participant