impactlab / eemeter

‼️ MOVED TO https://github.com/openeemeter/eemeter - Core computation engine for the Open Energy Efficiency Meter
https://eemeter.readthedocs.io/
MIT License
25 stars 13 forks source link

All-null weather should not make meter fail catastrophically #123

Closed philngo closed 8 years ago

philngo commented 8 years ago

This error needs to be caught in eemeter.weather, and the reason why the weather source this project is referencing returned a all nulls needs to be checked.


Running meter for Project 02e41664-24d4-4d5f-9d85-fb3f4df8d62f
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/conda/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/opt/conda/lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/conda/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/conda/lib/python3.5/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/code/datastore/management/commands/runmeternewonly.py", line 12, in handle
    project.run_meter()
  File "/code/datastore/models.py", line 109, in run_meter
    project, cm_ids = self.eemeter_project()
  File "/code/datastore/models.py", line 102, in eemeter_project
    project = EEMeterProject(location, consumption, self.baseline_period, self.reporting_period)
  File "/opt/conda/lib/python3.5/site-packages/eemeter/project.py", line 63, in __init__
    weather_source = GSODWeatherSource(location.station)
  File "/opt/conda/lib/python3.5/site-packages/eemeter/weather.py", line 545, in __init__
    cache_filename)
  File "/opt/conda/lib/python3.5/site-packages/eemeter/weather.py", line 497, in __init__
    self.load_from_cache()
  File "/opt/conda/lib/python3.5/site-packages/eemeter/weather.py", line 528, in load_from_cache
    self.tempC = pd.Series(values, index=index).sort_index().resample(self.freq).mean()
  File "/opt/conda/lib/python3.5/site-packages/pandas/tseries/resample.py", line 467, in f
    return self._downsample(_method)
  File "/opt/conda/lib/python3.5/site-packages/pandas/tseries/resample.py", line 573, in _downsample
    self.grouper, axis=self.axis).aggregate(how, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/pandas/core/groupby.py", line 2573, in aggregate
    return getattr(self, func_or_funcs)(*args, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/pandas/core/groupby.py", line 935, in mean
    return self._cython_agg_general('mean')
  File "/opt/conda/lib/python3.5/site-packages/pandas/core/groupby.py", line 752, in _cython_agg_general
    raise DataError('No numeric types to aggregate')
pandas.core.base.DataError: No numeric types to aggregate