Skip to content

Separate tests + General update #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/psf/black
rev: 21.6b0
rev: 23.1.0
hooks:
- id: black
language_version: python3

- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
Expand Down
6 changes: 6 additions & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
dependencies:
# Test
- pytest
- pytest-cov
14 changes: 7 additions & 7 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ channels:
- conda-forge
dependencies:
# Required
- python=3.9
- python>=3.9
- shapely
- h3-py=3.7.*
- geopandas>=0.9.*
- pandas
# For Python <3.8
# - typing_extensions
# Test
- pytest
- pytest-cov
# Notebooks
- matplotlib
# Pip
- pip
- pip:
# Installing through pip to avoid segfault on Apple Silicon
# https://github.com/uber/h3-py/issues/313
- h3==3.7.6
Empty file added tests/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions h3pandas/test_h3pandas.py → tests/test_h3pandas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import h3pandas # noqa: F401
from h3pandas import h3pandas # noqa: F401
from h3 import h3
import pytest
from shapely.geometry import Polygon, box
Expand Down Expand Up @@ -546,7 +546,7 @@ def test_polyfill_resample(h3_geodataframe_with_values):


def test_polyfill_resample_uncovered_rows(basic_geodataframe_polygons):
basic_geodataframe_polygons.loc[2] = box(0, 0, 3, 3)
basic_geodataframe_polygons.iloc[1] = box(0, 0, 3, 3)
with pytest.warns(UserWarning):
result = basic_geodataframe_polygons.h3.polyfill_resample(2)

Expand Down
Empty file added tests/util/__init__.py
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from h3 import h3
import pytest

from .decorator import catch_invalid_h3_address
from h3pandas.util.decorator import catch_invalid_h3_address


def test_catch_invalid_h3_address():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from shapely.geometry import Polygon, MultiPolygon, LineString
import pytest
from .shapely import polyfill
from h3pandas.util.shapely import polyfill


@pytest.fixture
Expand Down