From 71b6dfc2cf95230595a9523a03d2cd24a5a73996 Mon Sep 17 00:00:00 2001 From: chrisdicaprio Date: Wed, 20 Nov 2024 16:21:46 +1300 Subject: [PATCH 1/3] upgrade version of nzshm-common to pre-release / 0.8.3 --- poetry.lock | 21 ++++++++++++------- pyproject.toml | 2 +- scripts/nz_binned_demo.py | 2 +- scripts/ths_cache.py | 4 ++-- scripts/ths_testing.py | 4 ++-- tests/test_pynamo_disagg_models.py | 2 +- tests/test_pynamo_models_v3.py | 2 +- tests/test_query_disaggs.py | 2 +- tests/test_query_hazard_agg_v3.py | 2 +- tests/test_query_hazard_agg_vs30_fix.py | 2 +- tests/test_query_hazard_caching.py | 2 +- tests/test_query_rlzs_v3.py | 2 +- tests/test_query_rlzs_vs30_fix.py | 2 +- tests/test_site_specific_vs30.py | 2 +- tests/test_utils.py | 2 +- toshi_hazard_store/model/disagg_models.py | 2 +- .../model/location_indexed_model.py | 2 +- toshi_hazard_store/model/openquake_models.py | 2 +- toshi_hazard_store/query/disagg_queries.py | 2 +- toshi_hazard_store/query/hazard_query.py | 2 +- toshi_hazard_store/utils.py | 2 +- 21 files changed, 36 insertions(+), 29 deletions(-) diff --git a/poetry.lock b/poetry.lock index a2b8ec7..cca2d5f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "asgiref" @@ -1982,17 +1982,24 @@ files = [ [[package]] name = "nzshm-common" -version = "0.6.1" +version = "0.8.3" description = "A small pure python library for shared NZ NSHM data like locations." optional = false python-versions = ">=3.8,<4.0.0" -files = [ - {file = "nzshm_common-0.6.1-py3-none-any.whl", hash = "sha256:06bd0b6a35b5adc05d080742885bb7273469ef7d08a9502f5ef30bb1f794aa0f"}, - {file = "nzshm_common-0.6.1.tar.gz", hash = "sha256:97081e615fa311bae8161628bbb89d6b3799c7f246953325200c60cfc63e00f2"}, -] +files = [] +develop = false [package.extras] +dev = [] +doc = [] geometry = ["shapely (>=2.0.2,<3.0.0)"] +test = [] + +[package.source] +type = "git" +url = "https://github.com/GNS-Science/nzshm-common-py.git" +reference = "pre-release" +resolved_reference = "a0f90c8af4b9149b93cc5fa9d44f24bcb3a71a40" [[package]] name = "openquake-engine" @@ -3534,4 +3541,4 @@ test = [] [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.13" -content-hash = "0386515d568f6b84c235237d2228d9022e143e006f6ca0ad75bb883ad15c4c05" +content-hash = "1620a8c41f79b65d7ad2012c19cf233dee1096bd6c7faa296f16a1596b19db73" diff --git a/pyproject.toml b/pyproject.toml index c922268..949611b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,12 +38,12 @@ python = ">=3.10,<3.13" # urllib3 = ">2" pandas = "~2.0.3" numpy = "^1.26.4" -nzshm-common = "^0.6.1" pynamodb-attributes = "^0.4.0" pynamodb = "^5.5.1" openquake-engine = {version = "^3.18.0", optional = true} fiona = {version = "^1.9.5", optional = true} networkx = {version = "^3.2.1", optional = true} +nzshm-common = {git = "https://github.com/GNS-Science/nzshm-common-py.git", rev = "pre-release"} [tool.poetry.group.dev.dependencies] black = { version = "^22.3"} diff --git a/scripts/nz_binned_demo.py b/scripts/nz_binned_demo.py index a7f9916..3b8effe 100644 --- a/scripts/nz_binned_demo.py +++ b/scripts/nz_binned_demo.py @@ -2,7 +2,7 @@ from typing import Dict, List, Tuple from nzshm_common.grids.region_grid import load_grid -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from nzshm_common.location.location import LOCATIONS_BY_ID diff --git a/scripts/ths_cache.py b/scripts/ths_cache.py index 86cf7f4..c73069b 100644 --- a/scripts/ths_cache.py +++ b/scripts/ths_cache.py @@ -9,8 +9,8 @@ import click import pandas as pd from nzshm_common.grids import RegionGrid, load_grid -from nzshm_common.location.code_location import CodedLocation -from nzshm_common.location.location import LOCATION_LISTS, LOCATIONS, location_by_id +from nzshm_common.location import CodedLocation, location_by_id +from nzshm_common.location.location import LOCATION_LISTS, LOCATIONS from toshi_hazard_store import model, query from toshi_hazard_store.config import DEPLOYMENT_STAGE, LOCAL_CACHE_FOLDER, REGION diff --git a/scripts/ths_testing.py b/scripts/ths_testing.py index 1a33065..f76e83b 100644 --- a/scripts/ths_testing.py +++ b/scripts/ths_testing.py @@ -5,8 +5,8 @@ import click import pandas as pd -from nzshm_common.location.code_location import CodedLocation -from nzshm_common.location.location import LOCATIONS, location_by_id +from nzshm_common.location import CodedLocation, location_by_id +from nzshm_common.location.location import LOCATIONS from toshi_hazard_store import model, query, query_v3 from toshi_hazard_store.config import DEPLOYMENT_STAGE, LOCAL_CACHE_FOLDER, REGION diff --git a/tests/test_pynamo_disagg_models.py b/tests/test_pynamo_disagg_models.py index 7177db4..ce8dfc3 100644 --- a/tests/test_pynamo_disagg_models.py +++ b/tests/test_pynamo_disagg_models.py @@ -6,7 +6,7 @@ import numpy as np from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from toshi_hazard_store import model diff --git a/tests/test_pynamo_models_v3.py b/tests/test_pynamo_models_v3.py index 11e4812..81c7973 100644 --- a/tests/test_pynamo_models_v3.py +++ b/tests/test_pynamo_models_v3.py @@ -3,7 +3,7 @@ import pynamodb.exceptions from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from toshi_hazard_store import model diff --git a/tests/test_query_disaggs.py b/tests/test_query_disaggs.py index 76acf26..abc2b3c 100644 --- a/tests/test_query_disaggs.py +++ b/tests/test_query_disaggs.py @@ -3,7 +3,7 @@ import numpy as np from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from nzshm_common.location.location import LOCATIONS_BY_ID from toshi_hazard_store import model, query diff --git a/tests/test_query_hazard_agg_v3.py b/tests/test_query_hazard_agg_v3.py index 6a42d8a..3241cf3 100644 --- a/tests/test_query_hazard_agg_v3.py +++ b/tests/test_query_hazard_agg_v3.py @@ -3,7 +3,7 @@ from unittest.mock import patch from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from nzshm_common.location.location import LOCATIONS_BY_ID from toshi_hazard_store import model, query_v3 diff --git a/tests/test_query_hazard_agg_vs30_fix.py b/tests/test_query_hazard_agg_vs30_fix.py index 5a432e0..d368367 100644 --- a/tests/test_query_hazard_agg_vs30_fix.py +++ b/tests/test_query_hazard_agg_vs30_fix.py @@ -3,7 +3,7 @@ from unittest.mock import patch from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from nzshm_common.location.location import LOCATIONS_BY_ID from toshi_hazard_store import model, query_v3 diff --git a/tests/test_query_hazard_caching.py b/tests/test_query_hazard_caching.py index 88b5722..0e88843 100644 --- a/tests/test_query_hazard_caching.py +++ b/tests/test_query_hazard_caching.py @@ -6,7 +6,7 @@ from unittest.mock import patch from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from nzshm_common.location.location import LOCATIONS_BY_ID from toshi_hazard_store import model, query diff --git a/tests/test_query_rlzs_v3.py b/tests/test_query_rlzs_v3.py index 53840f3..824bc16 100644 --- a/tests/test_query_rlzs_v3.py +++ b/tests/test_query_rlzs_v3.py @@ -2,7 +2,7 @@ import unittest from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from nzshm_common.location.location import LOCATIONS_BY_ID from toshi_hazard_store import model, query_v3 diff --git a/tests/test_query_rlzs_vs30_fix.py b/tests/test_query_rlzs_vs30_fix.py index 0e3a1c0..ce3a010 100644 --- a/tests/test_query_rlzs_vs30_fix.py +++ b/tests/test_query_rlzs_vs30_fix.py @@ -2,7 +2,7 @@ import unittest from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from nzshm_common.location.location import LOCATIONS_BY_ID from toshi_hazard_store import model, query_v3 diff --git a/tests/test_site_specific_vs30.py b/tests/test_site_specific_vs30.py index 7e7ffd0..0da3e84 100644 --- a/tests/test_site_specific_vs30.py +++ b/tests/test_site_specific_vs30.py @@ -3,7 +3,7 @@ import unittest from moto import mock_dynamodb -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from toshi_hazard_store import model diff --git a/tests/test_utils.py b/tests/test_utils.py index a17bde9..5073bcc 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -3,7 +3,7 @@ import unittest from nzshm_common.grids.region_grid import load_grid -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation class TestCodedLocation(unittest.TestCase): diff --git a/toshi_hazard_store/model/disagg_models.py b/toshi_hazard_store/model/disagg_models.py index 714a0f9..299092e 100644 --- a/toshi_hazard_store/model/disagg_models.py +++ b/toshi_hazard_store/model/disagg_models.py @@ -4,7 +4,7 @@ from datetime import datetime, timezone import numpy as np -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from pynamodb.attributes import UnicodeAttribute from pynamodb_attributes import FloatAttribute diff --git a/toshi_hazard_store/model/location_indexed_model.py b/toshi_hazard_store/model/location_indexed_model.py index de86b75..b05b4b1 100644 --- a/toshi_hazard_store/model/location_indexed_model.py +++ b/toshi_hazard_store/model/location_indexed_model.py @@ -1,7 +1,7 @@ import uuid from datetime import datetime, timezone -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from pynamodb.attributes import UnicodeAttribute, VersionAttribute from pynamodb.models import Model from pynamodb_attributes import FloatAttribute, TimestampAttribute diff --git a/toshi_hazard_store/model/openquake_models.py b/toshi_hazard_store/model/openquake_models.py index 7229b84..bebdeab 100644 --- a/toshi_hazard_store/model/openquake_models.py +++ b/toshi_hazard_store/model/openquake_models.py @@ -3,7 +3,7 @@ import logging from typing import Iterable, Iterator, Sequence, Union -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from pynamodb.attributes import JSONAttribute, ListAttribute, NumberAttribute, UnicodeAttribute, UnicodeSetAttribute from pynamodb.indexes import AllProjection, LocalSecondaryIndex from pynamodb.models import Model diff --git a/toshi_hazard_store/query/disagg_queries.py b/toshi_hazard_store/query/disagg_queries.py index afd15c1..f971f4a 100644 --- a/toshi_hazard_store/query/disagg_queries.py +++ b/toshi_hazard_store/query/disagg_queries.py @@ -5,7 +5,7 @@ import logging from typing import Iterable, Iterator, List, Type, Union -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation from pynamodb.expressions.condition import Condition from toshi_hazard_store.model import ( diff --git a/toshi_hazard_store/query/hazard_query.py b/toshi_hazard_store/query/hazard_query.py index 28b7173..be7db19 100644 --- a/toshi_hazard_store/query/hazard_query.py +++ b/toshi_hazard_store/query/hazard_query.py @@ -4,7 +4,7 @@ import logging from typing import Iterable, Iterator, Union -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation import toshi_hazard_store.model as model diff --git a/toshi_hazard_store/utils.py b/toshi_hazard_store/utils.py index 69a606a..790ef39 100644 --- a/toshi_hazard_store/utils.py +++ b/toshi_hazard_store/utils.py @@ -1,6 +1,6 @@ """Common utilities.""" -from nzshm_common.location.code_location import CodedLocation +from nzshm_common.location import CodedLocation def normalise_site_code(oq_site_object: tuple, force_normalized: bool = False) -> CodedLocation: From fadaf734d1d5c9b9226d0c4d6fc3b15f4de86f6d Mon Sep 17 00:00:00 2001 From: chrisdicaprio Date: Wed, 20 Nov 2024 20:29:13 +1300 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0edd9b3..c96a156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [0.7.10] - 2024-11-20 + +### Changed + - updated nzshm-common dependency + ## [0.7.9] - 2024-02-26 ### Changed From 2b734bda936ef5b5b8d2a1df4f25a8dd44e82f19 Mon Sep 17 00:00:00 2001 From: chrisdicaprio Date: Wed, 20 Nov 2024 20:29:26 +1300 Subject: [PATCH 3/3] =?UTF-8?q?Bump=20version:=200.7.9=20=E2=86=92=200.7.1?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- pyproject.toml | 2 +- toshi_hazard_store/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5f5c1bd..3c5c218 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.9 +current_version = 0.7.10 commit = True tag = True diff --git a/pyproject.toml b/pyproject.toml index 949611b..2b9f5c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool] [tool.poetry] name = "toshi-hazard-store" -version = "0.7.9" +version = "0.7.10" homepage = "https://github.com/GNS-Science/toshi-hazard-store" description = "Library for saving and retrieving NZHSM openquake hazard results with convenience (uses AWS Dynamodb)." authors = ["GNS Science "] diff --git a/toshi_hazard_store/__init__.py b/toshi_hazard_store/__init__.py index ed0f86a..91ed941 100644 --- a/toshi_hazard_store/__init__.py +++ b/toshi_hazard_store/__init__.py @@ -2,7 +2,7 @@ __author__ = """GNS Science""" __email__ = 'chrisbc@artisan.co.nz' -__version__ = '0.7.9' +__version__ = '0.7.10' import toshi_hazard_store.model as model import toshi_hazard_store.query.hazard_query as query_v3 # alias for clients using deprecated module name