From d319b65d07ae82bb37822b90a91f6447fb750e85 Mon Sep 17 00:00:00 2001 From: Frederic Perez Date: Thu, 2 Apr 2020 15:16:18 +0200 Subject: [PATCH] deprecated warnings --- src/Python/pyinit.py | 24 ++++++++++++++++--- ...date_tst1d_18_radiation_spectrum_chi0.1.py | 16 ++++++------- ...date_tst2d_10_multiphoton_Breit_Wheeler.py | 16 ++++++------- ...te_tst2d_v_10_multiphoton_Breit_Wheeler.py | 16 ++++++------- 4 files changed, 45 insertions(+), 27 deletions(-) diff --git a/src/Python/pyinit.py b/src/Python/pyinit.py index bf99e841e..48f71d613 100755 --- a/src/Python/pyinit.py +++ b/src/Python/pyinit.py @@ -72,12 +72,30 @@ def _fillObjectAndAddToList(self, cls, obj, **kwargs): # add all kwargs as internal class variables if kwargs is not None: deprecated = { - "chipa_radiation_threshold":"minimum_chi_continuous", - "chipa_disc_min_threshold":"minimum_chi_discontinuous", + "output_format":"See documentation for radiation reaction", + "h_chipa_min":"See documentation for radiation reaction", + "h_chipa_max":"See documentation for radiation reaction", + "h_dim":"See documentation for radiation reaction", + "h_computation_method":"See documentation for radiation reaction", + "integfochi_chipa_min":"See documentation for radiation reaction", + "integfochi_chipa_max":"See documentation for radiation reaction", + "integfochi_dim":"See documentation for radiation reaction", + "xip_chipa_min":"See documentation for radiation reaction", + "xip_chipa_max":"See documentation for radiation reaction", + "xip_power":"See documentation for radiation reaction or Breit-Wheeler", + "xip_threshold":"See documentation for radiation reaction or Breit-Wheeler", + "xip_chipa_dim":"See documentation for radiation reaction or Breit-Wheeler", + "xip_chiph_dim":"See documentation for radiation reaction or Breit-Wheeler", + "compute_table":"See documentation for Breit-Wheeler", + "T_chiph_min":"See documentation for Breit-Wheeler", + "T_chiph_max":"See documentation for Breit-Wheeler", + "T_dim":"See documentation for Breit-Wheeler", + "xip_chiph_min":"See documentation for Breit-Wheeler", + "xip_chiph_max":"See documentation for Breit-Wheeler", } for key, value in kwargs.items(): if key in deprecated: - raise Exception("Deprecated `"+key+"` parameter should be replaced by `"+deprecated[key]+"`") + raise Exception("Deprecated `"+key+"` parameter. "+deprecated[key]) if key=="_list": print("Python warning: in "+cls.__name__+": cannot have argument named '_list'. Discarding.") elif not hasattr(cls, key): diff --git a/validation/analyses/validate_tst1d_18_radiation_spectrum_chi0.1.py b/validation/analyses/validate_tst1d_18_radiation_spectrum_chi0.1.py index 9863483f8..0f0c0f082 100644 --- a/validation/analyses/validate_tst1d_18_radiation_spectrum_chi0.1.py +++ b/validation/analyses/validate_tst1d_18_radiation_spectrum_chi0.1.py @@ -113,14 +113,14 @@ def g(chi): Prad_MC = np.sum(integrand) # Compare -print "chi0 = ", chi0 -print "g(chi0) = ", g(chi0) -print "Prad (theory) = ", Prad_tot -print "Prad (noRR) = ", Prad_noRR -print "Prad (LL) = ", Prad_LL -print "Prad (cLL) = ", Prad_cLL -print "Prad (FP) = ", Prad_FP -print "Prad (MC) = ", Prad_MC +print( "chi0 = ", chi0) +print( "g(chi0) = ", g(chi0)) +print( "Prad (theory) = ", Prad_tot) +print( "Prad (noRR) = ", Prad_noRR) +print( "Prad (LL) = ", Prad_LL) +print( "Prad (cLL) = ", Prad_cLL) +print( "Prad (FP) = ", Prad_FP) +print( "Prad (MC) = ", Prad_MC) Validate("Prad (noRR)",Prad_noRR, 1.e-6*Prad_noRR) Validate("Prad (LL)", Prad_LL, 1.e-6*Prad_LL ) diff --git a/validation/analyses/validate_tst2d_10_multiphoton_Breit_Wheeler.py b/validation/analyses/validate_tst2d_10_multiphoton_Breit_Wheeler.py index d1d9bec42..2cd8cc454 100755 --- a/validation/analyses/validate_tst2d_10_multiphoton_Breit_Wheeler.py +++ b/validation/analyses/validate_tst2d_10_multiphoton_Breit_Wheeler.py @@ -45,14 +45,14 @@ ntot_positron = np.array(S.Scalar("Ntot_positron").get()["data"]) ntot_photon = np.array(S.Scalar("Ntot_photon").get()["data"]) -print ' Final electron energy / total energy: ',ukin_electron[-1] / utot[0] -print ' Final positron energy / total energy: ',ukin_positron[-1] / utot[0] -print ' Final photon energy / total energy: ',ukin_photon[-1] / utot[0] -print ' Maximal relative error total energy: ', max(abs(utot[:] - utot[0]))/utot[0] - -print ' Final number of electrons:',ntot_electron[-1] -print ' Final number of positrons: ',ntot_positron[-1] -print ' Final number of photons: ',ntot_photon[-1] +print( ' Final electron energy / total energy: ',ukin_electron[-1] / utot[0] ) +print( ' Final positron energy / total energy: ',ukin_positron[-1] / utot[0] ) +print( ' Final photon energy / total energy: ',ukin_photon[-1] / utot[0] ) +print( ' Maximal relative error total energy: ', max(abs(utot[:] - utot[0]))/utot[0] ) + +print( ' Final number of electrons:',ntot_electron[-1] ) +print( ' Final number of positrons: ',ntot_positron[-1] ) +print( ' Final number of photons: ',ntot_photon[-1] ) Validate("Electron kinetic energy evolution: ", ukin_electron/utot[0], 1e-2 ) Validate("Positron kinetic energy evolution: ", ukin_positron/utot[0], 2e-2 ) diff --git a/validation/analyses/validate_tst2d_v_10_multiphoton_Breit_Wheeler.py b/validation/analyses/validate_tst2d_v_10_multiphoton_Breit_Wheeler.py index d1d9bec42..2cd8cc454 100755 --- a/validation/analyses/validate_tst2d_v_10_multiphoton_Breit_Wheeler.py +++ b/validation/analyses/validate_tst2d_v_10_multiphoton_Breit_Wheeler.py @@ -45,14 +45,14 @@ ntot_positron = np.array(S.Scalar("Ntot_positron").get()["data"]) ntot_photon = np.array(S.Scalar("Ntot_photon").get()["data"]) -print ' Final electron energy / total energy: ',ukin_electron[-1] / utot[0] -print ' Final positron energy / total energy: ',ukin_positron[-1] / utot[0] -print ' Final photon energy / total energy: ',ukin_photon[-1] / utot[0] -print ' Maximal relative error total energy: ', max(abs(utot[:] - utot[0]))/utot[0] - -print ' Final number of electrons:',ntot_electron[-1] -print ' Final number of positrons: ',ntot_positron[-1] -print ' Final number of photons: ',ntot_photon[-1] +print( ' Final electron energy / total energy: ',ukin_electron[-1] / utot[0] ) +print( ' Final positron energy / total energy: ',ukin_positron[-1] / utot[0] ) +print( ' Final photon energy / total energy: ',ukin_photon[-1] / utot[0] ) +print( ' Maximal relative error total energy: ', max(abs(utot[:] - utot[0]))/utot[0] ) + +print( ' Final number of electrons:',ntot_electron[-1] ) +print( ' Final number of positrons: ',ntot_positron[-1] ) +print( ' Final number of photons: ',ntot_photon[-1] ) Validate("Electron kinetic energy evolution: ", ukin_electron/utot[0], 1e-2 ) Validate("Positron kinetic energy evolution: ", ukin_positron/utot[0], 2e-2 )