File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
import h5py
2
2
from geopandas import GeoDataFrame
3
-
3
+ import json
4
4
import hashlib
5
5
from pathlib import Path
6
6
@@ -20,3 +20,8 @@ def _gdf_matches_json(gdf: GeoDataFrame, json_file: Path) -> bool:
20
20
def get_sha1_hash (path : Path ) -> str :
21
21
with open (path , "rb" ) as f :
22
22
return hashlib .sha1 (f .read ()).hexdigest ()
23
+
24
+
25
+ def _gdf_matches_json_alt (gdf : GeoDataFrame , json_file : Path ) -> bool :
26
+ with open (json_file ) as j :
27
+ return json .loads (gdf .to_json ()) == json .load (j )
Original file line number Diff line number Diff line change 7
7
8
8
from src .rashdf import RasGeomHdf
9
9
10
- from . import _create_hdf_with_group_attrs , _gdf_matches_json
10
+ from . import _create_hdf_with_group_attrs , _gdf_matches_json , _gdf_matches_json_alt
11
11
12
12
TEST_DATA = Path ("./tests/data" )
13
13
MUNCIE_G05 = TEST_DATA / "ras/Muncie.g05.hdf"
@@ -29,11 +29,6 @@ def test_projection(tmp_path):
29
29
assert ras_hdf .projection () == CRS .from_wkt (wkt )
30
30
31
31
32
- def _gdf_matches_json_alt (gdf : GeoDataFrame , json_file : Path ) -> bool :
33
- with open (json_file ) as j :
34
- return json .loads (gdf .to_json ()) == json .load (j )
35
-
36
-
37
32
def test_mesh_area_names ():
38
33
with RasGeomHdf (MUNCIE_G05 ) as ghdf :
39
34
assert ghdf .mesh_area_names () == ["2D Interior Area" , "Perimeter_NW" ]
@@ -206,6 +201,6 @@ def test_cross_sections_velocity():
206
201
assert _gdf_matches_json_alt (ghdf .cross_sections_velocity (), xs_velocity_json )
207
202
208
203
209
- def ttest_cross_sections_velocity_not_found ():
204
+ def test_cross_sections_velocity_not_found ():
210
205
with RasGeomHdf (COAL_G01 ) as ghdf :
211
206
assert (ghdf .cross_sections_velocity (), None )
You can’t perform that action at this time.
0 commit comments