diff --git a/test/support_files/outputs/FOFT_A1912.csv b/test/support_files/outputs/FOFT_A1912.csv index 2af94ae4..f52a8faf 100644 --- a/test/support_files/outputs/FOFT_A1912.csv +++ b/test/support_files/outputs/FOFT_A1912.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2a8eb70f82dd761cc5b82ce7d5afd0b591d1cd8f415b3fe81e4f319cc39436f -size 2313 +oid sha256:5805a1bac61b021157451f39d1002a930f4c111f4ff37d02c1acaf850c60712e +size 2625 diff --git a/test/support_files/outputs/FOFT_A1912_T2.csv b/test/support_files/outputs/FOFT_A1912_T2.csv new file mode 100644 index 00000000..2af94ae4 --- /dev/null +++ b/test/support_files/outputs/FOFT_A1912_T2.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2a8eb70f82dd761cc5b82ce7d5afd0b591d1cd8f415b3fe81e4f319cc39436f +size 2313 diff --git a/test/support_files/outputs/GOFT_A1162.csv b/test/support_files/outputs/GOFT_A1162.csv index b5722787..badf3578 100644 --- a/test/support_files/outputs/GOFT_A1162.csv +++ b/test/support_files/outputs/GOFT_A1162.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:89722a5e4acb0c842dfaaa72e0d2294944e779e76dd6eabbce189b09e5fadcf7 -size 1855 +oid sha256:a0289879c400585e756250fb3620f4ab8918f3e23db15dcfa8b5d3326a638a63 +size 2100 diff --git a/test/support_files/outputs/GOFT_A1162_T2.csv b/test/support_files/outputs/GOFT_A1162_T2.csv new file mode 100644 index 00000000..b5722787 --- /dev/null +++ b/test/support_files/outputs/GOFT_A1162_T2.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89722a5e4acb0c842dfaaa72e0d2294944e779e76dd6eabbce189b09e5fadcf7 +size 1855 diff --git a/test/test_output.py b/test/test_output.py index 77b009e1..ef6b2a60 100644 --- a/test/test_output.py +++ b/test/test_output.py @@ -21,6 +21,16 @@ [ ( "FOFT_A1912.csv", + { + "TIME": 4.393722000e9, + "PRES": 1.8740899675005e8, + "TEMP": 720.0, + "SAT_G": 0.0, + "SAT_L": 24.0, + }, + ), + ( + "FOFT_A1912_T2.csv", { "TIME": 3.06639400e9, "PRES": 1.83000721e8, @@ -31,6 +41,10 @@ ), ( "GOFT_A1162.csv", + {"TIME": 4.393722000e9, "GEN": -30.0, "ENTG": 1.528048035348e7, "PWB": 0.0}, + ), + ( + "GOFT_A1162_T2.csv", {"TIME": 3.06639400e9, "GEN": -27.5, "ENTG": 1.40141971e7, "PWB": 0.0}, ), ], diff --git a/toughio/__about__.py b/toughio/__about__.py index 5e8da086..1eb94176 100644 --- a/toughio/__about__.py +++ b/toughio/__about__.py @@ -1,4 +1,4 @@ -__version__ = "1.4.1" +__version__ = "1.4.2" __author__ = "Keurfon Luu" __author_email__ = "keurfonluu@lbl.gov" __website__ = "https://github.com/keurfonluu/toughio" diff --git a/toughio/_io/output/_helpers.py b/toughio/_io/output/_helpers.py index ee1e4f19..d247a1d8 100644 --- a/toughio/_io/output/_helpers.py +++ b/toughio/_io/output/_helpers.py @@ -151,12 +151,18 @@ def read_history(filename): with open(filename, "r") as f: line = f.readline().strip() - headers = line.split()[1:] + + if line.startswith('"'): + sep = "," + line = line.replace('"', "") + else: + sep = None + headers = [x.strip() for x in line.split(sep)[1:]] data = [] line = f.readline().strip() while line: - data += [[float(x) for x in line.split()]] + data += [[float(x) for x in line.split(sep)]] line = f.readline().strip() data = numpy.transpose(data)