From dfe7a0026ab9b6e79e10798922de4d70f46f2d61 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Mon, 9 May 2016 09:26:25 -0400 Subject: [PATCH] Fixed indentation and added error message for unlinked Summary file with distribcell paths in DataFrame --- openmc/filter.py | 6 ++++++ openmc/mgxs/mgxs.py | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index 01f2ad2013..aab0fc0812 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -629,6 +629,12 @@ class Filter(object): # Create Pandas Multi-index columns for each level in CSG tree if distribcell_paths: + # Distribcell paths require linked metadata from the Summary + if self.distribcell_paths is None: + msg = 'Unable to construct distribcell paths since ' + 'the Summary is not linked to the StatePoint' + raise ValueError(msg) + # Make copy of array of distribcell paths to use in # Pandas Multi-index column construction distribcell_paths = copy.deepcopy(self.distribcell_paths) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 99a3d8bfe8..3133db0473 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -2576,9 +2576,11 @@ class Chi(MGXS): xs_type: {'macro', 'micro'} Return macro or micro cross section in units of cm^-1 or barns. Defaults to 'macro'. - distribcell_paths : list of str - The paths traversed through the CSG tree to reach each distribcell - instance (for 'distribcell' filters only) + distribcell_paths : bool, optional + Construct columns for distribcell tally filters (default is True). + The geometric information in the Summary object is embedded into + a Multi-index column with a geometric "path" to each distribcell + instance. Returns -------