Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 26, 2023
1 parent 1ce16f6 commit a98a1ef
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions src/compare_covermaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"BureJimma2019": "ETH",
"BureJimma2020": "ETH",
"Tigray2021": "ETH",
"Tigray2020": "ETH"
"Tigray2020": "ETH",
}
DATASET_PATH = Path(DATA_PATH).glob("*")
NE_GDF = gpd.read_file(
Expand All @@ -67,7 +67,7 @@
"BureJimma2019": DATA_PATH + "Ethiopia_Bure_Jimma_2019.csv",
"BureJimma2020": DATA_PATH + "Ethiopia_Bure_Jimma_2020.csv",
"Tigray2021": DATA_PATH + "Ethiopia_Tigray_2021.csv",
"Tigray2020": DATA_PATH + "Ethiopia_Tigray_2020.csv"
"Tigray2020": DATA_PATH + "Ethiopia_Tigray_2020.csv",
}

REDUCER = ee.Reducer.mode()
Expand Down Expand Up @@ -453,13 +453,13 @@ def generate_report(dataset_name: str, country: str, true, pred) -> pd.DataFrame
"worldcover-v100",
ee.ImageCollection("ESA/WorldCover/v100"),
resolution=10,
crop_labels=[40]
crop_labels=[40],
),
"worldcover-v200": Covermap(
"worldcover-v200",
ee.ImageCollection("ESA/WorldCover/v200"),
resolution=10,
crop_labels=[40]
crop_labels=[40],
),
"glad": Covermap(
"glad",
Expand All @@ -478,7 +478,7 @@ def generate_report(dataset_name: str, country: str, true, pred) -> pd.DataFrame
ee.ImageCollection(ee.Image("users/sbaber/asap_mask_crop_v03")),
resolution=1000,
crop_labels=list(range(10, 190)),
countries=[country for country in TEST_COUNTRIES.keys() if country != "Hawaii"]
countries=[country for country in TEST_COUNTRIES.keys() if country != "Hawaii"],
),
"dynamicworld": Covermap(
"dynamicworld",
Expand Down Expand Up @@ -508,7 +508,7 @@ def generate_report(dataset_name: str, country: str, true, pred) -> pd.DataFrame
ee.ImageCollection("projects/sat-io/open-datasets/DEAF/CROPLAND-EXTENT/filtered"),
resolution=10,
crop_labels=[1],
countries=[country for country in TEST_COUNTRIES.keys() if country != "Hawaii"]
countries=[country for country in TEST_COUNTRIES.keys() if country != "Hawaii"],
),
"esa-cci-africa": Covermap(
"esa-cci-africa",
Expand All @@ -517,7 +517,7 @@ def generate_report(dataset_name: str, country: str, true, pred) -> pd.DataFrame
),
resolution=20,
crop_labels=[4],
countries=[country for country in TEST_COUNTRIES.keys() if country != "Hawaii"]
countries=[country for country in TEST_COUNTRIES.keys() if country != "Hawaii"],
),
"globcover-v23": Covermap(
"globcover-v23",
Expand Down Expand Up @@ -550,7 +550,7 @@ def generate_report(dataset_name: str, country: str, true, pred) -> pd.DataFrame
),
resolution=30,
crop_labels=[2],
countries=[country for country in TEST_COUNTRIES.keys() if country != "Hawaii"]
countries=[country for country in TEST_COUNTRIES.keys() if country != "Hawaii"],
),
"harvest-crop-maps": Covermap(
"harvest-crop-maps",
Expand All @@ -566,7 +566,9 @@ def generate_report(dataset_name: str, country: str, true, pred) -> pd.DataFrame
ee.Image("users/abaansah/Namibia_North_2020_V3"),
ee.Image("users/adadebay/Zambia_cropland_2019"),
ee.Image("users/izvonkov/Hawaii_skip_era5_v4"),
ee.Image("users/adadebay/Uganda_2019_skip_ERA5_min_lat--1-63_min_lon-29-3_max_lat-4-3_max_lon-35-17_dates-2019-02-01_2020-02-"),
ee.Image(
"users/adadebay/Uganda_2019_skip_ERA5_min_lat--1-63_min_lon-29-3_max_lat-4-3_max_lon-35-17_dates-2019-02-01_2020-02-"
),
ee.Image("users/abaansah/Sudan_Al_Gadaref_2020_Feb"),
ee.Image("users/abaansah/Sudan_Al_Gadaref_2019_Feb"),
ee.Image("users/izvonkov/Sudan_Blue_Nile_2020"),
Expand All @@ -575,13 +577,24 @@ def generate_report(dataset_name: str, country: str, true, pred) -> pd.DataFrame
ee.Image("users/byeh1/ethiopia_tigray_2021_v1"),
ee.Image("users/adadebay/Tanzania_cropland_2019"),
ee.Image("users/eutzschn/Ethiopia_Bure_Jimma_2020_v1"),
ee.Image("users/izvonkov/Ethiopia_Bure_Jimma_2019_v1")
ee.Image("users/izvonkov/Ethiopia_Bure_Jimma_2019_v1"),
]
),
resolution=10,
probability=0.5,
countries=['Tanzania', 'Namibia', 'Uganda', 'Zambia', 'Hawaii',
'BlueNile2020', 'BlueNile2019', 'AlGadaref2019', 'BureJimma2019',
'BureJimma2020', 'Tigray2021', 'Tigray2020']
)
countries=[
"Tanzania",
"Namibia",
"Uganda",
"Zambia",
"Hawaii",
"BlueNile2020",
"BlueNile2019",
"AlGadaref2019",
"BureJimma2019",
"BureJimma2020",
"Tigray2021",
"Tigray2020",
],
),
}

0 comments on commit a98a1ef

Please sign in to comment.