Skip to content

Commit

Permalink
Remove dependence on pkg_resources (#448)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
leouieda authored Apr 17, 2024
1 parent 82ef50e commit 07b270b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ fast =
pykdtree>=1.3

[options.package_data]
verde.tests = data/*, baseline/*
verde.datasets = registry.txt
verde.tests = baseline/*

[flake8]
max-line-length = 88
Expand Down
4 changes: 0 additions & 4 deletions verde/datasets/registry.txt

This file was deleted.

9 changes: 6 additions & 3 deletions verde/datasets/sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import numpy as np
import pandas as pd
import pkg_resources
import pooch

try:
Expand All @@ -28,9 +27,13 @@
version=__version__,
version_dev="main",
env="VERDE_DATA_DIR",
registry={
"baja-bathymetry.csv.xz": "64bc38514e771caa468b8230d94bf3a2abdac9e8b784273a0ca9ed6cb5165c32",
"california-gps.csv.xz": "54fa4aa490883c41362fae5cbf4925f2b1036361f4169ce5d2035828e22ff89a",
"rio-magnetic.csv.xz": "0e826932045e177b3d558b93be35a33548aa24529d1293cccfd4b8e7e706a03b",
"texas-wind.csv": "89213be635006e3838f906918427ec838142d44f5de3f5b2c5d82f9e11d93a24",
},
)
with pkg_resources.resource_stream("verde.datasets", "registry.txt") as registry_file:
REGISTRY.load_registry(registry_file)


def _datasets_deprecation_warning():
Expand Down

0 comments on commit 07b270b

Please sign in to comment.