Skip to content

Commit 07b270b

Browse files
authored
Remove dependence on pkg_resources (#448)
We used it to get the registry file from the package data. But the file only had 4 entries so it made no sense to do all of this instead of having the registry as a dict directly in the code. So remove the registry file from the package and then we don't need pkg_resources.
1 parent 82ef50e commit 07b270b

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

setup.cfg

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ fast =
5454
pykdtree>=1.3
5555

5656
[options.package_data]
57-
verde.tests = data/*, baseline/*
58-
verde.datasets = registry.txt
57+
verde.tests = baseline/*
5958

6059
[flake8]
6160
max-line-length = 88

verde/datasets/registry.txt

-4
This file was deleted.

verde/datasets/sample_data.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import numpy as np
1313
import pandas as pd
14-
import pkg_resources
1514
import pooch
1615

1716
try:
@@ -28,9 +27,13 @@
2827
version=__version__,
2928
version_dev="main",
3029
env="VERDE_DATA_DIR",
30+
registry={
31+
"baja-bathymetry.csv.xz": "64bc38514e771caa468b8230d94bf3a2abdac9e8b784273a0ca9ed6cb5165c32",
32+
"california-gps.csv.xz": "54fa4aa490883c41362fae5cbf4925f2b1036361f4169ce5d2035828e22ff89a",
33+
"rio-magnetic.csv.xz": "0e826932045e177b3d558b93be35a33548aa24529d1293cccfd4b8e7e706a03b",
34+
"texas-wind.csv": "89213be635006e3838f906918427ec838142d44f5de3f5b2c5d82f9e11d93a24",
35+
},
3136
)
32-
with pkg_resources.resource_stream("verde.datasets", "registry.txt") as registry_file:
33-
REGISTRY.load_registry(registry_file)
3437

3538

3639
def _datasets_deprecation_warning():

0 commit comments

Comments
 (0)