Skip to content

Commit

Permalink
h3-py release v3.7.1 (#175)
Browse files Browse the repository at this point in the history
* bumping version

* bump py library versino

* drop windows build for a sec

* and the wheels

* put windows back

* updating ilammy/msvc-dev-cmd to see if it fixes the build

* update to use new Environment Files

https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files

* put the windows wheels back in

* update ilammy/msvc-dev-cmd in the wheels build

* testing 3.9

* try building wheel for mac py3.9

* bumping to 3.9 in a few places

* demonstrate failing distance test from #169

* fix for #169

* notes

* add PR numbers to changelog

* update h3lib badge version
  • Loading branch information
ajfriend authored Dec 18, 2020
1 parent 9cc3bfd commit fefba23
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
exclude:
- os: windows-latest
python-version: 2.7
Expand All @@ -29,14 +29,14 @@ jobs:
python-version: "${{ matrix.python-version }}"

## Start Windows stuff
- uses: ilammy/msvc-dev-cmd@v1.3.0
- uses: ilammy/msvc-dev-cmd@v1.5.0
if: startsWith(matrix.os, 'windows')

- name: Set Windows Compiler
if: startsWith(matrix.os, 'windows')
run: |
echo "::set-env name=CC::cl.exe"
echo "::set-env name=CXX::cl.exe"
echo "CC=cl.exe" >> $GITHUB_ENV
echo "CXX=cl.exe" >> $GITHUB_ENV
## End Windows stuff

- name: Install from source
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
python-version: 3.8

- uses: ilammy/msvc-dev-cmd@v1.3.0
- uses: ilammy/msvc-dev-cmd@v1.5.0
if: startsWith(matrix.os, 'windows')


Expand All @@ -52,7 +52,7 @@ jobs:
- name: Build Mac
if: startsWith(matrix.os, 'mac')
env:
CIBW_SKIP: pp* cp39-*
CIBW_SKIP: pp*
run: |
python -m cibuildwheel --output-dir wheelhouse
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Because H3-Py is versioned in lockstep with the H3 core library, please
avoid adding features or APIs which do not map onto the
[H3 core API](https://uber.github.io/h3/#/documentation/api-reference/).

## unreleased

## [3.7.1] - 2020-12-18

- fix for #169: `h3_distance` error reporting (#175)
- build Python 3.9 wheel for Mac (#175)
- bump h3lib version to v3.7.1 (#175)

## [3.7.0] - 2020-10-02

- Add functions (#171)
Expand Down
12 changes: 11 additions & 1 deletion dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,14 @@ git pull
cd ..
git add h3lib
git commit ...
```
```

for a specific version tag:

```sh
cd src/h3lib
git checkout v3.7.1 # or whatever version tag you'd like
cd ..
git add h3lib
git commit ...
```
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

init: purge
git submodule update --init
virtualenv -p python3 env
python -m venv env
env/bin/pip install .[all]

clear:
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![PyPI version](https://badge.fury.io/py/h3.svg)](https://badge.fury.io/py/h3)
[![PyPI downloads](https://pypip.in/d/h3/badge.png)](https://pypistats.org/packages/h3)
[![conda](https://img.shields.io/conda/vn/conda-forge/h3-py.svg)](https://anaconda.org/conda-forge/h3-py)
[![version](https://img.shields.io/badge/h3-v3.7.0-blue.svg)](https://github.com/uber/h3/releases/tag/v3.7.0)
[![version](https://img.shields.io/badge/h3-v3.7.1-blue.svg)](https://github.com/uber/h3/releases/tag/v3.7.1)
[![version](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)

[![Tests](https://github.com/uber/h3-py/workflows/tests/badge.svg)](https://github.com/uber/h3-py/actions)
Expand Down
5 changes: 5 additions & 0 deletions src/h3/_cy/cells.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ cpdef int distance(H3int h1, H3int h2) except -1:

d = h3lib.h3Distance(h1,h2)

if d < 0:
s = 'Cells are too far apart to compute distance: {} and {}'
s = s.format(hex(h1), hex(h2))
raise H3ValueError(s)

return d

cpdef H3int[:] disk(H3int h, int k):
Expand Down
3 changes: 2 additions & 1 deletion src/h3/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '3.7.0'
__version__ = '3.7.1'
__description__ = 'Hierarchical hexagonal geospatial indexing system'
__url__ = 'https://github.com/uber/h3-py'
__license__ = "Apache 2.0 License"
Expand All @@ -16,6 +16,7 @@
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
Expand Down
3 changes: 3 additions & 0 deletions src/h3/api/_api_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ def h3_distance(h1, h2):
path between the cells in the graph formed by connecting
adjacent cells.
This function will return an H3ValueError if the
cells are too far apart to compute the distance.
Parameters
----------
h1 : H3Cell
Expand Down
8 changes: 8 additions & 0 deletions tests/test_cells_and_edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ def test_distance():
assert h3.h3_distance(h, n) == 2


def test_distance_error():
h1 = '8353b0fffffffff'
h2 = '835804fffffffff'

with pytest.raises(H3ValueError):
h3.h3_distance(h1, h2)


def test_compact():

# lat/lngs for State of Maine
Expand Down

0 comments on commit fefba23

Please sign in to comment.