diff --git a/rdtools/clearsky_temperature.py b/rdtools/clearsky_temperature.py index 4272f05e..bb7d7f98 100644 --- a/rdtools/clearsky_temperature.py +++ b/rdtools/clearsky_temperature.py @@ -4,9 +4,10 @@ from numpy import arange from datetime import timedelta import pandas as pd -import pkg_resources +from contextlib import ExitStack import numpy as np import warnings +import importlib.resources as importlib_resources def get_clearsky_tamb(times, latitude, longitude, window_size=40, @@ -42,8 +43,9 @@ def get_clearsky_tamb(times, latitude, longitude, window_size=40, * https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MOD_LSTN_CLIM_M ''' - filepath = pkg_resources.resource_filename('rdtools', - 'data/temperature.hdf5') + file_manager = ExitStack() + ref = importlib_resources.files("rdtools") / "data/temperature.hdf5" + filepath = file_manager.enter_context(importlib_resources.as_file(ref)) buffer = timedelta(days=window_size)