Skip to content

camb.model.*Params attributes default to zero #50

@tilmantroester

Description

@tilmantroester

When creating a new instance of one of the camb.model.*Params classes, the attributes are set to zero by default instead of the sensible defaults in model.f90. For example, in case of camb.model.AccuracyParams:

>>> import camb
>>> acc = camb.model.AccuracyParams()
>>> print(acc)
class: <AccuracyParams>
 AccuracyBoost = 0.0
 lSampleBoost = 0.0
 lAccuracyBoost = 0.0
 AccuratePolarization = False
 AccurateBB = False
 AccurateReionization = False
 TimeStepBoost = 0.0
 BackgroundTimeStepBoost = 0.0
 IntTolBoost = 0.0
 SourcekAccuracyBoost = 0.0
 IntkAccuracyBoost = 0.0
 TransferkBoost = 0.0
 NonFlatIntAccuracyBoost = 0.0
 BessIntBoost = 0.0
 LensingBoost = 0.0
 NonlinSourceBoost = 0.0
 BesselBoost = 0.0
 LimberBoost = 0.0
 SourceLimberBoost = 0.0
 KmaxBoost = 0.0
 neutrino_q_boost = 0.0```

This then leads to obscure errors when computing anything. It would be nice if the python class gets populated with the Fortran defaults or at least that an error is thrown if not all attributes are specified.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions