NREL / reV

Renewable Energy Potential (reV) Model
https://nrel.github.io/reV/
BSD 3-Clause "New" or "Revised" License
107 stars 24 forks source link

KeyError on "FOUT" and "DIROUT" #302

Closed WilliamsTravis closed 3 years ago

WilliamsTravis commented 3 years ago

Bug Description Using the CLI, generation is failing with a key error for 'FOUT' in the SLURM submission step on cli_gen.py line 673. When that key is updated to 'OUT_FPATH' (traceback not included), it fails with a key error on 'DIROUT' for the next line. Removing the 'DIROUT' entry and inferring dirout from fout seems to fix the problem. This might also be an issue with econ since these keys were also adjusted the econ CLI file in this commit: https://github.com/NREL/reV/commit/06a31cd0148e6ef7f23a6d6b2bfc4260d72e2a04

Full Traceback

Traceback (most recent call last):
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/lustre/eaglefs/shared-projects/rev/modulefiles/gitrepos/reV/reV/cli.py", line 327, in <module>
    main(obj={})
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/core.py", line 1236, in invoke
    return Command.invoke(self, ctx)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/lustre/eaglefs/shared-projects/rev/modulefiles/gitrepos/reV/reV/cli.py", line 68, in generation
    verbose=verbose)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/lustre/eaglefs/shared-projects/rev/modulefiles/gitrepos/reV/reV/generation/cli_gen.py", line 120, in from_config
    submit_from_config(ctx, name, year, config, i, verbose=verbose)
  File "/lustre/eaglefs/shared-projects/rev/modulefiles/gitrepos/reV/reV/generation/cli_gen.py", line 187, in submit_from_config
    verbose=verbose)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/shared-projects/rev/modulefiles/conda_env/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/lustre/eaglefs/shared-projects/rev/modulefiles/gitrepos/reV/reV/generation/cli_gen.py", line 673, in slurm
    fout = ctx.obj['FOUT']
KeyError: 'FOUT'

To Reproduce Run the reV generation cli with a SLURM submission to the HPC.

Expected behavior reV submits the generation jobs to EAGLE.

System (please complete the following information):

MRossol commented 3 years ago

Wow I'm surprised our tests missed this...

MRossol commented 3 years ago

Nevermind, stupid SLURM commands...

MRossol commented 3 years ago

Fixed with last commit to main

nickwg03 commented 3 years ago

@MRossol I hit this error using 0.5.1. Has this not been deployed yet? I'm installing via conda

MRossol commented 3 years ago

we didn't' do a release yet since Travis said he didn't need it, but we have a release upcoming. @grantbuster are you ready to merge and release your feature?

nickwg03 commented 3 years ago

Haha, sorry. I'm less capable than Travis for debugging on the fly :). I'd welcome a release.

grantbuster commented 3 years ago

I was going to wait but yeah we can go ahead!