diff --git a/.github/workflows/release_test.yml b/.github/workflows/release_test.yml new file mode 100644 index 0000000..f3f8e3a --- /dev/null +++ b/.github/workflows/release_test.yml @@ -0,0 +1,50 @@ +name: Upload Python Package + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '*' # Push events to matching v*, i.e. v1.0, v20.15.10 + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + release: + name: Create Release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + with: + # by default, it uses a depth of 1 + # this fetches all history so that we can read each commit + fetch-depth: 0 + - name: Generate Changelog + run: .github/release_message.sh > release_message.md + - name: Release + uses: softprops/action-gh-release@v1 + with: + body_path: release_message.md + + deploy: + needs: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/pybomwater/bom_water.py b/pybomwater/bom_water.py index 7543721..9c1d696 100644 --- a/pybomwater/bom_water.py +++ b/pybomwater/bom_water.py @@ -315,7 +315,11 @@ def divide_chunks(self, l, n): def define_request_chunking_size(self, features, property, procedure, start_date, end_date ): - request_values_limit = 500000 + """ + This is a rough stab at determining a chunk size. + Trying to balance between making too many requests and a response size which is too large + """ + request_values_limit = 500000#BoM have a Constraint of 2000000 values specified however this does not seem real as the request fails if we try to get close to this value. size = 2 feat_count = len(features) diff --git a/test/test_core.py b/test/test_core.py index 7d70fac..d97f6e2 100755 --- a/test/test_core.py +++ b/test/test_core.py @@ -239,7 +239,7 @@ def test_duplicate_dates(self): lower_left_coords = f'{low_left_lat} {low_left_long}' upper_right_coords = f'{upper_right_lat} {upper_right_long}' coords = tuple((lower_left_coords, upper_right_coords)) - t_begin = "1920-01-01T00:00:00+10" + t_begin = "2000-01-01T00:00:00+10" t_end = "2024-12-31T00:00:00+10" spatial_path = './test/test_data/Spatial/test_filter_layer.shp'#os.path.join(spatial_test_data_path, 'mdb_buffer_1km.shp')