diff --git a/ChangeLog b/ChangeLog index fbd1148..4ff0772 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,10 @@ -2015-12-16 Juergen Knoedlseder +2015-12-17 Juergen Knoedlseder * Version 1.0.0 released ======================== Update end-user documentation + Change GException to RuntimeError in cscripts (#1604) Adapt to GammaLib interface changs (#1603) Implement handling of stacked data in csspec (#1566) Resolve Python test problem on El Capitan (#1563) diff --git a/NEWS b/NEWS index 9f18a39..05c5207 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ New Features and Important Changes in ctools 1.0.0 Author(s) : Juergen Knoedlseder -16 December 2015 +17 December 2015 1. Introduction @@ -111,6 +111,9 @@ requested energy binning, it selects for each spectral energy bin the relevant energy bins from the counts cube and performs a maximum likelihood analysis. +All GExceptions are replaced by Python RuntimeErrors as the GException +classes are not exposed to Python. + 20. Examples ------------ diff --git a/cscripts/csobsdef.py b/cscripts/csobsdef.py index 0c54f02..0b4a4aa 100755 --- a/cscripts/csobsdef.py +++ b/cscripts/csobsdef.py @@ -249,8 +249,7 @@ class csobsdef(ctools.cscript): pntdir = gammalib.GSkyDir() pntdir.lb_deg(lon,lat) else: - raise gammalib.GException.invalid_value(self.name, - "No (ra,dec) or (lon,lat) columns found in pointing" + raise RuntimeError("No (ra,dec) or (lon,lat) columns found in pointing" " definition file.") obs.pointing(gammalib.GCTAPointing(pntdir)) diff --git a/cscripts/cssens.py b/cscripts/cssens.py index 64f34a7..a0a12ae 100755 --- a/cscripts/cssens.py +++ b/cscripts/cssens.py @@ -241,7 +241,7 @@ class cssens(ctools.cscript): else: msg = "Invalid sensitivity type \""+self.m_type+"\" encountered."+ \ " Either use \"Differential\" or \"Integral\"." - raise gammalib.GException.invalid_value("cssens", msg) + raise RuntimeError(msg) # Determine sensitivity result = self.get_sensitivity(self.obs, emin, emax, @@ -347,7 +347,7 @@ class cssens(ctools.cscript): if not model.has_par("Prefactor"): msg = "Model \""+self.m_srcname+"\" has no parameter \"Prefactor\"."+ \ " Only spectral models with a \"Prefactor\" parameter are supported." - raise gammalib.GException.invalid_value("cssens", msg) + raise RuntimeError(msg) # Set source position if self.m_ra != None and self.m_dec != None: diff --git a/cscripts/csspec.py b/cscripts/csspec.py index 54a6349..bbe80a0 100755 --- a/cscripts/csspec.py +++ b/cscripts/csspec.py @@ -206,7 +206,7 @@ class csspec(ctools.cscript): "cube does not overlap with specified energy range ["+ \ str(emin)+", "+str(emax)+"]. Specify "+ \ "overlapping energy range." - raise gammalib.GException.invalid_argument("csspec", msg) + raise RuntimeError(msg) # Determine number of layers to use for each spectral bin n_layers = int(len(use_layers) / self.m_enumbins) diff --git a/cscripts/cstsdist.py b/cscripts/cstsdist.py index 282d2c8..c4b2b49 100755 --- a/cscripts/cstsdist.py +++ b/cscripts/cstsdist.py @@ -275,7 +275,7 @@ class cstsdist(ctools.cscript): if not model.has_par("Prefactor"): msg = "Model \""+self.m_srcname+"\" has no parameter \"Prefactor\"."+ \ " Only spectral models with a \"Prefactor\" parameter are supported." - raise gammalib.GException.invalid_value("cssens", msg) + raise RuntimeError(msg) # Fit or fix spatial parameters if fitpos: