JRCSTU / CO2MPAS-TA

EU's Type-Approving vehicle simulator predicting NEDC CO2 emissions from WLTP
https://co2mpas.readthedocs.io/
European Union Public License 1.1
23 stars 13 forks source link

Datasync GUI error "arg is an empty sequence" #4

Closed compass-jones closed 7 years ago

compass-jones commented 7 years ago

After creating & selecting a datasync-template, when trying to run it, I get his error message in the console:

2016-11-25 11:39:35,170:tkui:CRITICAL:Unhandled TkUI exception:
Traceback (most recent call last):
  File "C:\Users\gjones\Downloads\co2mpas_ALLINONE-64bit-v1.4.1\co2mpas_ALLINONE-64bit-v1.4.1\Apps\WinPython\python-3.5.2.amd64\lib\tkinter\__init__.py", line 1550, in __call__
    return self.func(*args)
  File "C:\Users\gjones\Downloads\co2mpas_ALLINONE-64bit-v1.4.1\co2mpas_ALLINONE-64bit-v1.4.1\Apps\WinPython\python-3.5.2.amd64\lib\site-packages\co2mpas\tkui.py", line 1607, in run_sync
    force=True)
  File "C:\Users\gjones\Downloads\co2mpas_ALLINONE-64bit-v1.4.1\co2mpas_ALLINONE-64bit-v1.4.1\Apps\WinPython\python-3.5.2.amd64\lib\site-packages\co2mpas\datasync.py", line 552, in do_datasync
    interpolation_methods=interpolation_methods)
  File "C:\Users\gjones\Downloads\co2mpas_ALLINONE-64bit-v1.4.1\co2mpas_ALLINONE-64bit-v1.4.1\Apps\WinPython\python-3.5.2.amd64\lib\site-packages\co2mpas\datasync.py", line 333, in synchronize
    res =list(res)
  File "C:\Users\gjones\Downloads\co2mpas_ALLINONE-64bit-v1.4.1\co2mpas_ALLINONE-64bit-v1.4.1\Apps\WinPython\python-3.5.2.amd64\lib\site-packages\co2mpas\datasync.py", line 262, in _yield_synched_tables
    m, M = min(min(d[x_label]), m), max(max(d[x_label]), M)
ValueError: min() arg is an empty sequence
2016-11-25 11:39:35,171:tkui:CRITICAL:Unhandled TkUI exception: (<tkinter.Tk object .>, <class 'ValueError'>, ValueError('min() arg is an empty sequence',), <traceback object at 0x000000000E815C48>)

Here it is my file (non-confidential data): datasync1.xlsx

VictorValverde commented 7 years ago

This happens when trying to run datasync on an empty file (NO data is provided in the dyno or obd tabs of the Excel. We will include a check to avoid running empty files it in the future together with a warning to the user. ( @vinci1it2000 )

ankostis commented 7 years ago

GUI cannot detect this - it has to bee fixed inside the datasync code, where it actually reads the files. @vinci1it2000 it's yours.

vinci1it2000 commented 7 years ago

@compass-jones The template had an empty table. This has caused the warning.

Now I add a help message, to describe the problem:

Cannot read sync-sheet(0: file.xlsx) due to: Empty table of sheet('ref') in book ('file:///ffile.xlsx')!

Best,

Vincenzo Arcidiacono