Skip to content
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

Update test.yml #218

Merged
merged 6 commits into from
Feb 7, 2024
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
27 changes: 7 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,19 @@ on:
- main

jobs:
do-explore:
name: Feedback runner
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."

do-test:
name: Test on Python
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
shapely-version: ["1.8.5", "2.0"]
python-version: ["3.8", "3.10", "3.12"]
shapely-version: ["1.8", "2.0"]
exclude:
- python-version: "3.12"
shapely-version: "1.8"
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -42,7 +29,7 @@ jobs:
run: |
python -m pip install flit codecov pytest flake8
- name: Install shapely version from matrix
run: python -m pip install "shapely==${{ matrix.shapely-version }}"
run: python -m pip install "shapely~=${{ matrix.shapely-version }}"
- name: Install package dependencies
run: flit install --deps develop
- name: Lint with flake8
Expand Down
10 changes: 5 additions & 5 deletions topojson/core/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _joiner(self, data):
# presimplify linestrings if required
if self.options.presimplify > 0:
# set default if not specifically given in the options
if type(self.options.presimplify) == bool:
if isinstance(type(self.options.presimplify), bool):
simplify_factor = 2
else:
simplify_factor = self.options.presimplify
Expand All @@ -155,7 +155,7 @@ def _joiner(self, data):
# prequantize linestrings if required
if self.options.prequantize > 0:
# set default if not specifically given in the options
if type(self.options.prequantize) == bool:
if isinstance(self.options.prequantize, bool):
quant_factor = 1e5
else:
quant_factor = self.options.prequantize
Expand Down Expand Up @@ -208,15 +208,15 @@ def _get_verts(geom):

# calculate line intersections between linestrings
intersect_lines = [
linemerge_ext(geom1.intersection(geom2))
for geom1, geom2 in geom_combs
linemerge_ext(geom1.intersection(geom2)) for geom1, geom2 in geom_combs
]
intersect_lines = [line for line in intersect_lines if not line.is_empty]
intersect_lines = explode(intersect_lines)

# the start and end points of the intersect_lines are the junctions
junctions = [
junction for line in intersect_lines
junction
for line in intersect_lines
for junction in (line.coords[0], line.coords[-1])
]
# keep unique junctions
Expand Down
10 changes: 5 additions & 5 deletions topojson/core/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def toposimplify(
result = copy.deepcopy(self)

# set settings in options to override
if type(prevent_oversimplify) == bool:
if isinstance(type(prevent_oversimplify), bool):
result.options.prevent_oversimplify = prevent_oversimplify
if simplify_with in ["shapely", "simplification"]:
result.options.simplify_with = simplify_with
Expand Down Expand Up @@ -517,13 +517,13 @@ def toposimplify(
quant_factor = None
if result.options.topoquantize > 0:
# set default if not specifically given in the options
if type(result.options.topoquantize) == bool:
if isinstance(result.options.topoquantize, bool):
quant_factor = 1e5
else:
quant_factor = result.options.topoquantize
elif result.options.prequantize > 0:
# set default if not specifically given in the options
if type(result.options.prequantize) == bool:
if isinstance(result.options.prequantize, bool):
quant_factor = 1e5
else:
quant_factor = result.options.prequantize
Expand Down Expand Up @@ -602,7 +602,7 @@ def _topo(self, data):
# toposimplify linestrings if required
if self.options.toposimplify > 0:
# set default if not specifically given in the options
if type(self.options.toposimplify) == bool:
if isinstance(self.options.toposimplify, bool):
simplify_factor = 0.0001
else:
simplify_factor = self.options.toposimplify
Expand All @@ -612,7 +612,7 @@ def _topo(self, data):
# topoquantize linestrings if required
if self.options.topoquantize > 0:
# set default if not specifically given in the options
if type(self.options.topoquantize) == bool:
if isinstance(self.options.topoquantize, bool):
quant_factor = 1e5
else:
quant_factor = self.options.topoquantize
Expand Down
Loading