Skip to content

Commit

Permalink
Merge pull request #25 from EPFL-ENAC/refactor-utils-goespatial
Browse files Browse the repository at this point in the history
Refactor utils/goespatial
  • Loading branch information
sphamba authored Dec 20, 2023
2 parents 22d152e + 4b00f02 commit 91d9048
Show file tree
Hide file tree
Showing 8 changed files with 526 additions and 186 deletions.
45 changes: 45 additions & 0 deletions gpm_api/etc/continent_extent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Africa:
- -18.02
- 51.292
- -40.833
- 37.092
Antarctica:
- -180
- 180
- -90
- -60
Arctic:
- -180
- 180
- 60
- 90
Asia:
- 35
- 180
- 5
- 80
Australia:
- 105
- 180
- -55
- 12
Oceania:
- 105
- 180
- -55
- 12
Europe:
- -30
- 40
- 34
- 72
North America:
- -180
- -52
- 5
- 83
South America:
- -85
- -30
- -60
- 15
14 changes: 14 additions & 0 deletions gpm_api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import datetime
from typing import Any, List, Dict, Tuple, Iterable
from gpm_api.io.products import get_info_dict, available_products
from gpm_api.utils import geospatial
import posixpath as pxp
import ntpath as ntp
import gpm_api.configs
Expand Down Expand Up @@ -407,3 +408,16 @@ def set_is_grid_to_true(
mocker.patch("gpm_api.checks.is_orbit", return_value=False)
mocker.patch("gpm_api.utils.checks.is_grid", return_value=True)
mocker.patch("gpm_api.utils.checks.is_orbit", return_value=False)


ExtentDictionary = Dict[str, Tuple[float, float, float, float]]


@pytest.fixture
def country_extent_dictionary() -> ExtentDictionary:
return geospatial._get_country_extent_dictionary()


@pytest.fixture
def continent_extent_dictionary() -> ExtentDictionary:
return geospatial._get_continent_extent_dictionary()
Loading

0 comments on commit 91d9048

Please sign in to comment.