Skip to content

Commit

Permalink
Bump two dependencies, use tqdm.auto (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
teutoburg authored Oct 19, 2024
2 parents 3b0e01e + 0e90ae4 commit a478d60
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
14 changes: 7 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ beautifulsoup4 = "^4.12.1"
lxml = "^4.9.3"
pyyaml = "^6.0.1"
more-itertools = "^10.1.0"
tqdm = "^4.66.1"
tqdm = "^4.66.5"

synphot = "^1.4.0"
skycalc-ipy = ">=0.5.1"
anisocado = ">=0.3.0"
astar-utils = ">=0.3.0"
astar-utils = ">=0.3.1"

[tool.poetry.group.dev]
optional = true
Expand Down
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.auto import tqdm

from astropy.io import fits
from astropy.table import Table
Expand Down
15 changes: 10 additions & 5 deletions scopesim/optics/optical_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from astropy import units as u
from astropy.wcs import WCS

from tqdm import tqdm
from tqdm.auto import tqdm

from synphot import SourceSpectrum, Empirical1D
from synphot.units import PHOTLAM
Expand Down Expand Up @@ -234,16 +234,19 @@ def observe(self, orig_source, update=True, **kwargs):
else:

fovs = self.fov_manager.fovs
for fov in tqdm(fovs, desc=" FOVs", position=0):
nobar = len(fovs) <= 1
for fov in tqdm(fovs, desc=" FOVs", position=0, disable=nobar):
# 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
fov.extract_from(source)

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):
foveffs = self.optics_manager.fov_effects
nobar = len(foveffs) <= 1
for effect in tqdm(foveffs, disable=nobar,
desc=" FOV effects", position=1):#, leave=False):
fov = effect.apply_to(fov)

fov.flatten()
Expand All @@ -253,7 +256,9 @@ def observe(self, orig_source, update=True, **kwargs):
# END OF MULTIPROCESSING

# [2D - Vibration, flat fielding, chopping+nodding]
for effect in tqdm(self.optics_manager.image_plane_effects,
impeffs = self.optics_manager.image_plane_effects
nobar = len(impeffs) <= 1
for effect in tqdm(impeffs, disable=nobar,
desc=" Image Plane effects"):
for ii, image_plane in enumerate(self.image_planes):
self.image_planes[ii] = effect.apply_to(image_plane)
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 @@ -12,7 +12,7 @@
import httpx
import bs4

from tqdm import tqdm
from tqdm.auto import tqdm
# from tqdm.contrib.logging import logging_redirect_tqdm
# put with logging_redirect_tqdm(loggers=all_loggers): around tqdm
# Note: seems to work without that so far...
Expand Down

0 comments on commit a478d60

Please sign in to comment.