Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use tqdm.autonotebook #352

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scopesim/effects/spectral_trace_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from itertools import cycle

from tqdm import tqdm
from tqdm.autonotebook import tqdm

from astropy.io import fits
from astropy.table import Table
Expand Down
6 changes: 3 additions & 3 deletions scopesim/optics/optical_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from scipy.interpolate import interp1d
from astropy import units as u

from tqdm import tqdm
from tqdm.autonotebook import tqdm

from synphot.units import PHOTLAM

Expand Down Expand Up @@ -185,7 +185,7 @@ def observe(self, orig_source, update=True, **kwargs):

# [3D - Atmospheric shifts, PSF, NCPAs, Grating shift/distortion]
fovs = self.fov_manager.fovs
for fov in tqdm(fovs, desc=" FOVs", position=0):
for fov in tqdm(fovs, desc=" FOVs"):
# print("FOV", fov_i+1, "of", n_fovs, flush=True)
# .. todo: possible bug with bg flux not using plate_scale
# see fov_utils.combine_imagehdu_fields
Expand All @@ -194,7 +194,7 @@ def observe(self, orig_source, update=True, **kwargs):
hdu_type = "cube" if self.fov_manager.is_spectroscope else "image"
fov.view(hdu_type)
for effect in tqdm(self.optics_manager.fov_effects,
desc=" FOV effects", position=1, leave=False):
desc=" FOV effects"):
fov = effect.apply_to(fov)

fov.flatten()
Expand Down
2 changes: 1 addition & 1 deletion scopesim/server/download_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import httpx
import bs4

from tqdm import tqdm
from tqdm.autonotebook import tqdm
# from tqdm.contrib.logging import logging_redirect_tqdm
# put with logging_redirect_tqdm(loggers=all_loggers): around tqdm

Expand Down