Address comments from @cjosey on #890

This commit is contained in:
Paul Romano 2017-05-31 21:00:01 -05:00
parent 8b6abad60e
commit c24d32b5cd
3 changed files with 13 additions and 5 deletions

View file

@ -103,7 +103,7 @@ class Cell(object):
self._rotation_matrix = None
self._temperature = None
self._translation = None
self._paths = []
self._paths = None
self._num_instances = None
self._volume = None
self._atoms = None
@ -215,7 +215,7 @@ class Cell(object):
@property
def paths(self):
if not self._paths:
if self._paths is None:
raise ValueError('Cell instance paths have not been determined. '
'Call the Geometry.determine_paths() method.')
return self._paths
@ -230,6 +230,10 @@ class Cell(object):
@property
def num_instances(self):
if self._num_instances is None:
raise ValueError(
'Number of cell instances have not been determined. Call the '
'Geometry.determine_paths() method.')
return self._num_instances
@id.setter

View file

@ -491,7 +491,7 @@ class Geometry(object):
Parameters
----------
instances_only : bool
instances_only : bool, optional
If true, this method will only determine the number of instances of
each cell and material.

View file

@ -97,7 +97,7 @@ class Material(object):
self._density = None
self._density_units = ''
self._depletable = False
self._paths = []
self._paths = None
self._num_instances = None
self._volume = None
self._atoms = {}
@ -210,13 +210,17 @@ class Material(object):
@property
def paths(self):
if not self._paths:
if self._paths is None:
raise ValueError('Material instance paths have not been determined. '
'Call the Geometry.determine_paths() method.')
return self._paths
@property
def num_instances(self):
if self._num_instances is None:
raise ValueError(
'Number of material instances have not been determined. Call '
'the Geometry.determine_paths() method.')
return self._num_instances
@property