Skip to content

Commit

Permalink
Not giving up
Browse files Browse the repository at this point in the history
  • Loading branch information
kvantricht committed Sep 30, 2024
1 parent 1dee04a commit 9657518
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Empty file added presto/resources/__init__.py
Empty file.
File renamed without changes.
6 changes: 3 additions & 3 deletions presto/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import torch
import xarray as xr

from presto import resources

from .dataops import (
BANDS,
ERA5_BANDS,
Expand All @@ -37,9 +39,7 @@
DEFAULT_SEED: int = 42


with importlib.resources.open_binary(
"presto.resources.croptype_mappings", "croptype_classes.json"
) as f:
with importlib.resources.open_binary(resources, "croptype_classes.json") as f:
CLASS_MAPPINGS = json.load(f)


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def load_dependencies(tag: str) -> List[str]:
python_requires=">=3.8",
include_package_data=True,
package_data={
"presto.resources.croptype_mappings": ["*.json"],
"": ["resources/**/*"],
},
zip_safe=True,
)
6 changes: 3 additions & 3 deletions tests/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import json
from unittest import TestCase

from presto import resources


class TestResources(TestCase):
def test_load_class_mappings(self):
with importlib.resources.open_binary(
"presto.resources.croptype_mappings", "croptype_classes.json"
) as f:
with importlib.resources.open_binary(resources, "croptype_classes.json") as f:
CLASS_MAPPINGS = json.load(f)

assert CLASS_MAPPINGS is not None

0 comments on commit 9657518

Please sign in to comment.