Skip to content

Commit

Permalink
bug(GridIntersect): fixes #916 and #917 (#918)
Browse files Browse the repository at this point in the history
* refactor(make-release): Software citation developed from version.py

Closes #727

* release: update mf6 v6.1.1 dfn and flopy mf6 classes (#1)

* docs(misc): clean up docstrings

* refactor(GridIntersect): fix error message
for unsupported methods

* bug(GridIntersect): fix #10
ensure one entry per grid cell in polygon intersection result
add test for this case

* bug(gridintersect): fixes #917

bug in structured mode where linestrings were not handled
correctly if they pass in and out of grid cell

Co-authored-by: jdhughes-usgs <jdhughes@usgs.gov>
Co-authored-by: Christian Langevin <langevin@usgs.gov>
  • Loading branch information
3 people authored Jun 23, 2020
1 parent e962e16 commit d5672f5
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 111 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

### Version 3.3.1 &mdash; release candidate
[![Build Status](https://travis-ci.org/modflowpy/flopy.svg?branch=develop)](https://travis-ci.org/modflowpy/flopy)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/3424dc693f9042ffadc93086cd554e47)](https://www.codacy.com/gh/modflowpy/flopy?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=modflowpy/flopy&amp;utm_campaign=Badge_Grade)
[![Coverage Status](https://coveralls.io/repos/github/modflowpy/flopy/badge.svg?branch=develop)](https://coveralls.io/github/modflowpy/flopy?branch=develop)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/flopy/badges/installer/conda.svg)](https://conda.anaconda.org/conda-forge)
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/flopy/badges/version.svg)](https://anaconda.org/conda-forge/flopy)
[![PyPI Version](https://img.shields.io/pypi/v/flopy.png)](https://pypi.python.org/pypi/flopy)
[![Coverage Status](https://coveralls.io/repos/github/modflowpy/flopy/badge.svg?branch=develop)](https://coveralls.io/github/modflowpy/flopy?branch=develop)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b23a5edd021b4aa19e947545ab49e577)](https://www.codacy.com/app/jdhughes-usgs/flopy?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=modflowpy/flopy&amp;utm_campaign=Badge_Grade)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/modflowpy/flopy.git/develop)

Introduction
Expand Down
16 changes: 16 additions & 0 deletions autotest/t065_test_gridintersect.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,22 @@ def test_rect_grid_polygon_with_hole_shapely(rtree=True):
return result


def test_rect_grid_polygon_in_edge_in_cell(rtree=True):
# avoid test fail when shapely not available
try:
import shapely
except:
return
gr = get_rect_grid()
ix = GridIntersect(gr, method='vertex', rtree=rtree)
p = Polygon([(0., 5.), (3., 0.), (7., 0.),
(10., 5.), (10., -1.), (0., -1.)])
result = ix.intersect_polygon(p)
assert len(result) == 1
assert result.areas.sum() == 15.
return result


def test_tri_grid_polygon_outside(rtree=True):
# avoid test fail when shapely not available
try:
Expand Down
2 changes: 1 addition & 1 deletion flopy/discretization/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Grid(object):
rotation : float
rotation angle of model grid, as it is rotated around the origin point
Properties
Attributes
----------
grid_type : enumeration
type of model grid ('structured', 'vertex_layered',
Expand Down
Loading

0 comments on commit d5672f5

Please sign in to comment.