Skip to content

Commit

Permalink
ups
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-steinke committed Jun 18, 2024
1 parent 7c4f32e commit 408a846
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vessim/sil.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,22 +225,22 @@ def __init__(self, username: str, password: str):

def now(
self,
dt: Optional[DatetimeLike] = None,
at: Optional[DatetimeLike] = None,
region: Optional[str] = None,
signal_type: str = "co2_moer",
**kwargs,
):
if region is None:
raise ValueError("Region needs to be specified.")
if dt is None:
if at is None:
raise ValueError("dt needs to be specified.")
dt = pd.to_datetime(dt)
at = pd.to_datetime(at)
rsp = self._request(
"/historical",
params={
"region": region,
"start": (dt - timedelta(minutes=5)).isoformat(),
"end": dt.isoformat(),
"start": (at - timedelta(minutes=5)).isoformat(),
"end": at.isoformat(),
"signal_type": signal_type,
},
)
Expand Down

0 comments on commit 408a846

Please sign in to comment.