@@ -190,6 +190,8 @@ def read_to_dict(
190190 validate : bool = True ,
191191 node_props : list [str ] | None = None ,
192192 edge_props : list [str ] | None = None ,
193+ validate_data : bool = False ,
194+ validate_optional_data : utils .ValidationConfig | None = None ,
193195) -> GraphDict :
194196 """
195197 Read a GEFF zarr file to a dictionary representation.
@@ -200,9 +202,13 @@ def read_to_dict(
200202 Args:
201203 source (str | Path | zarr store): Either a path to the root of the geff zarr
202204 (where the .attrs contains the geff metadata), or a zarr store object
203- validate (bool, optional): Flag indicating whether to perform validation on the
204- geff file before loading into memory. If set to False and there are
205- format issues, will likely fail with a cryptic error. Defaults to True.
205+ validate (bool, optional): Flag indicating whether to perform metadata/structure
206+ validation on the geff file before loading into memory. If set to False and
207+ there are format issues, will likely fail with a cryptic error. Defaults to True.
208+ validate_data (bool, optional): Flag indicating whether to perform validation on the
209+ underlying data of the geff, e.g. edges. Defaults to False.
210+ validate_optional_data (ValidationConfig, optional): Optional configuration for which
211+ optional properties to validate. Defaults to None and validation does not occur.
206212 node_props (list of str, optional): The names of the node properties to load,
207213 if None all properties will be loaded, defaults to None.
208214 edge_props (list of str, optional): The names of the edge properties to load,
@@ -218,4 +224,11 @@ def read_to_dict(
218224 file_reader .read_edge_props (edge_props )
219225
220226 graph_dict = file_reader .build ()
227+
228+ if validate_data :
229+ utils .validate_zarr_data (graph_dict )
230+
231+ if validate_optional_data is not None :
232+ utils .validate_optional_data (config = validate_optional_data , graph_dict = graph_dict )
233+
221234 return graph_dict
0 commit comments