xcube-cci 0.12.dev0__tar.gz → 0.12.1.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/CHANGES.md +8 -2
- xcube_cci-0.12.1.dev0/MANIFEST.in +7 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/PKG-INFO +1 -1
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/pyproject.toml +1 -1
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/setup.py +6 -2
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/open_all.py +6 -7
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_cciodp.py +4 -5
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_chunkstore.py +5 -5
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_dataaccess.py +73 -26
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_dataframeaccess.py +9 -2
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_dtaccess.py +4 -3
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_kcaccess.py +7 -9
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_normalize.py +2 -2
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_timeutil.py +1 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_zarraccess.py +1 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/__init__.py +1 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/cciodp.py +152 -131
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/chunkstore.py +14 -15
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/constants.py +6 -1
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/data/dataset_states.json +222 -2
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/data/datatree_states.json +27 -29
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/data/geodataframe_states.json +8 -2
- xcube_cci-0.12.1.dev0/xcube_cci/data/kc_refs.json +269364 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/dataaccess.py +130 -109
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/dataframeaccess.py +15 -10
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/dtaccess.py +16 -12
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/kcaccess.py +2 -2
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/normalize.py +2 -4
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/odpconnector.py +4 -3
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/plugin.py +9 -14
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/sessionexecutor.py +5 -5
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/timerangegetter.py +22 -8
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/timeutil.py +1 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/vdcaccess.py +6 -13
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/version.py +1 -1
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/zarraccess.py +3 -10
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci.egg-info/PKG-INFO +1 -1
- xcube_cci-0.12.dev0/MANIFEST.in +0 -4
- xcube_cci-0.12.dev0/xcube_cci/data/kc_refs.json +0 -119377
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/.github/workflows/publish_pypi.yml +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/.gitignore +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/LICENSE +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/README.md +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/appveyor.yml +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/environment.yml +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/examples/notebooks/Ex0-DCFS-Setup.ipynb +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/examples/notebooks/Ex1a-DCFS-CCI_access.ipynb +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/examples/notebooks/Ex1b-DCFS-CCI_access.ipynb +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/setup.cfg +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/__init__.py +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/resources/ESACCI-OZONE-L3-NP-MERGED-KNMI-199701-fv0002.nc.das +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/resources/test_req.json +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/test/test_plugin.py +1 -1
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/data/__init__.py +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/data/excluded_data_sources +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/data/stores.yml +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/data/vectordatacube_states.json +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci/data/zarr_to_dsrids +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci.egg-info/SOURCES.txt +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci.egg-info/dependency_links.txt +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci.egg-info/entry_points.txt +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci.egg-info/requires.txt +0 -0
- {xcube_cci-0.12.dev0 → xcube_cci-0.12.1.dev0}/xcube_cci.egg-info/top_level.txt +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
## Changes in 0.12.
|
|
1
|
+
## Changes in 0.12.1 (in development)
|
|
2
|
+
|
|
3
|
+
## Changes in 0.12
|
|
4
|
+
* Updated list of kerchunk datasets
|
|
2
5
|
* Added xarray Data Trees as fourth data model. Data Trees provide a tree-like
|
|
3
6
|
hierarchical structure of datasets, where single nodes can be accessed by an
|
|
4
7
|
identifier. This is a preferable approach to splitting datasets into sub-datasets,
|
|
@@ -15,7 +18,10 @@
|
|
|
15
18
|
"esacci.RD.satellite-orbit-frequency.L3S.WL.multi-sensor.multi-platform.MERGED.v1-1.r1~AMAZON_NEGRO_SAO-FELIPE".
|
|
16
19
|
To open the dataset with a subset of places, pass `place_names` as parameter
|
|
17
20
|
to the store method `open_params()`. You can get a list of available place names
|
|
18
|
-
from `get_open_data_params_schema()`.
|
|
21
|
+
from `get_open_data_params_schema()`.
|
|
22
|
+
* We fixed an issue with geodataframes which could cause that not all data were read in.
|
|
23
|
+
* Fixed issues that data could not be accessed from ICESHEETS datasets with multiple time steps in base files.
|
|
24
|
+
Solves [#69](https://github.com/dcs4cop/xcube-cci/issues/69)
|
|
19
25
|
|
|
20
26
|
## Changes in 0.11.10
|
|
21
27
|
* Revised warnings
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
include xcube_cci/data/excluded_data_sources
|
|
2
|
+
include xcube_cci/data/dataset_states.json
|
|
3
|
+
include xcube_cci/data/datatree_states.json
|
|
4
|
+
include xcube_cci/data/geodataframe_states.json
|
|
5
|
+
include xcube_cci/data/vectordatacube_states.json
|
|
6
|
+
include xcube_cci/data/stores.yml
|
|
7
|
+
include xcube_cci/data/kc_refs.json
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
# SOFTWARE.
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
from setuptools import
|
|
25
|
+
from setuptools import find_packages, setup
|
|
26
26
|
|
|
27
27
|
requirements = [
|
|
28
28
|
# Sync with ./environment.yml.
|
|
@@ -47,7 +47,11 @@ setup(
|
|
|
47
47
|
'xcube_cci/data/excluded_data_sources',
|
|
48
48
|
'xcube_cci/data/stores.yml',
|
|
49
49
|
'xcube_cci/data/kc_refs.json',
|
|
50
|
-
'xcube_cci/data/dataset_states.json'
|
|
50
|
+
'xcube_cci/data/dataset_states.json',
|
|
51
|
+
'xcube_cci/data/datatree_states.json',
|
|
52
|
+
'xcube_cci/data/geodataframe_states.json',
|
|
53
|
+
'xcube_cci/data/vectordatacube_states.json',
|
|
54
|
+
]
|
|
51
55
|
)],
|
|
52
56
|
install_requires=requirements,
|
|
53
57
|
)
|
|
@@ -32,7 +32,6 @@ import click
|
|
|
32
32
|
import xarray as xr
|
|
33
33
|
import zarr.storage
|
|
34
34
|
|
|
35
|
-
from xcube.core.normalize import cubify_dataset
|
|
36
35
|
from xcube_cci.cciodp import CciOdp
|
|
37
36
|
from xcube_cci.chunkstore import CciChunkStore
|
|
38
37
|
|
|
@@ -46,14 +45,14 @@ DEFAULT_OUTPUT = 'open-report'
|
|
|
46
45
|
help=f'Output directory. Defaults to "{DEFAULT_OUTPUT}".')
|
|
47
46
|
@click.option('--force',
|
|
48
47
|
is_flag=True,
|
|
49
|
-
help=
|
|
48
|
+
help='Force deletion of an existing OUTPUT_DIR.')
|
|
50
49
|
@click.option('--cache', 'cache_size',
|
|
51
50
|
metavar='CACHE_SIZE',
|
|
52
|
-
help=
|
|
51
|
+
help='Cache size, e.g. "100M" or "2G". If given, an in-memory LRU cache will be used.')
|
|
53
52
|
@click.option('--observe',
|
|
54
53
|
is_flag=True,
|
|
55
|
-
help=
|
|
56
|
-
|
|
54
|
+
help='Dump data requests. '
|
|
55
|
+
'Note, turning this flag on will slightly increase measured durations.')
|
|
57
56
|
@click.argument('dataset_id', nargs=-1, required=False)
|
|
58
57
|
def gen_report(output_dir: str,
|
|
59
58
|
force: bool,
|
|
@@ -136,7 +135,7 @@ def gen_report(output_dir: str,
|
|
|
136
135
|
|
|
137
136
|
report_type_specifiers(output_dir, ts_dict=id_to_ts)
|
|
138
137
|
|
|
139
|
-
logging.info(
|
|
138
|
+
logging.info('Tests completed.')
|
|
140
139
|
|
|
141
140
|
|
|
142
141
|
def get_selected_dataset_ids(odp, ds_id_parts):
|
|
@@ -193,7 +192,7 @@ def report_error(output_dir: str, ds_id: str, t0: float, stage: str, e: Exceptio
|
|
|
193
192
|
|
|
194
193
|
|
|
195
194
|
def report_type_specifiers(output_dir: str, ts_dict: dict):
|
|
196
|
-
json_path = os.path.join(output_dir,
|
|
195
|
+
json_path = os.path.join(output_dir, 'type_specifiers.json')
|
|
197
196
|
with open(json_path, 'w') as fp:
|
|
198
197
|
json.dump(ts_dict, fp, indent=2)
|
|
199
198
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import numpy as np
|
|
2
1
|
import os
|
|
3
|
-
import pandas as pd
|
|
4
2
|
import unittest
|
|
5
3
|
from unittest import skip, skipIf
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import numpy as np
|
|
6
|
+
import pandas as pd
|
|
7
|
+
|
|
8
|
+
from xcube_cci.cciodp import CciOdp, find_datetime_format, get_res
|
|
10
9
|
from xcube_cci.constants import OPENSEARCH_CEDA_URL
|
|
11
10
|
|
|
12
11
|
AEROSOL_ID = 'esacci.AEROSOL.day.L3C.AER_PRODUCTS.AATSR.Envisat.ORAC.04-01-.r1'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import numpy
|
|
2
1
|
import os
|
|
3
|
-
import pandas as pd
|
|
4
2
|
import unittest
|
|
5
|
-
import xarray as xr
|
|
6
|
-
|
|
7
3
|
from unittest import skipIf
|
|
8
4
|
|
|
5
|
+
import numpy
|
|
6
|
+
import pandas as pd
|
|
7
|
+
import xarray as xr
|
|
8
|
+
|
|
9
9
|
from xcube_cci.cciodp import CciOdp
|
|
10
10
|
from xcube_cci.chunkstore import CciChunkStore
|
|
11
11
|
|
|
@@ -133,7 +133,7 @@ class CciChunkStoreTest(unittest.TestCase):
|
|
|
133
133
|
'O3_vmr', (5, 0, 0, 0)
|
|
134
134
|
)
|
|
135
135
|
self.assertIsNotNone(dim_indexes)
|
|
136
|
-
self.assertEqual(slice(
|
|
136
|
+
self.assertEqual(slice(0, 1), dim_indexes[0])
|
|
137
137
|
self.assertEqual(slice(0, 17), dim_indexes[1])
|
|
138
138
|
self.assertEqual(slice(0, 180), dim_indexes[2])
|
|
139
139
|
self.assertEqual(slice(0, 360), dim_indexes[3])
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
2
|
import os
|
|
3
3
|
import unittest
|
|
4
|
-
from unittest import skip
|
|
5
|
-
from unittest import skipIf
|
|
4
|
+
from unittest import skip, skipIf
|
|
6
5
|
|
|
7
6
|
from xcube.core.gridmapping import GridMapping
|
|
8
7
|
from xcube.core.normalize import normalize_dataset
|
|
9
|
-
from xcube.core.store import DATASET_TYPE
|
|
10
|
-
from xcube.core.store import
|
|
11
|
-
|
|
12
|
-
from xcube.core.store.descriptor import DatasetDescriptor
|
|
13
|
-
from xcube.core.store.descriptor import GeoDataFrameDescriptor
|
|
8
|
+
from xcube.core.store import DATASET_TYPE, GEO_DATA_FRAME_TYPE, DataStoreError, new_data_store
|
|
9
|
+
from xcube.core.store.descriptor import (DatasetDescriptor,
|
|
10
|
+
GeoDataFrameDescriptor)
|
|
14
11
|
from xcube.core.verify import assert_cube
|
|
15
12
|
|
|
16
|
-
from xcube_cci.dataaccess import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
from xcube_cci.
|
|
23
|
-
from xcube_cci.dataaccess import VECTOR_DATA_CUBE_TYPE
|
|
24
|
-
from xcube_cci.dtaccess import DataTreeDescriptor
|
|
25
|
-
from xcube_cci.dtaccess import DATATREE_TYPE
|
|
13
|
+
from xcube_cci.dataaccess import (VECTOR_DATA_CUBE_TYPE, CciOdpDataFrameOpener,
|
|
14
|
+
CciOdpDatasetOpener, CciOdpDataStore,
|
|
15
|
+
CciOdpDataTreeOpener,
|
|
16
|
+
CciOdpVectorDataCubeOpener,
|
|
17
|
+
VectorDataCubeDescriptor,
|
|
18
|
+
get_temporal_resolution_from_id)
|
|
19
|
+
from xcube_cci.dtaccess import DATATREE_TYPE, DataTreeDescriptor
|
|
26
20
|
|
|
27
21
|
AEROSOL_DAY_ID = 'esacci.AEROSOL.day.L3.AAI.multi-sensor.multi-platform.' \
|
|
28
22
|
'MSAAI.1-7.r1'
|
|
@@ -34,7 +28,8 @@ BIOMASS_ID = "esacci.BIOMASS.yr.L4.AGB.multi-sensor.multi-platform.MERGED.5-0.10
|
|
|
34
28
|
CLOUD_ID = "esacci.CLOUD.mon.L3C.CLD_PRODUCTS.MODIS.Terra.MODIS_TERRA.2-0.r1"
|
|
35
29
|
ICESHEETS_ID = 'esacci.ICESHEETS.yr.Unspecified.IV.PALSAR.ALOS.UNSPECIFIED.' \
|
|
36
30
|
'1-1.greenland_margin_2006_2011'
|
|
37
|
-
|
|
31
|
+
FIRE_ID = "esacci.FIRE.mon.L3S.BA.MODIS.Terra.MODIS_TERRA.v5-1.pixel"
|
|
32
|
+
HR_LC_ID = "esacci.LC.yr.L4.Map.multi-sensor.multi-platform.HRLC10-A02.v1-2.Amazonia"
|
|
38
33
|
LAKES_ID = 'esacci.LAKES.day.L3S.LK_PRODUCTS.multi-sensor.multi-platform.' \
|
|
39
34
|
'MERGED.v1-1.r1'
|
|
40
35
|
OZONE_MON_ID = 'esacci.OZONE.mon.L3.NP.multi-sensor.multi-platform.MERGED.' \
|
|
@@ -88,6 +83,39 @@ class DataAccessTest(unittest.TestCase):
|
|
|
88
83
|
))
|
|
89
84
|
|
|
90
85
|
|
|
86
|
+
class NewDataStoreTest(unittest.TestCase):
|
|
87
|
+
|
|
88
|
+
def test_new_data_store_esa_cci(self):
|
|
89
|
+
self.assertIsNotNone(new_data_store("esa-cci"))
|
|
90
|
+
|
|
91
|
+
def test_new_data_store_esa_cdc(self):
|
|
92
|
+
self.assertIsNotNone(new_data_store("esa-cdc"))
|
|
93
|
+
|
|
94
|
+
def test_new_data_store_esa_climate_data_centre(self):
|
|
95
|
+
self.assertIsNotNone(new_data_store("esa-climate-data-centre"))
|
|
96
|
+
|
|
97
|
+
def test_new_data_store_esa_cci_kc(self):
|
|
98
|
+
self.assertIsNotNone(new_data_store("esa-cci-kc"))
|
|
99
|
+
|
|
100
|
+
def test_new_data_store_esa_cdc_kc(self):
|
|
101
|
+
self.assertIsNotNone(new_data_store("esa-cdc-kc"))
|
|
102
|
+
|
|
103
|
+
def test_new_data_store_esa_cci_zarr(self):
|
|
104
|
+
self.assertIsNotNone(new_data_store("esa-cci-zarr"))
|
|
105
|
+
|
|
106
|
+
def test_new_data_store_esa_ccikc(self):
|
|
107
|
+
self.assertIsNotNone(new_data_store("ccikc"))
|
|
108
|
+
|
|
109
|
+
def test_new_data_store_cciodp(self):
|
|
110
|
+
self.assertIsNotNone(new_data_store("cciodp"))
|
|
111
|
+
|
|
112
|
+
def test_new_data_store_ccikc(self):
|
|
113
|
+
self.assertIsNotNone(new_data_store("ccikc"))
|
|
114
|
+
|
|
115
|
+
def test_new_data_store_ccizarr(self):
|
|
116
|
+
self.assertIsNotNone(new_data_store("ccizarr"))
|
|
117
|
+
|
|
118
|
+
|
|
91
119
|
class CciOdpDatasetOpenerTest(unittest.TestCase):
|
|
92
120
|
|
|
93
121
|
def setUp(self) -> None:
|
|
@@ -675,9 +703,10 @@ class CciOdpDatasetOpenerNormalizeTest(unittest.TestCase):
|
|
|
675
703
|
|
|
676
704
|
|
|
677
705
|
def user_agent(ext: str = "") -> str:
|
|
678
|
-
from xcube_cci.version import version
|
|
679
706
|
from platform import machine, python_version, system
|
|
680
707
|
|
|
708
|
+
from xcube_cci.version import version
|
|
709
|
+
|
|
681
710
|
return "xcube-cci-testing/{version} (Python {python};" \
|
|
682
711
|
" {system} {arch}) {ext}".format(
|
|
683
712
|
version=version,
|
|
@@ -770,7 +799,7 @@ class CciOdpDataFrameOpenerTest(unittest.TestCase):
|
|
|
770
799
|
'platform', 'orbit_track_number', 'mission_cycle_number'},
|
|
771
800
|
set(gdf.columns)
|
|
772
801
|
)
|
|
773
|
-
self.assertEqual((1747, 7), gdf.shape)
|
|
802
|
+
self.assertEqual((1747, 7), gdf[0:2000].shape)
|
|
774
803
|
|
|
775
804
|
|
|
776
805
|
class CciOdpVectorDataCubeOpenerTest(unittest.TestCase):
|
|
@@ -855,15 +884,15 @@ class CciOdpDataTreeOpenerTest(unittest.TestCase):
|
|
|
855
884
|
@skipIf(os.environ.get('XCUBE_CCI_DISABLE_WEB_TESTS', '1') == '1',
|
|
856
885
|
'XCUBE_CCI_DISABLE_WEB_TESTS = 1')
|
|
857
886
|
def test_has_data(self):
|
|
858
|
-
self.assertTrue(self._opener.has_data(
|
|
887
|
+
self.assertTrue(self._opener.has_data(FIRE_ID))
|
|
859
888
|
|
|
860
889
|
@skipIf(os.environ.get('XCUBE_CCI_DISABLE_WEB_TESTS', '1') == '1',
|
|
861
890
|
'XCUBE_CCI_DISABLE_WEB_TESTS = 1')
|
|
862
891
|
def test_describe_data_fire(self):
|
|
863
|
-
descriptor = self._opener.describe_data([
|
|
892
|
+
descriptor = self._opener.describe_data([FIRE_ID])[0]
|
|
864
893
|
self.assertIsNotNone(descriptor)
|
|
865
894
|
self.assertIsInstance(descriptor, DataTreeDescriptor)
|
|
866
|
-
self.assertEqual(
|
|
895
|
+
self.assertEqual(FIRE_ID, descriptor.data_id)
|
|
867
896
|
self.assertEqual('datatree', str(descriptor.data_type))
|
|
868
897
|
self.assertEqual(["y", "x", "time", "bnds"], list(descriptor.dims.keys()))
|
|
869
898
|
self.assertEqual(2, descriptor.dims['bnds'])
|
|
@@ -887,7 +916,7 @@ class CciOdpDataTreeOpenerTest(unittest.TestCase):
|
|
|
887
916
|
@skipIf(os.environ.get('XCUBE_CCI_DISABLE_WEB_TESTS', '1') == '1',
|
|
888
917
|
'XCUBE_CCI_DISABLE_WEB_TESTS = 1')
|
|
889
918
|
def test_get_open_data_params_schema(self):
|
|
890
|
-
schema = self._opener.get_open_data_params_schema(
|
|
919
|
+
schema = self._opener.get_open_data_params_schema(FIRE_ID).to_dict()
|
|
891
920
|
self.assertIsNotNone(schema)
|
|
892
921
|
self.assertTrue('variable_names' in schema['properties'])
|
|
893
922
|
self.assertTrue('place_names' in schema['properties'])
|
|
@@ -898,7 +927,7 @@ class CciOdpDataTreeOpenerTest(unittest.TestCase):
|
|
|
898
927
|
'XCUBE_CCI_DISABLE_WEB_TESTS = 1')
|
|
899
928
|
def test_open_data(self):
|
|
900
929
|
data = self._opener.open_data(
|
|
901
|
-
|
|
930
|
+
FIRE_ID, place_names=["AREA_1", "AREA_2"], variable_names=["JD", "CL"]
|
|
902
931
|
)
|
|
903
932
|
self.assertIsNotNone(data)
|
|
904
933
|
self.assertTrue(data.is_root)
|
|
@@ -913,6 +942,24 @@ class CciOdpDataTreeOpenerTest(unittest.TestCase):
|
|
|
913
942
|
self.assertEqual({264, 28499, 57888}, set(area_1_dt.dataset.JD.shape))
|
|
914
943
|
self.assertIsNotNone(area_1_dt.dataset.zarr_store.get())
|
|
915
944
|
|
|
945
|
+
@skipIf(os.environ.get('XCUBE_CCI_DISABLE_WEB_TESTS', '1') == '1',
|
|
946
|
+
'XCUBE_CCI_DISABLE_WEB_TESTS = 1')
|
|
947
|
+
def test_open_data_lc(self):
|
|
948
|
+
place_name = "A02T20KPA"
|
|
949
|
+
variable_name = "CL01"
|
|
950
|
+
data = self._opener.open_data(HR_LC_ID, place_names=[place_name], variable_names=[variable_name])
|
|
951
|
+
ds = data.get(place_name)
|
|
952
|
+
self.assertIsNotNone(ds)
|
|
953
|
+
self.assertTrue(data.is_root)
|
|
954
|
+
self.assertTrue(data.is_empty)
|
|
955
|
+
self.assertEqual({"A02T20KPA"}, set(data.keys()))
|
|
956
|
+
sub_dt = data.get("A02T20KPA")
|
|
957
|
+
self.assertIsNotNone(sub_dt.dataset)
|
|
958
|
+
self.assertEqual(1, len(sub_dt.dataset.data_vars))
|
|
959
|
+
self.assertIn("CL01", sub_dt.dataset.data_vars)
|
|
960
|
+
self.assertEqual({"time", "x", "y", "bnds"}, set(sub_dt.dataset.dims.keys()))
|
|
961
|
+
self.assertEqual((1, 10980, 10980), sub_dt.dataset.CL01.shape)
|
|
962
|
+
self.assertIsNotNone(sub_dt.dataset.zarr_store.get())
|
|
916
963
|
|
|
917
964
|
class CciOdpDataStoreTest(unittest.TestCase):
|
|
918
965
|
|
|
@@ -994,7 +1041,7 @@ class CciDataNormalizationTest(unittest.TestCase):
|
|
|
994
1041
|
good_datasets = []
|
|
995
1042
|
for data in all_data:
|
|
996
1043
|
if 'climatology' in data.data_id:
|
|
997
|
-
print(
|
|
1044
|
+
print('Cannot read data due to unsupported frequency')
|
|
998
1045
|
datasets_with_unsupported_frequencies.append(data.data_id)
|
|
999
1046
|
continue
|
|
1000
1047
|
if not data.data_vars or len(data.data_vars) < 1:
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from unittest import skipIf
|
|
3
|
+
from unittest import TestCase
|
|
4
|
+
|
|
1
5
|
import pandas as pd
|
|
2
|
-
import unittest
|
|
3
6
|
|
|
4
7
|
from xcube_cci.cciodp import CciOdp
|
|
5
8
|
from xcube_cci.dataframeaccess import DataFrameAccessor
|
|
6
9
|
|
|
7
10
|
GHG_DS_ID = "esacci.GHG.satellite-orbit-frequency.L2.CH4.SCIAMACHY.Envisat.IMAP.v7-2.r1"
|
|
8
11
|
|
|
9
|
-
class DataFrameAccessTest(
|
|
12
|
+
class DataFrameAccessTest(TestCase):
|
|
10
13
|
|
|
11
14
|
def setUp(self) -> None:
|
|
12
15
|
ccicdc = CciOdp(data_type='geodataframe')
|
|
13
16
|
self._dfa = DataFrameAccessor(ccicdc, GHG_DS_ID, {})
|
|
14
17
|
|
|
18
|
+
@skipIf(os.environ.get('XCUBE_CCI_DISABLE_WEB_TESTS', '1') == '1',
|
|
19
|
+
'XCUBE_CCI_DISABLE_WEB_TESTS = 1')
|
|
15
20
|
def test_get_geodataframe(self):
|
|
16
21
|
gdf = self._dfa.get_geodataframe()
|
|
17
22
|
self.assertIsNotNone(gdf)
|
|
18
23
|
|
|
24
|
+
@skipIf(os.environ.get('XCUBE_CCI_DISABLE_WEB_TESTS', '1') == '1',
|
|
25
|
+
'XCUBE_CCI_DISABLE_WEB_TESTS = 1')
|
|
19
26
|
def test_get_geodataframe_for_dataset(self):
|
|
20
27
|
gdf = self._dfa._get_features_from_cci_cdc(
|
|
21
28
|
GHG_DS_ID,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import jsonschema
|
|
2
1
|
import unittest
|
|
3
2
|
|
|
3
|
+
import jsonschema
|
|
4
4
|
from xcube.core.store import DatasetDescriptor
|
|
5
5
|
from xcube.util.jsonschema import JsonObjectSchema
|
|
6
6
|
|
|
7
7
|
from xcube_cci.dtaccess import DataTreeDescriptor
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
class DataTreeDescriptorTest(unittest.TestCase):
|
|
10
11
|
def test_get_schema(self):
|
|
11
12
|
schema = DataTreeDescriptor.get_schema()
|
|
@@ -122,9 +123,9 @@ class DataTreeDescriptorTest(unittest.TestCase):
|
|
|
122
123
|
self.assertEqual("EPSG:4326", descriptor.crs)
|
|
123
124
|
self.assertEqual(1, len(descriptor.data_nodes))
|
|
124
125
|
self.assertTrue("first_inner_tree" in descriptor.data_nodes)
|
|
125
|
-
self.assertIsInstance(descriptor.data_nodes.get("
|
|
126
|
+
self.assertIsInstance(descriptor.data_nodes.get("first_inner_tree"), DataTreeDescriptor)
|
|
126
127
|
|
|
127
|
-
def
|
|
128
|
+
def test_from_dict_datatree_descriptors_with_inner_trees_as_dict(self):
|
|
128
129
|
descriptor_dict = dict(
|
|
129
130
|
data_id="xyz",
|
|
130
131
|
data_type="datatree",
|
|
@@ -23,11 +23,9 @@ import os
|
|
|
23
23
|
import unittest
|
|
24
24
|
|
|
25
25
|
import xarray as xr
|
|
26
|
+
from xcube.core.store import (DatasetDescriptor, DataStore, DataType,
|
|
27
|
+
MutableDataStore)
|
|
26
28
|
|
|
27
|
-
from xcube.core.store import DataStore
|
|
28
|
-
from xcube.core.store import MutableDataStore
|
|
29
|
-
from xcube.core.store import DatasetDescriptor
|
|
30
|
-
from xcube.core.store import DataType
|
|
31
29
|
from xcube_cci.kcaccess import CciKerchunkDataStore
|
|
32
30
|
|
|
33
31
|
|
|
@@ -56,7 +54,7 @@ class CciKerchunkDataStoreTest(unittest.TestCase):
|
|
|
56
54
|
def test_list_data_ids(self):
|
|
57
55
|
data_ids = self.store.list_data_ids()
|
|
58
56
|
self.assertIn(
|
|
59
|
-
"ESACCI-BIOMASS-L4-AGB-CHANGE-100m-
|
|
57
|
+
"ESACCI-BIOMASS-L4-AGB-CHANGE-100m-2020-2010-fv4.0-kr1.1",
|
|
60
58
|
data_ids
|
|
61
59
|
)
|
|
62
60
|
self.assertIn(
|
|
@@ -78,19 +76,19 @@ class CciKerchunkDataStoreTest(unittest.TestCase):
|
|
|
78
76
|
|
|
79
77
|
def test_has_data(self):
|
|
80
78
|
store = self.store
|
|
81
|
-
data_id = 'ESACCI-
|
|
79
|
+
data_id = 'ESACCI-BIOMASS-L4-AGB-CHANGE-100m-2020-2010-fv4.0-kr1.1'
|
|
82
80
|
self.assertEqual(True, store.has_data(data_id))
|
|
83
81
|
self.assertEqual(False, store.has_data("lst-cube"))
|
|
84
82
|
|
|
85
83
|
def test_describe_data(self):
|
|
86
|
-
data_id = 'ESACCI-
|
|
84
|
+
data_id = 'ESACCI-BIOMASS-L4-AGB-CHANGE-100m-2020-2010-fv4.0-kr1.1'
|
|
87
85
|
descriptor = self.store.describe_data(data_id)
|
|
88
86
|
self.assertIsInstance(descriptor, DatasetDescriptor)
|
|
89
87
|
self.assertEqual(data_id, descriptor.data_id)
|
|
90
88
|
self.assertIsInstance(descriptor.data_type, DataType)
|
|
91
89
|
self.assertIs(xr.Dataset, descriptor.data_type.dtype)
|
|
92
90
|
self.assertIsInstance(descriptor.bbox, tuple)
|
|
93
|
-
self.
|
|
91
|
+
self.assertIsInstance(descriptor.spatial_res, float)
|
|
94
92
|
self.assertIsInstance(descriptor.dims, dict)
|
|
95
93
|
self.assertIsInstance(descriptor.coords, dict)
|
|
96
94
|
self.assertIsInstance(descriptor.data_vars, dict)
|
|
@@ -108,7 +106,7 @@ class CciKerchunkDataStoreTest(unittest.TestCase):
|
|
|
108
106
|
|
|
109
107
|
def test_search_data(self):
|
|
110
108
|
search_results = list(self.store.search_data())
|
|
111
|
-
self.assertEqual(
|
|
109
|
+
self.assertEqual(209, len(search_results))
|
|
112
110
|
for descriptor, data_id in zip(search_results, self.store.get_data_ids()):
|
|
113
111
|
self.assertIsInstance(descriptor, DatasetDescriptor)
|
|
114
112
|
self.assertEqual(data_id, descriptor.data_id)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from unittest import TestCase
|
|
2
2
|
|
|
3
|
-
from xcube_cci.normalize import normalize_dims_description
|
|
4
|
-
|
|
3
|
+
from xcube_cci.normalize import (normalize_dims_description,
|
|
4
|
+
normalize_variable_dims_description)
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class TestNormalize(TestCase):
|