Skip to content

Commit

Permalink
Replace deprecated logger.warn with logger.warning
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Dec 5, 2024
1 parent e2fb220 commit 61eb190
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions kadi/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def from_dict(cls, model_dict, logger=None):
tstart = DateTime(model_dict[cls._get_obsid_start_attr]).secs
obsrq = fetch.Msid("cobsrqid", tstart, tstart + 200)
if len(obsrq.vals) == 0:
logger.warn(
logger.warning(
"WARNING: unable to get COBSRQID near "
f"{model_dict[cls._get_obsid_start_attr]}, "
"using obsid=-999"
Expand Down Expand Up @@ -689,7 +689,7 @@ def get_msids_states(cls, start, stop):
)
except (IndexError, ValueError):
if event_time_fuzz is None:
logger.warn(
logger.warning(
"Warning: No telemetry available for {}".format(cls.__name__)
)
return [], event_msidset
Expand All @@ -705,7 +705,7 @@ def get_msids_states(cls, start, stop):
while tstop - event_time_fuzz < states[-1]["tstop"]:
# Event tstop is within event_time_fuzz of the stop of states so
# bail out and don't return any states.
logger.warn(
logger.warning(
"Warning: dropping state because of "
"insufficent event time pad:\n{}\n".format(states[-1:])
)
Expand Down Expand Up @@ -2390,7 +2390,7 @@ def get_extras(cls, event, event_msidset):
out["cc"] = pass_plan.cc
out["pass_plan"] = pass_plan
if len(pass_plans) > 1:
logger.warn(
logger.warning(
"Multiple pass plans found at {}: {}".format(event["start"], pass_plans)
)

Expand Down
2 changes: 1 addition & 1 deletion kadi/events/orbit_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def get_orbit_points(tlrfiles):
try:
fh = open(tlrfile, "r", encoding="ascii", errors="ignore")
except IOError as err:
logger.warn(err)
logger.warning(err)
continue
for line in fh:
if len(line) < 30 or line[:2] != " 2":
Expand Down
6 changes: 3 additions & 3 deletions kadi/scripts/update_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ def update_event_model(EventModel, date_stop: str) -> None:
except django.db.utils.IntegrityError:
import traceback

logger.warn(f"WARNING: IntegrityError skipping {event_model}")
logger.warn(f"Event dict:\n{event}")
logger.warn(f"Traceback:\n{traceback.format_exc()}")
logger.warning(f"WARNING: IntegrityError skipping {event_model}")
logger.warning(f"Event dict:\n{event}")
logger.warning(f"Traceback:\n{traceback.format_exc()}")
continue

# If processing got here with no exceptions then save the event update
Expand Down

0 comments on commit 61eb190

Please sign in to comment.