1919from typing import TYPE_CHECKING , TypeAlias
2020
2121from pandas import Series
22- from pytz import UTC
22+ from zoneinfo import ZoneInfo
2323
2424from rateslib .dual import (
2525 Dual ,
@@ -353,7 +353,7 @@ def expiries(self) -> list[datetime]:
353353 @cached_property
354354 def expiries_posix (self ) -> list [float ]:
355355 """A list of the unix timestamps of each date in ``expiries``."""
356- return [_ .replace (tzinfo = UTC ).timestamp () for _ in self .expiries ]
356+ return [_ .replace (tzinfo = ZoneInfo ( " UTC" ) ).timestamp () for _ in self .expiries ]
357357
358358 @property
359359 def weights (self ) -> Series [float ] | None :
@@ -377,7 +377,7 @@ def eval_date(self) -> datetime:
377377 @property
378378 def eval_posix (self ) -> float :
379379 """The unix timestamp of the ``eval_date``."""
380- return self .eval_date .replace (tzinfo = UTC ).timestamp ()
380+ return self .eval_date .replace (tzinfo = ZoneInfo ( " UTC" ) ).timestamp ()
381381
382382 @property
383383 def delta_type (self ) -> FXDeltaMethod :
@@ -471,12 +471,12 @@ def expiries(self) -> list[datetime]:
471471 @cached_property
472472 def expiries_posix (self ) -> list [float ]:
473473 """A list of the unix timestamps of each date in ``expiries``."""
474- return [_ .replace (tzinfo = UTC ).timestamp () for _ in self .expiries ]
474+ return [_ .replace (tzinfo = ZoneInfo ( " UTC" ) ).timestamp () for _ in self .expiries ]
475475
476476 @cached_property
477477 def eval_posix (self ) -> float :
478478 """The unix timestamp of the ``eval_date``."""
479- return self .eval_date .replace (tzinfo = UTC ).timestamp ()
479+ return self .eval_date .replace (tzinfo = ZoneInfo ( " UTC" ) ).timestamp ()
480480
481481 @property
482482 def delivery_lag (self ) -> int :
@@ -621,7 +621,7 @@ def _t_var_interp_d_sabr_d_k_or_f(
621621 else : # bounds_flag == 1:
622622 # right side extrapolation
623623 t1 = expiries_posix [expiry_next_index ] - eval_posix
624- t2 = TERMINAL_DATE .replace (tzinfo = UTC ).timestamp () - eval_posix
624+ t2 = TERMINAL_DATE .replace (tzinfo = ZoneInfo ( " UTC" ) ).timestamp () - eval_posix
625625
626626 t_hat = expiry_posix - eval_posix
627627 t = expiry_posix - eval_posix
0 commit comments