File: more-approx.patch

package info (click to toggle)
python-momepy 0.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 51,428 kB
  • sloc: python: 11,098; makefile: 35; sh: 11
file content (41 lines) | stat: -rw-r--r-- 1,757 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From: Colin Watson <cjwatson@debian.org>
Date: Tue, 22 Apr 2025 12:22:34 +0100
Subject: Add more pytest.approx calls

These tests failed on Debian i386, probably due to x87 excess precision:
https://bugs.debian.org/1103140

Forwarded: https://github.com/pysal/momepy/pull/698
Bug-Debian: https://bugs.debian.org/1103140
Last-Update: 2025-04-22
---
 momepy/tests/test_dimension.py | 2 +-
 momepy/tests/test_intensity.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/momepy/tests/test_dimension.py b/momepy/tests/test_dimension.py
index 0ef3a63..a8475d1 100644
--- a/momepy/tests/test_dimension.py
+++ b/momepy/tests/test_dimension.py
@@ -215,7 +215,7 @@ class TestDimensions:
             self.df_streets, self.df_buildings, heights=height, tick_length=100
         )
         assert results2.w[0] == 70.7214870365335
-        assert results2.wd[0] == 8.50508193935929
+        assert results2.wd[0] == pytest.approx(8.50508193935929)
         assert results2.h[0] == pytest.approx(23.87158296249206)
         assert results2.p[0] == pytest.approx(0.3375435664999579)
         assert results2.o[0] == 0.5769230769230769
diff --git a/momepy/tests/test_intensity.py b/momepy/tests/test_intensity.py
index caadd3f..e6f3039 100644
--- a/momepy/tests/test_intensity.py
+++ b/momepy/tests/test_intensity.py
@@ -205,7 +205,7 @@ class TestIntensity:
             nodes, edges, sw, weighted=True, node_degree="degree"
         ).series
         array = mm.NodeDensity(nodes, edges, W).series
-        assert density.mean() == 0.005534125924228438
+        assert density.mean() == pytest.approx(0.005534125924228438)
         assert weighted.mean() == pytest.approx(0.010090861332429164)
         assert array.mean() == 0.01026753724860306