equinor/semeio

Export crashes when there is no data

eivindjahren opened this issue · 0 comments

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create a config file with only "NUM_REALIZATIONS 1"
  2. run ert gui config.ert
  3. Run the export tool
  4. It crashes with
The script 'CsvExport2Job' caused an error while running:
'No data found for share/results/tables/unsmry--raw.csv'
Traceback (most recent call last):
  File ".../ert/config/ert_script.py", line 99, in initializeAndRun
    return self.run(*arguments)
  File ".../semeio/workflows/csv_export2/csv_export2.py", line 100, in run
    main(args)
  File ".../semeio/workflows/csv_export2/csv_export2.py", line 107, in main
    csv_exporter(
  File ".../semeio/workflows/csv_export2/csv_export2.py", line 85, in csv_exporter
    summary = ensemble_set.load_smry(time_index=time_index, column_keys=column_keys)
  File ".../fmu/ensemble/ensembleset.py", line 626, in load_smry
    ensemble.load_smry(
  File ".../fmu/ensemble/ensemble.py", line 805, in load_smry
    return self.get_df("share/results/tables/unsmry--" + time_index + ".csv")
  File ".../fmu/ensemble/ensemble.py", line 694, in get_df
    raise KeyError("No data found for " + localpath)
KeyError: 'No data found for share/results/tables/unsmry--raw.csv'

Expected behavior
The gui should indicate that there is no data to export rather than crash.