Skip to content

Commit

Permalink
Merge pull request #262 from blakecaldwell/commas_in_data
Browse files Browse the repository at this point in the history
ENH: read data files that are comma-delimited
  • Loading branch information
blakecaldwell authored Nov 20, 2020
2 parents 6342b89 + 6f87770 commit 04384e5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions hnn_qt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -3383,10 +3383,10 @@ def excepthook(self, exc_type, exc_value, exc_tb):
# We need to use print_exception(...):
traceback.print_exception(exc_type, exc_value, enriched_tb)
msgBox = QMessageBox(self)
msgBox.information(self, "Exception", "WARNING: an exception occurred! Details can be "
"found in hnn_docker.log or the console output. We would "
"greatly appreciate reporting this issue to our development "
"team: <a href=https://github.com/jonescompneurolab/hnn/issues>"
msgBox.information(self, "Exception", "WARNING: an exception occurred! "
"Details can be found in the console output. Please "
"include this output when opening an issue og GitHub: "
"<a href=https://github.com/jonescompneurolab/hnn/issues>"
"https://github.com/jonescompneurolab/hnn/issues</a>")


Expand Down Expand Up @@ -3458,10 +3458,14 @@ def loadDataFile (self, fn):

import simdat
try:
self.dextdata[fn] = np.loadtxt(fn)
self.dextdata[fn] = np.loadtxt(fn)
except ValueError:
QMessageBox.information(self, "HNN", "WARNING: could not load data file %s" % fn)
return False
# possible that data file is comma delimted instead of whitespace delimted
try:
self.dextdata[fn] = np.loadtxt(fn, delimiter=',')
except ValueError:
QMessageBox.information(self, "HNN", "WARNING: could not load data file %s" % fn)
return False
except IsADirectoryError:
QMessageBox.information(self, "HNN", "WARNING: could not load data file %s" % fn)
return False
Expand Down

0 comments on commit 04384e5

Please sign in to comment.