Skip to content

Commit

Permalink
Removed unused write methods from the AWS class
Browse files Browse the repository at this point in the history
I couldn't see any usages of writeArr, writeL2 and writeL3 in the repository.
  • Loading branch information
ladsmund authored and BaptisteVandecrux committed Nov 24, 2024
1 parent 55e5cba commit 8a22757
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/pypromice/process/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,6 @@ def process(self):
self.getL2()
self.getL3()

def writeL2(self, outpath):
"""Write L2 data to .csv and .nc file"""
if os.path.isdir(outpath):
self.writeArr(self.L2, outpath)
else:
logger.info(f"Outpath f{outpath} does not exist. Unable to save to file")
pass

def writeL3(self, outpath):
"""Write L3 data to .csv and .nc file"""
if os.path.isdir(outpath):
self.writeArr(self.L3, outpath)
else:
logger.info(f"Outpath f{outpath} does not exist. Unable to save to file")
pass

def getL1(self):
"""Perform L0 to L1 data processing"""
logger.info("Level 1 processing...")
Expand All @@ -164,28 +148,6 @@ def getL3(self):
logger.info("Level 3 processing...")
self.L3 = toL3(self.L2, data_adjustments_dir=self.data_issues_repository / "adjustments")

def writeArr(self, dataset, outpath, t=None):
"""Write L3 data to .nc and .csv hourly and daily files
Parameters
----------
dataset : xarray.Dataset
Dataset to write to file
outpath : str
Output directory
t : str
Resampling string. This is automatically defined based
on the data type if not given. The default is None.
"""
if t is not None:
write.prepare_and_write(dataset, outpath, self.vars, self.meta, t)
else:
f = [l.attrs["format"] for l in self.L0]
if "raw" in f or "STM" in f:
write.prepare_and_write(dataset, outpath, self.vars, self.meta, "10min")
else:
write.prepare_and_write(dataset, outpath, self.vars, self.meta, "60min")

def loadConfig(self, config_file, inpath):
"""Load configuration from .toml file
Expand Down

0 comments on commit 8a22757

Please sign in to comment.