aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-01-02 13:26:09 +0800
committerAaron LI <aly@aaronly.me>2018-01-02 13:26:09 +0800
commit7411504f914e66abcf6a4b700717ad398b89ff64 (patch)
tree97b34897d5b63410f4e7f2324b07a0f6abc138c9
parent60fa646f12bed8837bfb5964eedab834ea778443 (diff)
downloadfg21sim-7411504f914e66abcf6a4b700717ad398b89ff64.tar.bz2
clusters/formation: return {} instead of None if no event found
-rw-r--r--fg21sim/extragalactic/clusters/formation.py8
1 files changed, 4 insertions, 4 deletions
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