@@ -407,6 +407,59 @@ def Get(filename, element, **kwargs):
407407 root .close ()
408408 return response
409409
410+ # Check which element are valid
411+ def CheckValidElements (filename , verbose = False ):
412+ """
413+ **CheckValidElements** - A function to check through a Loop Project File's
414+ elements to see whether there is information in each element
415+
416+ Parameters
417+ ----------
418+ filename: string
419+ The name of the file to load data from
420+ verbose: bool
421+ A flag to indicate a higher level of console logging (more if True)
422+
423+ Returns
424+ -------
425+ dict or None
426+ A dictionary of all the elements with a boolean indicating if the
427+ element contains information
428+
429+ """
430+ elements = {
431+ "version" :False ,
432+ "extents" :False ,
433+ "strModel" :False ,
434+ "faultObservations" :False ,
435+ "foldObservations" :False ,
436+ "foliationObservations" :False ,
437+ "discontinuityObservations" :False ,
438+ "stratigraphicObservations" :False ,
439+ "contacts" :False ,
440+ "drillholeObservations" :False ,
441+ "drillholeSurveys" :False ,
442+ "drillholeProperties" :False ,
443+ "stratigraphicLog" :False ,
444+ "faultLog" :False ,
445+ "foldLog" :False ,
446+ "foliationLog" :False ,
447+ "discontinuityLog" :False ,
448+ "drillholeLog" :False ,
449+ "dataCollectionConfig" :False ,
450+ "dataCollectionSources" :False ,
451+ "dataCollectionRawSourceData" :False ,
452+ "eventRelationships" :False ,
453+ "structuralModelsConfig" :False ,
454+ }
455+ if (not CheckFileIsLoopProjectFile (filename )):
456+ if (verbose ):
457+ print (f"{ filename } is not a valid loop project file" )
458+ return None
459+ else :
460+ for element in elements :
461+ elements [element ] = Get (filename , element )["errorFlag" ]
462+ return elements
410463
411464# Check full project structure
412465def CheckFileValid (filename , verbose = False ):
0 commit comments