Skip to content

Commit

Permalink
Fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lsawade committed Jul 8, 2023
1 parent 05a65d2 commit 7bb1fed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/pyglimer/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ def start_logger_if_necessary(
logger.addHandler(fh)
return logger

def start_smart_logger(name: str):

logger = logging.getLogger(name)

def create_mpi_logger(logger: logging.Logger, rank: int) -> logging.Logger:
"""
Expand Down
24 changes: 10 additions & 14 deletions src/pyglimer/waveform/preprocessh5.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def print_progress(self):
self._pbar.n = self.n_completed_tasks
self._pbar.refresh()


def preprocessh5(
phase: str, rot: str, pol: str, taper_perc: float,
model: obspy.taup.TauPyModel, taper_type: str, tz: int, ta: int,
Expand Down Expand Up @@ -130,7 +131,6 @@ def preprocessh5(
globstr = os.path.join(rawloc, fpattern)
flist = list(glob(globstr))


# Checking whether file list is actually seen
logger.debug(f'RAWLOC: {rawloc}')
logger.debug(f'GLOBSTRING: {globstr}')
Expand Down Expand Up @@ -159,9 +159,9 @@ def preprocessh5(
elif client.lower() == 'joblib':
ProgressParallel(n_jobs=-1,)(
delayed(_preprocessh5_single)(
phase, rot, pol, taper_perc, model, taper_type, tz, ta, rfloc,
deconmeth, hc_filt, logger, rflogger,
f, evtcat, remove_response) for f in tqdm(flist))
phase, rot, pol, taper_perc, model, taper_type, tz, ta, rfloc,
deconmeth, hc_filt, logger, rflogger,
f, evtcat, remove_response) for f in tqdm(flist))

elif client.lower() == 'single':
for f in tqdm(flist):
Expand All @@ -176,11 +176,11 @@ def preprocessh5(


def _preprocessh5_single(
phase: str, rot: str, pol: str, taper_perc: float,
model: obspy.taup.TauPyModel, taper_type: str, tz: int, ta: int,
rfloc: str, deconmeth: str, hc_filt: float,
logger: logging.Logger, rflogger: logging.Logger,
hdf5_file: str, evtcat: obspy.Catalog, remove_response: bool):
phase: str, rot: str, pol: str, taper_perc: float,
model: obspy.taup.TauPyModel, taper_type: str, tz: int, ta: int,
rfloc: str, deconmeth: str, hc_filt: float,
logger: logging.Logger, rflogger: logging.Logger,
hdf5_file: str, evtcat: obspy.Catalog, remove_response: bool):
"""
Single core processing of one single hdf5 file.
Expand Down Expand Up @@ -238,11 +238,7 @@ def _preprocessh5_single(
# c_date = inv[0][0].creation_date
# t_date = inv[0][0].termination_date

Nevt = len(evtcat)
Nevtstrlen = len(str(Nevt))
for i, evt in (pbar := tqdm(enumerate(evtcat))):
# Add description
# pbar.set_description(f"Event loop {i:>{Nevtstrlen}d}/{Nevt}")
for i, evt in tqdm(enumerate(evtcat)):
# Already processed?
ot = (evt.preferred_origin() or evt.origins[0]).time
ot_fiss = UTCDateTime(ot).format_fissures()
Expand Down

0 comments on commit 7bb1fed

Please sign in to comment.