Skip to content

Commit

Permalink
python 3.12 string updates
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunwbell committed Oct 31, 2024
1 parent 897bff2 commit eb042da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/EcoFOCIpy/io/rcm_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def parse(self, filename=None, number_of_channels=8, time_format=0, datetime_ind
else:
headernames=['sample','date','time','ident','speed_engr','dir_engr','temp_engr','cond_engr','press_engr']

rawdata_df = pd.read_csv(filename, names=headernames, delimiter="\s+",)
rawdata_df = pd.read_csv(filename, names=headernames, delimiter=r'\s+',)
if time_format == 0:
rawdata_df["date_time"] = pd.to_datetime(
rawdata_df['date'] + " " + rawdata_df['time'], format="%m/%d/%Y %H:%M:%S"
Expand Down
6 changes: 3 additions & 3 deletions src/EcoFOCIpy/io/sbe_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def parse(filename=None, return_header=True, datetime_index=True):


rawdata_df = pd.read_csv(filename,
delimiter="\s+",
delimiter=r'\s+',
parse_dates=True,
header=None,
names=var_names.values(),
Expand Down Expand Up @@ -131,7 +131,7 @@ def parse(filename=None, datetime_index=True):
assert filename.split('.')[-1] == 'tid' , 'Must provide a tid file - use sbe software to convert'

rawdata_df = pd.read_csv(filename,
delimiter="\s+",
delimiter=r'\s+',
skiprows=1,
names=["date", "time", "pressure", "temperature"])

Expand Down Expand Up @@ -289,7 +289,7 @@ def parse(filename=None, return_header=True, datetime_index=True):


rawdata_df = pd.read_csv(filename,
delimiter="\s+",
delimiter=r'\s+',
parse_dates=True,
header=None,
names=var_names.values(),
Expand Down
2 changes: 1 addition & 1 deletion src/EcoFOCIpy/io/wetlabs_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def parse(self, filename=None, return_header=True, datetime_index=True):


rawdata_df = pd.read_csv(filename,
delimiter="\s+",
delimiter=r'\s+',
parse_dates=True,
header=None,
skiprows=headercount)
Expand Down
2 changes: 1 addition & 1 deletion src/EcoFOCIpy/io/wpak_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def parse(filename=None, argos_file=False, datetime_index=True):
"""
assert filename != None , 'Must provide a datafile'

rawdata_df = pd.read_csv(filename, header=0, delimiter="\s+")
rawdata_df = pd.read_csv(filename, header=0, delimiter=r'\s+')
rawdata_df["date_time"] = pd.to_datetime(
rawdata_df["DATE"] + " " + rawdata_df["TIME"], format="%y/%m/%d %H:%M:%S"
)
Expand Down

0 comments on commit eb042da

Please sign in to comment.