diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..5fa15f1 --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,15 @@ +name: manual_docs + +on: + workflow_dispatch: + +jobs: + build_docs: + if: ${{ github.ref == 'refs/heads/main'}} + uses: openweathermap/deker-actions/.github/workflows/docs_build.yml@master + with: + python-version: '3.9' + + publish_docs: + needs: build_docs + uses: openweathermap/deker-actions/.github/workflows/docs_publish.yml@master diff --git a/deker/ABC/base_factory.py b/deker/ABC/base_factory.py index a3faf4b..b79bcc3 100644 --- a/deker/ABC/base_factory.py +++ b/deker/ABC/base_factory.py @@ -52,8 +52,11 @@ def __del__(self) -> None: @abstractmethod def close(self) -> None: """Close own executor.""" - if self.executor and self._own_executor: - self.executor.shutdown(wait=True, cancel_futures=False) + try: + if self.executor and self._own_executor: + self.executor.shutdown(wait=True, cancel_futures=False) + except AttributeError: + pass @abstractmethod def get_array_adapter(self, *args: Any, **kwargs: Any) -> "BaseArrayAdapter": diff --git a/deker/ABC/base_subset.py b/deker/ABC/base_subset.py index d7960eb..0394777 100644 --- a/deker/ABC/base_subset.py +++ b/deker/ABC/base_subset.py @@ -205,7 +205,7 @@ def __generate_full_scale(dimension: Dimension) -> List: step = dimension.scale.step start_value = dimension.scale.start_value end = start_value + dimension.size * step - rounder = len(str(start_value).split(".")[-1]) + rounder = len(str(step).split(".")[-1]) value = np.around(np.arange(start_value, end, dimension.scale.step), rounder) return value.tolist()[: dimension.size] # type: ignore[return-value] diff --git a/deker/client.py b/deker/client.py index 81484b4..85a8a16 100644 --- a/deker/client.py +++ b/deker/client.py @@ -330,15 +330,20 @@ def calculate_storage_size(self, collection_name: str = "") -> StorageSize: def close(self) -> None: """Close client.""" - if self.__adapter: - self.__adapter.close() - self.__adapter = None - if self.__factory: - self.__factory.close() - self.__factory = None - self.__is_closed = True - self.__ctx.is_closed = True - self.logger.info("Client is closed") + try: + if self.__adapter: + self.__adapter.close() + self.__adapter = None + if self.__factory: + self.__factory.close() + self.__factory = None + if self.__ctx: + self.__ctx.is_closed = True + self.__is_closed = True + except AttributeError as e: + self.logger.debug(f"Exception in Client.close(): {e}") + finally: + self.logger.info("Client is closed") def create_collection( self, diff --git a/docs/deker/connecting_to_server.rst b/docs/deker/connecting_to_server.rst index 04ea105..d56f7d0 100644 --- a/docs/deker/connecting_to_server.rst +++ b/docs/deker/connecting_to_server.rst @@ -67,9 +67,9 @@ By default, adapters' ``httpx client`` has following settings: - True * - http2 - bool - - True + - False * - timeout - - Optional[float] + - Optional[int, float] - None The full list of ``httpx`` configuration parameters you can find at `the official website`_. diff --git a/docs/deker/shell.rst b/docs/deker/shell.rst index bce5989..bf2822d 100644 --- a/docs/deker/shell.rst +++ b/docs/deker/shell.rst @@ -29,7 +29,6 @@ line parameter (in this case it would be ``/tmp/deker-data``):: deker file:///tmp/deker-data - Examples ======== @@ -46,7 +45,6 @@ REPL menu (called with ``F2``): .. image:: images/shell_menu.png :scale: 45% - Interface ========= @@ -91,3 +89,9 @@ Functions * ``use("collection_name")``: gets collection from client and saves it to ``collection`` variable * ``get_global_coll_variable()``: returns ``collection`` global variable + +Miscellaneous +-------------- +You can also run an isolated Python script with:: + + deker my_python_script.py diff --git a/tests/test_cases/test_subsets/test_array_subset_methods.py b/tests/test_cases/test_subsets/test_array_subset_methods.py index 61230c2..33be18a 100644 --- a/tests/test_cases/test_subsets/test_array_subset_methods.py +++ b/tests/test_cases/test_subsets/test_array_subset_methods.py @@ -164,10 +164,10 @@ def full_described_array(self, client) -> Array: step=timedelta(hours=1), ), DimensionSchema( - name="y", size=361, scale=Scale(start_value=90.0, step=-0.5, name="lat") + name="y", size=721, scale=Scale(start_value=90.0, step=-0.25, name="lat") ), DimensionSchema( - name="x", size=720, scale=Scale(start_value=-180.0, step=0.5, name="lon") + name="x", size=1440, scale=Scale(start_value=-180.0, step=0.25, name="lon") ), DimensionSchema(name="layers", size=3, labels=["temp", "pres", "pcp"]), ] @@ -194,8 +194,8 @@ def not_described_array(self, client) -> Array: start_value=datetime(2023, 1, 1, tzinfo=timezone.utc), step=timedelta(hours=1), ), - DimensionSchema(name="y", size=361), - DimensionSchema(name="x", size=720), + DimensionSchema(name="y", size=721), + DimensionSchema(name="x", size=1440), DimensionSchema(name="layers", size=3), ] @@ -247,8 +247,8 @@ def test_subset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -258,8 +258,8 @@ def test_subset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -273,7 +273,7 @@ def test_subset_description_on_read_xarray( for n in range(24) ], "y": [90.0], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -286,7 +286,7 @@ def test_subset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], "x": [-180], "layers": ["temp", "pres", "pcp"], } @@ -300,8 +300,8 @@ def test_subset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["pres"], } ), @@ -311,8 +311,8 @@ def test_subset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": [-179.0], + "y": [89.75], + "x": [-179.5], "layers": ["temp", "pres", "pcp"], } ), @@ -322,8 +322,8 @@ def test_subset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": [-179.0], + "y": [89.75], + "x": [-179.5], "layers": ["temp"], } ), @@ -333,8 +333,8 @@ def test_subset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -344,8 +344,8 @@ def test_subset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": [89.75], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -355,8 +355,8 @@ def test_subset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": [-179.0], + "y": [89.75], + "x": [-179.5], "layers": ["temp", "pres", "pcp"], } ), @@ -366,8 +366,8 @@ def test_subset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": [-179.0], + "y": [89.75], + "x": [-179.5], "layers": ["temp"], } ), @@ -380,8 +380,8 @@ def test_subset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(6, 12) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -394,8 +394,8 @@ def test_subset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": [87.0, 86.5, 86.0, 85.5, 85.0, 84.5], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": [88.5, 88.25, 88.0, 87.75, 87.5, 87.25], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -408,8 +408,8 @@ def test_subset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": [-177.0, -176.5, -176.0, -175.5, -175.0, -174.5], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": [-178.5, -178.25, -178.0, -177.75, -177.5, -177.25], "layers": ["temp", "pres", "pcp"], } ), @@ -422,22 +422,22 @@ def test_subset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres"], } ), ), ( - np.index_exp[22:, 359:, 718:, 1:], + np.index_exp[22:, 719:, 1438:, 1:], OrderedDict( { "dt": [ datetime(2023, 1, 1, 22, tzinfo=timezone.utc), datetime(2023, 1, 1, 23, tzinfo=timezone.utc), ], - "y": [-89.5, -90.0], - "x": [179.0, 179.5], + "y": [-89.75, -90.0], + "x": [179.5, 179.75], "layers": ["pres", "pcp"], } ), @@ -448,7 +448,7 @@ def test_subset_description_on_read_xarray( { "dt": [datetime(2023, 1, 1, 23, 0, tzinfo=timezone.utc)], "y": [-90.0], - "x": [179.5], + "x": [179.75], "layers": ["pcp"], } ), @@ -458,8 +458,8 @@ def test_subset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, 22, 0, tzinfo=timezone.utc)], - "y": [-89.5], - "x": [179.0], + "y": [-89.75], + "x": [179.5], "layers": ["pres"], } ), @@ -493,8 +493,8 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -504,8 +504,8 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -519,7 +519,7 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, for n in range(24) ], "y": [0], - "x": list(range(720)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -532,7 +532,7 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), + "y": list(range(721)), "x": [0], "layers": list(range(3)), } @@ -546,8 +546,8 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": [1], } ), @@ -579,8 +579,8 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -591,7 +591,7 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], "y": [1], - "x": list(range(720)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -626,8 +626,8 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(6, 12) ], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -641,7 +641,7 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, for n in range(24) ], "y": [6, 7, 8, 9, 10, 11], - "x": list(range(720)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -654,7 +654,7 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), + "y": list(range(721)), "x": [6, 7, 8, 9, 10, 11], "layers": list(range(3)), } @@ -668,22 +668,22 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": [0, 1], } ), ), ( - np.index_exp[22:, 359:, 718:, 1:], + np.index_exp[22:, 719:, 1438:, 1:], OrderedDict( { "dt": [ datetime(2023, 1, 1, 22, tzinfo=timezone.utc), datetime(2023, 1, 1, 23, tzinfo=timezone.utc), ], - "y": [359, 360], - "x": [718, 719], + "y": [719, 720], + "x": [1438, 1439], "layers": [1, 2], } ), @@ -693,8 +693,8 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, OrderedDict( { "dt": [datetime(2023, 1, 1, 23, 0, tzinfo=timezone.utc)], - "y": [360], - "x": [719], + "y": [720], + "x": [1439], "layers": [2], } ), @@ -704,8 +704,8 @@ def test_subset_description(self, full_described_array: Array, index_exp: Slice, OrderedDict( { "dt": [datetime(2023, 1, 1, 22, 0, tzinfo=timezone.utc)], - "y": [359], - "x": [718], + "y": [719], + "x": [1438], "layers": [1], } ), diff --git a/tests/test_cases/test_subsets/test_varray_subset_methods.py b/tests/test_cases/test_subsets/test_varray_subset_methods.py index 41cb71b..1b2bbb9 100644 --- a/tests/test_cases/test_subsets/test_varray_subset_methods.py +++ b/tests/test_cases/test_subsets/test_varray_subset_methods.py @@ -535,10 +535,10 @@ def full_described_varray(self, client) -> VArray: step=timedelta(hours=1), ), DimensionSchema( - name="y", size=361, scale=Scale(start_value=90.0, step=-0.5, name="lat") + name="y", size=721, scale=Scale(start_value=90.0, step=-0.25, name="lat") ), DimensionSchema( - name="x", size=720, scale=Scale(start_value=-180.0, step=0.5, name="lon") + name="x", size=1440, scale=Scale(start_value=-180.0, step=0.25, name="lon") ), DimensionSchema(name="layers", size=3, labels=["temp", "pres", "pcp"]), ] @@ -565,8 +565,8 @@ def not_described_varray(self, client) -> VArray: start_value=datetime(2023, 1, 1, tzinfo=timezone.utc), step=timedelta(hours=1), ), - DimensionSchema(name="y", size=361), - DimensionSchema(name="x", size=720), + DimensionSchema(name="y", size=721), + DimensionSchema(name="x", size=1440), DimensionSchema(name="layers", size=3), ] @@ -619,8 +619,8 @@ def test_vsubset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -630,8 +630,8 @@ def test_vsubset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -645,7 +645,7 @@ def test_vsubset_description_on_read_xarray( for n in range(24) ], "y": [90.0], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -658,7 +658,7 @@ def test_vsubset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], "x": [-180], "layers": ["temp", "pres", "pcp"], } @@ -672,8 +672,8 @@ def test_vsubset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["pres"], } ), @@ -683,8 +683,8 @@ def test_vsubset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": [-179.0], + "y": [89.75], + "x": [-179.5], "layers": ["temp", "pres", "pcp"], } ), @@ -694,8 +694,8 @@ def test_vsubset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": [-179.0], + "y": [89.75], + "x": [-179.5], "layers": ["temp"], } ), @@ -705,8 +705,8 @@ def test_vsubset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -716,8 +716,8 @@ def test_vsubset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": [89.75], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -727,8 +727,8 @@ def test_vsubset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": [-179.0], + "y": [89.75], + "x": [-179.5], "layers": ["temp", "pres", "pcp"], } ), @@ -738,8 +738,8 @@ def test_vsubset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": [89.5], - "x": [-179.0], + "y": [89.75], + "x": [-179.5], "layers": ["temp"], } ), @@ -752,8 +752,8 @@ def test_vsubset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(6, 12) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -766,8 +766,8 @@ def test_vsubset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": [87.0, 86.5, 86.0, 85.5, 85.0, 84.5], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": [88.5, 88.25, 88.0, 87.75, 87.5, 87.25], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres", "pcp"], } ), @@ -780,8 +780,8 @@ def test_vsubset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": [-177.0, -176.5, -176.0, -175.5, -175.0, -174.5], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": [-178.5, -178.25, -178.0, -177.75, -177.5, -177.25], "layers": ["temp", "pres", "pcp"], } ), @@ -794,22 +794,22 @@ def test_vsubset_description_on_read_xarray( datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": np.around(np.arange(90, -91, -0.5), 1).tolist()[:361], - "x": np.around(np.arange(-180, 180, 0.5), 1).tolist()[:720], + "y": np.around(np.arange(90, -91, -0.25), 2).tolist()[:721], + "x": np.around(np.arange(-180, 180, 0.25), 2).tolist()[:1440], "layers": ["temp", "pres"], } ), ), ( - np.index_exp[22:, 359:, 718:, 1:], + np.index_exp[22:, 719:, 1438:, 1:], OrderedDict( { "dt": [ - datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n - for n in range(22, 24) + datetime(2023, 1, 1, 22, tzinfo=timezone.utc), + datetime(2023, 1, 1, 23, tzinfo=timezone.utc), ], - "y": [-89.5, -90.0], - "x": [179.0, 179.5], + "y": [-89.75, -90.0], + "x": [179.5, 179.75], "layers": ["pres", "pcp"], } ), @@ -820,7 +820,7 @@ def test_vsubset_description_on_read_xarray( { "dt": [datetime(2023, 1, 1, 23, 0, tzinfo=timezone.utc)], "y": [-90.0], - "x": [179.5], + "x": [179.75], "layers": ["pcp"], } ), @@ -830,8 +830,8 @@ def test_vsubset_description_on_read_xarray( OrderedDict( { "dt": [datetime(2023, 1, 1, 22, 0, tzinfo=timezone.utc)], - "y": [-89.5], - "x": [179.0], + "y": [-89.75], + "x": [179.5], "layers": ["pres"], } ), @@ -864,8 +864,8 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -875,8 +875,8 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -890,7 +890,7 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli for n in range(24) ], "y": [0], - "x": list(range(720)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -903,7 +903,7 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), + "y": list(range(721)), "x": [0], "layers": list(range(3)), } @@ -917,8 +917,8 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": [1], } ), @@ -950,8 +950,8 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli OrderedDict( { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -962,7 +962,7 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli { "dt": [datetime(2023, 1, 1, tzinfo=timezone.utc)], "y": [1], - "x": list(range(720)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -997,8 +997,8 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(6, 12) ], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -1012,7 +1012,7 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli for n in range(24) ], "y": [6, 7, 8, 9, 10, 11], - "x": list(range(720)), + "x": list(range(1440)), "layers": list(range(3)), } ), @@ -1025,7 +1025,7 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), + "y": list(range(721)), "x": [6, 7, 8, 9, 10, 11], "layers": list(range(3)), } @@ -1039,22 +1039,22 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli datetime(2023, 1, 1, tzinfo=timezone.utc) + timedelta(hours=1) * n for n in range(24) ], - "y": list(range(361)), - "x": list(range(720)), + "y": list(range(721)), + "x": list(range(1440)), "layers": [0, 1], } ), ), ( - np.index_exp[22:, 359:, 718:, 1:], + np.index_exp[22:, 719:, 1438:, 1:], OrderedDict( { "dt": [ datetime(2023, 1, 1, 22, tzinfo=timezone.utc), datetime(2023, 1, 1, 23, tzinfo=timezone.utc), ], - "y": [359, 360], - "x": [718, 719], + "y": [719, 720], + "x": [1438, 1439], "layers": [1, 2], } ), @@ -1064,8 +1064,8 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli OrderedDict( { "dt": [datetime(2023, 1, 1, 23, 0, tzinfo=timezone.utc)], - "y": [360], - "x": [719], + "y": [720], + "x": [1439], "layers": [2], } ), @@ -1075,8 +1075,8 @@ def test_vsubset_description(self, full_described_varray: VArray, index_exp: Sli OrderedDict( { "dt": [datetime(2023, 1, 1, 22, 0, tzinfo=timezone.utc)], - "y": [359], - "x": [718], + "y": [719], + "x": [1438], "layers": [1], } ),