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

Commit

Permalink
Changes per CR #207
Browse files Browse the repository at this point in the history
  • Loading branch information
jamespjh committed Mar 27, 2012
1 parent 5542ea1 commit 4a2005b
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions Tools/analysis/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,39 @@ def xml_loader(path):
raise ParseError("Could not parse file.")
def stat_loader(path):
return os.stat(path)


def geometry_header_loader(path):
from hemeTools.parsers.geometry.simple import ConfigLoader
class GeometryHeader:
def __init__(self,path):
self.model=ConfigLoader(path)
self.model._LoadPreamble()
self.model._LoadHeader()
self.domain=self.model.Domain
class GeometryHeaderParsedException(BaseException):
"""Inherit from BaseException as this isn't really an error,
a la GeneratorExit."""

pass

class GeometryHeader(ConfigLoader):
def OnEndHeader(self):
# Abort
raise GeometryHeaderParsedException
def Load(self):
try:
ConfigLoader.Load(self)
except GeometryHeaderParsedException:
pass
return
@property
def site_count(self):
return sum(self.domain.BlockFluidSiteCounts)
return sum(self.Domain.BlockFluidSiteCounts)
@property
def block_size(self):
return self.domain._BlockSize
return self.Domain.BlockSize
@property
def block_count(self):
return len(self.domain.Blocks)
return GeometryHeader(path)
return len(self.Domain.Blocks)
pass
gh = GeometryHeader(path)
gh.Load()
return gh

def null_filter(result):
return None
Expand Down

0 comments on commit 4a2005b

Please sign in to comment.