From 7411504f914e66abcf6a4b700717ad398b89ff64 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 2 Jan 2018 13:26:09 +0800 Subject: clusters/formation: return {} instead of None if no event found --- fg21sim/extragalactic/clusters/formation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fg21sim/extragalactic/clusters') diff --git a/fg21sim/extragalactic/clusters/formation.py b/fg21sim/extragalactic/clusters/formation.py index e36ee3a..2089ef8 100644 --- a/fg21sim/extragalactic/clusters/formation.py +++ b/fg21sim/extragalactic/clusters/formation.py @@ -213,7 +213,7 @@ class ClusterFormation: A dictionary with the properties of the found major event: ``{"M_main": M_main, "M_sub": M_sub, "R_mass": R_mass, "z": z, "age": age}``; - ``None`` if no major event found. + ``{}`` if no major event found. """ if mtree is None: mtree = self.mtree @@ -226,7 +226,7 @@ class ClusterFormation: "z": main["z"], "age": main["age"]} return event - return None + return {} def maximum_merger(self, mtree=None): """ @@ -242,7 +242,7 @@ class ClusterFormation: ------- event : dict Same as the above ``self.recent_major_event``. - ``None`` if no mergers occurred during the traced period. + ``{}`` if no mergers occurred during the traced period. """ if mtree is None: mtree = self.mtree @@ -258,7 +258,7 @@ class ClusterFormation: if event_max["z"] <= 0: logger.warning("No mergers occurred.") - return None + return {} else: return event_max -- cgit v1.2.2