From f775df831079e105601afa3e99ab9d8a6827d81b Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 20 Feb 2015 10:28:07 +0100 Subject: [PATCH] Add some small annotation to runtime error. Most likely reason is 'doublePrecision' setting --- python/_cosmotool.pyx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/_cosmotool.pyx b/python/_cosmotool.pyx index 3e58ffb..366238f 100644 --- a/python/_cosmotool.pyx +++ b/python/_cosmotool.pyx @@ -538,9 +538,12 @@ def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision = if loadId: flags |= NEED_GADGET_ID - data = loadRamsesSimu(basepath, snapshot_id, cpu_id, doublePrecision, flags) - if data == 0: - return None + try: + data = loadRamsesSimu(basepath, snapshot_id, cpu_id, doublePrecision, flags) + if data == 0: + return None + except RuntimeError as e: + raise RuntimeError(e.message + ' (check the float precision in snapshot)') return PySimulationAdaptor(wrap_simudata(data, flags))