lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
230 stars 285 forks source link

[classy] Change error message for get_current_derived_parameters() #319

Open Stefan-Heimersheim opened 4 years ago

Stefan-Heimersheim commented 4 years ago

When you call get_current_derived_parameters with a variable name instead of a list (e.g. cosmo.get_current_derived_parameters('YHe')) it just returns TypeError: Deprecated.

I propose to change this to something more helpful along the lines of TypeError: The input must be a list of parameter names. The code is in python/classy.pyx, line 1663:

    if type(names) != type([]):
        raise TypeError("Deprecated")