forked from LynkerIntel/climatePy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix on viz.animation_raster() function, misuse of isinstance()
- Loading branch information
1 parent
e483681
commit a3159bd
Showing
3 changed files
with
123 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# pytest library | ||
import pytest | ||
|
||
# import climatePy modules | ||
import climatePy | ||
|
||
# data manipulation libs | ||
import pandas as pd | ||
import geopandas as gpd | ||
import xarray as xr | ||
|
||
# standard python libs | ||
import re | ||
from datetime import datetime | ||
|
||
|
||
# old imports | ||
# from .climatePy import shortcuts | ||
# from src.climatePy import shortcuts | ||
# from src.climatePy import dap | ||
# from src.climatePy import climatepy_filter | ||
# from src.climatePy import utils | ||
|
||
# AOI = gpd.read_file('climatePy/data/boulder_county.gpkg') | ||
|
||
# climatePy.getGridMET(AOI, "pr", "2000-01-01", "2000-01-01", verbose=True) | ||
# AOI = gpd.read_file('climatePy/data/san_luis_obispo_county.gpkg') | ||
|
||
# @pytest.fixture(params=['miami_dade_county', 'san_luis_obispo_county', | ||
# 'litchfield_county', 'tuscaloosa_county', | ||
# 'boulder_county', 'king_county']) | ||
|
||
@pytest.fixture(params=['san_luis_obispo_county', 'boulder_county']) | ||
# @pytest.fixture(params=['san_luis_obispo_county']) | ||
|
||
def AOI(request): | ||
# filepath = f'src/data/{request.param}.gpkg' | ||
filepath = f'climatePy/data/{request.param}.gpkg' | ||
AOI = gpd.read_file(filepath) | ||
yield AOI | ||
|
||
# # Create a test for dap() function on a subset of the params data catalog, id == "gridmet" and variable == "pr" | ||
def test_dap_gridmet_case1(AOI): | ||
|
||
x = "553" | ||
assert x == "553" | ||
assert x != "423652" |