From a72cf6c936e75c4497cc8e33ae12f55691c878bd Mon Sep 17 00:00:00 2001 From: arjunsavel Date: Thu, 22 Aug 2024 11:57:18 -0400 Subject: [PATCH 1/3] fix pandas sep in io --- src/scope/input_output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scope/input_output.py b/src/scope/input_output.py index 28d2afb..25917ca 100644 --- a/src/scope/input_output.py +++ b/src/scope/input_output.py @@ -155,7 +155,7 @@ def parse_input_file( # Read the remaining lines with pandas df = pd.read_csv( io.StringIO("\n".join(data_lines)), - delim_whitespace=True, + sep="\s+", header=None, names=["parameter", "value"], comment="#", From 0207d8194f41be01d764317daf52fad0fc18882a Mon Sep 17 00:00:00 2001 From: arjunsavel Date: Thu, 22 Aug 2024 11:57:41 -0400 Subject: [PATCH 2/3] fix pandas sep in tellurics too! --- src/scope/tellurics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scope/tellurics.py b/src/scope/tellurics.py index 2746e13..b7f39aa 100644 --- a/src/scope/tellurics.py +++ b/src/scope/tellurics.py @@ -30,7 +30,7 @@ def read_atran(path): path, index_col=0, names=["wav", "depth"], - delim_whitespace=True, + sep="\s+", ).drop_duplicates(subset=["wav"]) return atran From f1cb5059bf5ab3afebc5d7d0150136e79b30349d Mon Sep 17 00:00:00 2001 From: arjunsavel Date: Thu, 22 Aug 2024 12:11:12 -0400 Subject: [PATCH 3/3] now raw string sep --- src/scope/input_output.py | 2 +- src/scope/tellurics.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scope/input_output.py b/src/scope/input_output.py index 25917ca..7c652a8 100644 --- a/src/scope/input_output.py +++ b/src/scope/input_output.py @@ -155,7 +155,7 @@ def parse_input_file( # Read the remaining lines with pandas df = pd.read_csv( io.StringIO("\n".join(data_lines)), - sep="\s+", + sep=r"\s+", header=None, names=["parameter", "value"], comment="#", diff --git a/src/scope/tellurics.py b/src/scope/tellurics.py index b7f39aa..90aefb5 100644 --- a/src/scope/tellurics.py +++ b/src/scope/tellurics.py @@ -30,7 +30,7 @@ def read_atran(path): path, index_col=0, names=["wav", "depth"], - sep="\s+", + sep=r"\s+", ).drop_duplicates(subset=["wav"]) return atran