Field_test.py
Go to the documentation of this file.
1 #==============================================================================
2 # Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 # Author: Gonzalo Mier
4 # BSD-3 License
5 #==============================================================================
6 
7 import pytest
8 import fields2cover as f2c
9 
10 def near(a, b):
11  assert pytest.approx(a) == pytest.approx(b)
12 
14  field = f2c.Field();
15  near(field.area(), 0);
16 
17  cells = f2c.Cells(f2c.Cell(f2c.LinearRing(f2c.VectorPoint(
18  [f2c.Point(0,0), f2c.Point(2,0),f2c.Point(2,2),f2c.Point(0,2), f2c.Point(0,0)]))));
19  field.setField(cells);
20  near(field.area(), 4);
21  field2 = field.clone();
22  near(field2.area(), 4);
23 
24 
Field_test.near
def near(a, b)
Definition: Field_test.py:10
Field_test.test_fields2cover_types_field_area
def test_fields2cover_types_field_area()
Definition: Field_test.py:13


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31