Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bug: failing test_gridintersect.py #2214

Description

@martclanor

Hello devs! First of all, I'm a bit new here and I'm not really sure if I should put this up as an issue or discussion question but here it is anyway.

To Reproduce
Steps to reproduce the behavior:

When I run all the tests with pytest -v -n auto, I get this error:

FAILED test_gridintersect.py::test_linestring_offset_rot_structured_grid - AssertionError: assert 3 == 2  

Iiuc, basically, this is checking how many cells are intersected by a horizontal line on the center of this image:

horizontal_line = LineString([(5, 10.0 + np.sqrt(200.0)), (15, 10.0 + np.sqrt(200.0))])

image

The computed value on my test is 3, probably because the horizontal line's y-position is approximated to some extent and thus cannot be put exactly at the middle.

The failing line used to be an assertion statement that allows the value to either be 2 or 3 (instead of just 2) so it seems to be a deliberate change (see 40c0391#diff-6ab39ba678301b37903b1a7fe96e20267cba1b3bfeaf2977333b5774ba699bb7L1217) and I'm just not sure what the reasoning here was.

Laptop:

  • OS: win10
  • Python 3.11.9
  • flopy 3.8.0.dev0
  • shapely 2.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions