Skip to content

Commit

Permalink
MNT: Update code to remove warnings for datetime and pandas. (#878)
Browse files Browse the repository at this point in the history
* MNT: Update code to remove warnings for datetime and pandas.

* FIX: Timezone not timedelta.
  • Loading branch information
zssherman authored Nov 12, 2024
1 parent e5c7194 commit fa908c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions act/io/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"""

import copy
import datetime as dt
import glob
import json
import re
import tarfile
import tempfile
import urllib
import warnings
from datetime import datetime, timezone
from os import PathLike
from pathlib import Path, PosixPath

Expand Down Expand Up @@ -766,7 +766,7 @@ def write_netcdf(
except KeyError:
pass

current_time = dt.datetime.utcnow().replace(microsecond=0)
current_time = datetime.now(timezone.utc).replace(microsecond=0)
history_value = (
f'Written to file by ACT-{act.__version__} '
f'with write_netcdf() at {current_time} UTC'
Expand Down
2 changes: 1 addition & 1 deletion tests/plotting/test_timeseriesdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ def test_xlim_correction_plot():
@pytest.mark.mpl_image_compare(tolerance=10)
def test_plot_stripes():
ds = act.io.read_arm_netcdf(sample_files.EXAMPLE_MET_WILDCARD)
ds = ds.resample(time='1H').mean()
ds = ds.resample(time='1h').mean()
print(ds)
reference_period = ['2019-01-01', '2019-10-02']

Expand Down

0 comments on commit fa908c8

Please sign in to comment.