python-osw-validation 0.2.9__py3-none-any.whl → 0.2.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,22 +107,40 @@ class OSWValidation:
107
107
  unmatched = node_ids_edges_u - node_ids
108
108
  is_valid = len(unmatched) == 0
109
109
  if not is_valid:
110
+ unmatched_list = list(unmatched)
111
+ num_unmatched = len(unmatched_list)
112
+ limit = min(num_unmatched, 20)
113
+ displayed_unmatched = ', '.join(map(str, unmatched_list[:limit]))
110
114
  self.errors.append(
111
- f"All _u_id's in edges should be part of _id's mentioned in nodes, _u_id's not in nodes are: {unmatched}")
115
+ f"All _u_id's in edges should be part of _id's mentioned in nodes. "
116
+ f"Showing {'20' if num_unmatched > 20 else 'all'} out of {len(unmatched)} unmatched _u_id's: {displayed_unmatched}"
117
+ )
112
118
 
113
119
  # Do all node references in _v_id exist in nodes?
114
120
  unmatched = node_ids_edges_v - node_ids
115
121
  is_valid = len(unmatched) == 0
116
122
  if not is_valid:
123
+ unmatched_list = list(unmatched)
124
+ num_unmatched = len(unmatched_list)
125
+ limit = min(num_unmatched, 20)
126
+ displayed_unmatched = ', '.join(map(str, unmatched_list[:limit]))
117
127
  self.errors.append(
118
- f"All _v_id's in edges should be part of _id's mentioned in nodes, _v_id's not in nodes are: {unmatched}")
128
+ f"All _v_id's in edges should be part of _id's mentioned in nodes. "
129
+ f"Showing {'20' if num_unmatched > 20 else 'all'} out of {len(unmatched)} unmatched _v_id's: {displayed_unmatched}"
130
+ )
119
131
 
120
132
  # Do all node references in _w_id exist in nodes?
121
133
  unmatched = node_ids_zones_w - node_ids
122
134
  is_valid = len(unmatched) == 0
123
135
  if not is_valid:
136
+ unmatched_list = list(unmatched)
137
+ num_unmatched = len(unmatched_list)
138
+ limit = min(num_unmatched, 20)
139
+ displayed_unmatched = ', '.join(map(str, unmatched_list[:limit]))
124
140
  self.errors.append(
125
- f"All _w_id's in zones should be part of _id's mentioned in nodes, _w_id's not in nodes are: {unmatched}")
141
+ f"All _w_id's in zones should be part of _id's mentioned in nodes. "
142
+ f"Showing {'20' if num_unmatched > 20 else 'all'} out of {len(unmatched)} unmatched _w_id's: {displayed_unmatched}"
143
+ )
126
144
 
127
145
  # Geometry validation: check geometry type in each file and test if coordinates make a shape that is reasonable geometric shape according to the Simple Feature Access standard
128
146
  for osw_file in OSW_DATASET:
@@ -131,8 +149,14 @@ class OSWValidation:
131
149
  OSW_DATASET[osw_file].is_valid == False)]
132
150
  is_valid = len(invalid_geojson) == 0
133
151
  if not is_valid:
152
+ invalid_ids = list(set(invalid_geojson['_id']))
153
+ num_invalid = len(invalid_ids)
154
+ limit = min(num_invalid, 20)
155
+ displayed_invalid = ', '.join(map(str, invalid_ids[:min(num_invalid, limit)]))
134
156
  self.errors.append(
135
- f"Invalid {osw_file} geometries found, id's of invalid geometries: {set(invalid_geojson['_id'])}")
157
+ f"Showing {'20' if num_invalid > 20 else 'all'} out of {num_invalid} invalid {osw_file} geometries, "
158
+ f"id's of invalid geometries: {displayed_invalid}"
159
+ )
136
160
 
137
161
  # Validate OSW external extensions
138
162
  for file in validator.externalExtensions:
@@ -1 +1 @@
1
- __version__ = '0.2.9'
1
+ __version__ = '0.2.10'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-osw-validation
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: Python library for OSW validation
5
5
  Home-page: https://github.com/TaskarCenterAtUW/TDEI-python-lib-osw-validation
6
6
  Author: Sujata Misra
@@ -0,0 +1,10 @@
1
+ python_osw_validation/__init__.py,sha256=c8d2PUgU89lNR5Zh4zetbKYRijcl3-SM5Aux8ycfkl0,9355
2
+ python_osw_validation/extracted_data_validator.py,sha256=wZyCk8NlJv10cj_GrRTAiwm4cBhTAeDethjzJU-amoI,3877
3
+ python_osw_validation/version.py,sha256=Sg_6D3b_dkjLywxS_G9vAU50xLvx_3hgYewd0IeIFAQ,22
4
+ python_osw_validation/zipfile_handler.py,sha256=jXnP-8O5AAOBapuNF3-XdFVM1MHiPaWpl_wlbX-aqhY,2631
5
+ python_osw_validation/schema/opensidewalks.schema.json,sha256=i0iJwb_4Tq20BVUpkpgyM_7fm4SW_d_HNXKw0xul7OA,240987
6
+ python_osw_validation-0.2.10.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
7
+ python_osw_validation-0.2.10.dist-info/METADATA,sha256=ogdQ8kOflxrhmhxTbhSNqvMDIZdP4CZ1IRb9o6gipog,6141
8
+ python_osw_validation-0.2.10.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
9
+ python_osw_validation-0.2.10.dist-info/top_level.txt,sha256=GE81UPcDHEffJCxYu3M_iPz3Dt-O3axB73R5SLm_Veo,22
10
+ python_osw_validation-0.2.10.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- python_osw_validation/__init__.py,sha256=BrVyTquf9n4-US7d_FZBNEjyh24LaucSz4Zd65v2tfw,7946
2
- python_osw_validation/extracted_data_validator.py,sha256=wZyCk8NlJv10cj_GrRTAiwm4cBhTAeDethjzJU-amoI,3877
3
- python_osw_validation/version.py,sha256=e5Klz6yLU-4Ub9zxGUBo9wADAYsST38ZylTv9ze4i60,21
4
- python_osw_validation/zipfile_handler.py,sha256=jXnP-8O5AAOBapuNF3-XdFVM1MHiPaWpl_wlbX-aqhY,2631
5
- python_osw_validation/schema/opensidewalks.schema.json,sha256=i0iJwb_4Tq20BVUpkpgyM_7fm4SW_d_HNXKw0xul7OA,240987
6
- python_osw_validation-0.2.9.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
7
- python_osw_validation-0.2.9.dist-info/METADATA,sha256=dOSaEqE-VEW2iqhkzSb27T2A72Y31AfRyuGnDlI3aqE,6140
8
- python_osw_validation-0.2.9.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
9
- python_osw_validation-0.2.9.dist-info/top_level.txt,sha256=GE81UPcDHEffJCxYu3M_iPz3Dt-O3axB73R5SLm_Veo,22
10
- python_osw_validation-0.2.9.dist-info/RECORD,,