Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
irgnore broken measurements (close #81)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jul 28, 2016
1 parent 11fe088 commit c7a0250
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions shapeout/gui/explorer.py
Expand Up @@ -117,7 +117,7 @@ def BoldifyData(self, data=[]):
k.SetBold(True)

def external_analyze(self, *args, **kwargs):
""" to be overwritten """
""" to be overridden """
pass

def OnAnalyze(self, e=None):
Expand Down Expand Up @@ -193,7 +193,7 @@ def SelectData(self, data=[]):
self.htreectrl.CheckItem(k)

def SetProjectTree(self, data, add=False, marked=[]):
""" Find projects in `directory` and update tree view
""" Update tree view with measurement data information
Parameters
----------
Expand Down
19 changes: 15 additions & 4 deletions shapeout/tlabwrap.py
Expand Up @@ -1232,7 +1232,7 @@ def GetTDMSTreeGUI(directories):

for f in files:
if not IsFullMeasurement(f):
# Ignore measurements that have missing camera or para inis.
# Ignore broken measurements
continue
path, name = os.path.split(f)
# try to find the path in pathdict
Expand Down Expand Up @@ -1262,15 +1262,26 @@ def IsFullMeasurement(fname):
""" Checks for existence of ini files and returns False if some
files are missing.
"""
is_ok = True
path, name = os.path.split(fname)
mx = name.split("_")[0]
stem = os.path.join(path, mx)

# Check if all config files are present
if ( (not os.path.exists(stem+"_para.ini")) or
(not os.path.exists(stem+"_camera.ini")) or
(not os.path.exists(fname)) ):
return False
else:
return True
is_ok = False

# Check if we can perform all standard file operations
for test in [GetRegion, GetFlowRate, GetEvents]:
try:
test(fname)
except:
is_ok = False
break

return is_ok


def GetDefaultConfiguration(key=None):
Expand Down

0 comments on commit c7a0250

Please sign in to comment.