BCCN-Prog / weather_2016

For the BCCN 2016 advanced programming project
3 stars 1 forks source link

Value error in the wrapper #47

Closed erensezener closed 8 years ago

erensezener commented 8 years ago

This is what happens when we run Alicja's script. @ge00rg @gkBCCN @clauslang

Traceback (most recent call last):
  File "call_scrapers.py", line 54, in <module>
    sc_dt(date_string, city, DATAPATH)
  File "/home/pcp2016/weather_2016/scraping/timeanddate_com/scraping_timeanddate2.py", line 165, in scrape
    daily_db.save_dict(out_dict)
  File "/home/pcp2016/weather_2016/wrapper/DataWrapH5py.py", line 210, in save_dict
    self.add_data_point(**arg_dict)
  File "/home/pcp2016/weather_2016/wrapper/DataWrapH5py.py", line 149, in add_data_point
    self.f["weather_data"][self.f["metadata"][0], 10] = day  # how many days in future forecasted
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (-------src-dir-------/h5py/_objects.c:2582)
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (-------src-dir-------/h5py/_objects.c:2541)
  File "/home/pcp2016/miniconda3/lib/python3.5/site-packages/h5py/_hl/dataset.py", line 595, in __setitem__
    selection = sel.select(self.shape, args, dsid=self.id)
  File "/home/pcp2016/miniconda3/lib/python3.5/site-packages/h5py/_hl/selections.py", line 92, in select
    sel[args]
  File "/home/pcp2016/miniconda3/lib/python3.5/site-packages/h5py/_hl/selections.py", line 259, in __getitem__
    start, count, step, scalar = _handle_simple(self.shape,args)
  File "/home/pcp2016/miniconda3/lib/python3.5/site-packages/h5py/_hl/selections.py", line 447, in _handle_simple
    x,y,z = _translate_int(int(arg), length)
  File "/home/pcp2016/miniconda3/lib/python3.5/site-packages/h5py/_hl/selections.py", line 467, in _translate_int
    raise ValueError("Index (%s) out of range (0-%s)" % (exp, length-1))
ValueError: Index (10) out of range (0-9)
gkBCCN commented 8 years ago

Did you create a new database after you updated the script?

erensezener commented 8 years ago

Solved the problem by deleting the old database. Thanks.