Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with invalid config file path #86

Merged
merged 1 commit into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Utilities/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

import io
from configparser import RawConfigParser
import os.path

#from ast import literal_eval as eval

def parseBool(txt):
Expand Down Expand Up @@ -273,6 +275,8 @@ def read(self, filename):
return
if self.readonce:
return
if not os.path.exists(filename):
raise ValueError("config file does not exist: {}".format(filename))
RawConfigParser.read(self, filename)
self.readonce = True

Expand Down
2 changes: 1 addition & 1 deletion wind/windmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def secondDerivative(self):
assert d2Vm < 0.0
except AssertionError:
log.critical(("Pressure deficit: {0:.2f} hPa,"
" RMW: {1:%2f} km".format(dP/100., rMax/1000.)))
" RMW: {1:.2f} km".format(dP/100., rMax/1000.)))
raise

return d2Vm
Expand Down