Skip to content

[Bug]: Raise an exception if the TE stitch file does not exist or is an empty file (tc_analysis set) #872

@tomvothecoder

Description

@tomvothecoder

What happened?

Related to #866

The TE stitch file used by zppy was empty, which raised an ambiguous parsing error.

/lcrc/group/e3sm/ac.forsyth2/zppy_min_case_e3sm_diags_cdat_migrated_output/test-diags-no-cdat-20240917/v3.LR.historical_0051/post/atm/tc-analysis_1987_1988/cyclones_stitch_v3.LR.historical_0051_1987_1988.dat

What did you expect to happen? Are there are possible answers you came across?

No response

Minimal Complete Verifiable Example (MVCE)

No response

Relevant log output

2024-10-09 16:25:18,711 [ERROR]: core_parameter.py(_run_diag:343) >> Error in e3sm_diags.driver.tc_analysis_driver
  Traceback (most recent call last):
    File "/home/ac.tvo/E3SM-Project/e3sm_diags/e3sm_diags/parameter/core_parameter.py", line 340, in _run_diag
      single_result = module.run_diag(self)
    File "/home/ac.tvo/E3SM-Project/e3sm_diags/e3sm_diags/driver/tc_analysis_driver.py", line 91, in run_diag
      test_data["metrics"] = generate_tc_metrics_from_te_stitch_file(test_te_file)
    File "/home/ac.tvo/E3SM-Project/e3sm_diags/e3sm_diags/driver/tc_analysis_driver.py", line 181, in generate_tc_metrics_from_te_stitch_file
      te_stitch_vars = _get_vars_from_te_stitch(lines, max_len, num_storms)
    File "/home/ac.tvo/E3SM-Project/e3sm_diags/e3sm_diags/driver/tc_analysis_driver.py", line 258, in _get_vars_from_te_stitch
      year_start = int(lines[0].split("\t")[2])
  IndexError: list index out of range
  2024-10-09 16:25:22,252 [WARNING]: e3sm_diags_driver.py(main:378) >> There was not a single valid diagnostics run, no viewer created.
  2024-10-09 16:25:22,253 [ERROR]: run.py(run_diags:91) >> Error traceback:
  Traceback (most recent call last):
    File "/home/ac.tvo/E3SM-Project/e3sm_diags/e3sm_diags/run.py", line 89, in run_diags
      params_results = main(params)
    File "/home/ac.tvo/E3SM-Project/e3sm_diags/e3sm_diags/e3sm_diags_driver.py", line 397, in main
      if parameters_results[0].fail_on_incomplete and (
  IndexError: list index out of range

Anything else we need to know?

No response

Environment

main and cdat-migration-fy24 branch

Metadata

Metadata

Assignees

Labels

bugBug fix (will increment patch version)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions