Skip to content

Commit

Permalink
Rich progress bars instead of tqdm
Browse files Browse the repository at this point in the history
Signed-off-by: Devansh Agarwal <[email protected]>
  • Loading branch information
devanshkv committed Oct 15, 2020
1 parent b6a4111 commit f7515f7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions your/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ def to_fil(self):
self.outname += ".fil"
with Progress() as progress:
if not self.progress:
task = progress.add_task("[green]Writing...", total=self.nsamp, visible=False)
task = progress.add_task(
"[green]Writing...", total=self.nsamp, visible=False
)
else:
task = progress.add_task("[green]Writing...", total=self.nsamp)
# create the header
Expand Down Expand Up @@ -269,7 +271,9 @@ def to_fits(self, npsub=-1):
st = self.nstart
with Progress() as progress:
if not self.progress:
task = progress.add_task("[green]Writing...", total=nsubints, visible=False)
task = progress.add_task(
"[green]Writing...", total=nsubints, visible=False
)
else:
task = progress.add_task("[green]Writing...", total=nsubints)

Expand All @@ -281,7 +285,9 @@ def to_fits(self, npsub=-1):
pass
isub = istop - istart

logger.info(f"Writing data to {outfile} from subint = {istart} to {istop}.")
logger.info(
f"Writing data to {outfile} from subint = {istart} to {istop}."
)

# Read in nread samples from filfile
nread = isub * npsub
Expand Down Expand Up @@ -385,7 +391,9 @@ def to_dada(self):
header = self.dada_header()
with Progress() as progress:
if not self.progress:
task = progress.add_task("[green]Reading...", total=self.nsamp, visible=False)
task = progress.add_task(
"[green]Reading...", total=self.nsamp, visible=False
)
else:
task = progress.add_task("[green]Reading...", total=self.nsamp)

Expand Down

0 comments on commit f7515f7

Please sign in to comment.