diff --git a/numcosmo/math/ncm_csq1d.c b/numcosmo/math/ncm_csq1d.c index e60d7783..4528ed4e 100644 --- a/numcosmo/math/ncm_csq1d.c +++ b/numcosmo/math/ncm_csq1d.c @@ -435,7 +435,6 @@ static gdouble _ncm_csq1d_eval_int_q2mnu2 (NcmCSQ1D *csq1d, NcmModel *model, con static gdouble _ncm_csq1d_eval_F1 (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); static gdouble _ncm_csq1d_eval_F2 (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); static gdouble _ncm_csq1d_eval_FN (NcmCSQ1D *csq1d, NcmModel *model, const gint n, const gdouble t); -static gdouble _ncm_csq1d_eval_unit (NcmCSQ1D *csq1d, NcmModel *model); static void ncm_csq1d_class_init (NcmCSQ1DClass *klass) @@ -515,7 +514,6 @@ ncm_csq1d_class_init (NcmCSQ1DClass *klass) klass->eval_F1 = &_ncm_csq1d_eval_F1; klass->eval_F2 = &_ncm_csq1d_eval_F2; klass->eval_FN = &_ncm_csq1d_eval_FN; - klass->eval_unit = &_ncm_csq1d_eval_unit; } static gdouble @@ -617,14 +615,6 @@ _ncm_csq1d_eval_FN (NcmCSQ1D *csq1d, NcmModel *model, const gint n, const gdoubl return 0.0; } -static gdouble -_ncm_csq1d_eval_unit (NcmCSQ1D *csq1d, NcmModel *model) -{ - g_error ("_ncm_csq1d_eval_unit: not implemented."); - - return 0.0; -} - /* State related functions */ /** @@ -1733,13 +1723,6 @@ _ncm_csq1d_J_Um (realtype t, N_Vector y, N_Vector fy, SUNMatrix J, gpointer jac_ * * Returns: $F_n$ */ -/** - * ncm_csq1d_eval_unit: (virtual eval_unit) - * @csq1d: a #NcmCSQ1D - * @model: (allow-none): a #NcmModel - * - * Returns: $F_n$ - */ static NcmCSQ1DEvolStop _ncm_csq1d_evol_adiabatic (NcmCSQ1D *csq1d, NcmModel *model, GArray *asinh_t_a, GArray *alpha_a, GArray *dgamma_a, GArray *gamma_a) diff --git a/numcosmo/math/ncm_csq1d.h b/numcosmo/math/ncm_csq1d.h index 42f6c346..97f7503c 100644 --- a/numcosmo/math/ncm_csq1d.h +++ b/numcosmo/math/ncm_csq1d.h @@ -58,7 +58,6 @@ struct _NcmCSQ1DClass gdouble (*eval_F1) (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); gdouble (*eval_F2) (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); gdouble (*eval_FN) (NcmCSQ1D *csq1d, NcmModel *model, const gint n, const gdouble t); - gdouble (*eval_unit) (NcmCSQ1D *csq1d, NcmModel *model); void (*prepare) (NcmCSQ1D *csq1d, NcmModel *model); /* Padding to allow 18 virtual functions without breaking ABI. */ @@ -188,7 +187,6 @@ NCM_INLINE gdouble ncm_csq1d_eval_dm (NcmCSQ1D *csq1d, NcmModel *model, NCM_INLINE gdouble ncm_csq1d_eval_F1 (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); NCM_INLINE gdouble ncm_csq1d_eval_F2 (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); NCM_INLINE gdouble ncm_csq1d_eval_FN (NcmCSQ1D *csq1d, NcmModel *model, const gint n, const gdouble t); -NCM_INLINE gdouble ncm_csq1d_eval_unit (NcmCSQ1D *csq1d, NcmModel *model); void ncm_csq1d_prepare (NcmCSQ1D *csq1d, NcmModel *model); @@ -289,12 +287,6 @@ ncm_csq1d_eval_FN (NcmCSQ1D *csq1d, NcmModel *model, const gint n, const gdouble return NCM_CSQ1D_GET_CLASS (csq1d)->eval_FN (csq1d, model, n, t); } -NCM_INLINE gdouble -ncm_csq1d_eval_unit (NcmCSQ1D *csq1d, NcmModel *model) -{ - return NCM_CSQ1D_GET_CLASS (csq1d)->eval_unit (csq1d, model); -} - G_END_DECLS #endif /* __GTK_DOC_IGNORE__ */ diff --git a/numcosmo/perturbations/nc_hipert_adiab.c b/numcosmo/perturbations/nc_hipert_adiab.c index c8cf850e..7d157209 100644 --- a/numcosmo/perturbations/nc_hipert_adiab.c +++ b/numcosmo/perturbations/nc_hipert_adiab.c @@ -173,7 +173,6 @@ static gdouble _nc_hipert_adiab_eval_xi (NcmCSQ1D *csq1d, NcmModel *model, const static gdouble _nc_hipert_adiab_eval_F1 (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); static gdouble _nc_hipert_adiab_eval_nu (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); static gdouble _nc_hipert_adiab_eval_m (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); -static gdouble _nc_hipert_adiab_eval_unit (NcmCSQ1D *csq1d, NcmModel *model); static void _nc_hipert_adiab_prepare (NcmCSQ1D *csq1d, NcmModel *model); @@ -197,12 +196,11 @@ nc_hipert_adiab_class_init (NcHIPertAdiabClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - csq1d_class->eval_xi = &_nc_hipert_adiab_eval_xi; - csq1d_class->eval_F1 = &_nc_hipert_adiab_eval_F1; - csq1d_class->eval_nu = &_nc_hipert_adiab_eval_nu; - csq1d_class->eval_m = &_nc_hipert_adiab_eval_m; - csq1d_class->prepare = &_nc_hipert_adiab_prepare; - csq1d_class->eval_unit = &_nc_hipert_adiab_eval_unit; + csq1d_class->eval_xi = &_nc_hipert_adiab_eval_xi; + csq1d_class->eval_F1 = &_nc_hipert_adiab_eval_F1; + csq1d_class->eval_nu = &_nc_hipert_adiab_eval_nu; + csq1d_class->eval_m = &_nc_hipert_adiab_eval_m; + csq1d_class->prepare = &_nc_hipert_adiab_prepare; } static gdouble @@ -247,15 +245,6 @@ _nc_hipert_adiab_prepare (NcmCSQ1D *csq1d, NcmModel *model) g_assert (NC_IS_HIPERT_IADIAB (model)); } -static gdouble -_nc_hipert_adiab_eval_unit (NcmCSQ1D *csq1d, NcmModel *model) -{ - NcHIPertAdiab *pa = NC_HIPERT_ADIAB (csq1d); - const gdouble k = pa->k; - - return nc_hipert_iadiab_eval_unit (NC_HIPERT_IADIAB (model)); -} - /** * nc_hipert_iadiab_eval_xi: * @iad: a #NcHIPertIAdiab diff --git a/numcosmo/perturbations/nc_hipert_em.c b/numcosmo/perturbations/nc_hipert_em.c index 36a2e1d2..89ef5e46 100644 --- a/numcosmo/perturbations/nc_hipert_em.c +++ b/numcosmo/perturbations/nc_hipert_em.c @@ -143,9 +143,6 @@ static gdouble _nc_hipert_em_eval_xi (NcmCSQ1D *csq1d, NcmModel *model, const gd static gdouble _nc_hipert_em_eval_F1 (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); static gdouble _nc_hipert_em_eval_nu (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); static gdouble _nc_hipert_em_eval_m (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); - -static gdouble _nc_hipert_em_eval_unit (NcmCSQ1D *csq1d, NcmModel *model); - static void _nc_hipert_em_prepare (NcmCSQ1D *csq1d, NcmModel *model); static void @@ -167,12 +164,11 @@ nc_hipert_em_class_init (NcHIPertEMClass *klass) 0.0, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - csq1d_class->eval_xi = &_nc_hipert_em_eval_xi; - csq1d_class->eval_F1 = &_nc_hipert_em_eval_F1; - csq1d_class->eval_nu = &_nc_hipert_em_eval_nu; - csq1d_class->eval_m = &_nc_hipert_em_eval_m; - csq1d_class->prepare = &_nc_hipert_em_prepare; - csq1d_class->eval_unit = &_nc_hipert_em_eval_unit; + csq1d_class->eval_xi = &_nc_hipert_em_eval_xi; + csq1d_class->eval_F1 = &_nc_hipert_em_eval_F1; + csq1d_class->eval_nu = &_nc_hipert_em_eval_nu; + csq1d_class->eval_m = &_nc_hipert_em_eval_m; + csq1d_class->prepare = &_nc_hipert_em_prepare; } static gdouble @@ -217,15 +213,6 @@ _nc_hipert_em_prepare (NcmCSQ1D *csq1d, NcmModel *model) g_assert (NC_IS_HIPERT_IEM (model)); } -static gdouble -_nc_hipert_em_eval_unit (NcmCSQ1D *csq1d, NcmModel *model) -{ - NcHIPertEM *pem = NC_HIPERT_EM (csq1d); - const gdouble k = pem->k; - - return nc_hipert_iem_eval_unit (NC_HIPERT_IEM (model)); -} - /** * nc_hipert_iem_eval_xi: * @iem: a #NcHIPertIEM @@ -436,7 +423,7 @@ nc_hipert_em_eval_PE_PB (NcHIPertEM *pem, NcmModel *model, const gdouble tau, gd { NcmCSQ1D *csq1d = NCM_CSQ1D (pem); NcHIPertIEM *iem = NC_HIPERT_IEM (model); - const gdouble unit = ncm_csq1d_eval_unit (csq1d, model); + const gdouble unit = nc_hipert_iem_eval_unit (iem); const gdouble m = ncm_csq1d_eval_m (csq1d, model, tau); const gdouble k = pem->k; const gdouble x = nc_hipert_iem_eval_x (iem, tau); diff --git a/numcosmo/perturbations/nc_hipert_gw.c b/numcosmo/perturbations/nc_hipert_gw.c index 96ef1da2..356b1f18 100644 --- a/numcosmo/perturbations/nc_hipert_gw.c +++ b/numcosmo/perturbations/nc_hipert_gw.c @@ -143,7 +143,6 @@ static gdouble _nc_hipert_gw_eval_xi (NcmCSQ1D *csq1d, NcmModel *model, const gd static gdouble _nc_hipert_gw_eval_F1 (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); static gdouble _nc_hipert_gw_eval_nu (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); static gdouble _nc_hipert_gw_eval_m (NcmCSQ1D *csq1d, NcmModel *model, const gdouble t); -static gdouble _nc_hipert_gw_eval_unit (NcmCSQ1D *csq1d, NcmModel *model); static void _nc_hipert_gw_prepare (NcmCSQ1D *csq1d, NcmModel *model); static void @@ -165,12 +164,11 @@ nc_hipert_gw_class_init (NcHIPertGWClass *klass) 0.0, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)); - csq1d_class->eval_xi = &_nc_hipert_gw_eval_xi; - csq1d_class->eval_F1 = &_nc_hipert_gw_eval_F1; - csq1d_class->eval_nu = &_nc_hipert_gw_eval_nu; - csq1d_class->eval_m = &_nc_hipert_gw_eval_m; - csq1d_class->prepare = &_nc_hipert_gw_prepare; - csq1d_class->eval_unit = &_nc_hipert_gw_eval_unit; + csq1d_class->eval_xi = &_nc_hipert_gw_eval_xi; + csq1d_class->eval_F1 = &_nc_hipert_gw_eval_F1; + csq1d_class->eval_nu = &_nc_hipert_gw_eval_nu; + csq1d_class->eval_m = &_nc_hipert_gw_eval_m; + csq1d_class->prepare = &_nc_hipert_gw_prepare; } static gdouble @@ -215,15 +213,6 @@ _nc_hipert_gw_prepare (NcmCSQ1D *csq1d, NcmModel *model) g_assert (NC_IS_HIPERT_IGW (model)); } -static gdouble -_nc_hipert_gw_eval_unit (NcmCSQ1D *csq1d, NcmModel *model) -{ - NcHIPertGW *pgw = NC_HIPERT_GW (csq1d); - const gdouble k = pgw->k; - - return nc_hipert_igw_eval_unit (NC_HIPERT_IGW (model)); -} - /** * nc_hipert_igw_eval_xi: * @igw: a #NcHIPertIGW diff --git a/numcosmo_py/ncm.pyi b/numcosmo_py/ncm.pyi index 768a16d7..5f8762e0 100644 --- a/numcosmo_py/ncm.pyi +++ b/numcosmo_py/ncm.pyi @@ -1149,7 +1149,6 @@ class CSQ1D(GObject.Object): def do_eval_m(self, model: Optional[Model], t: float) -> float: ... def do_eval_nu(self, model: Optional[Model], t: float) -> float: ... def do_eval_nu2(self, model: Optional[Model], t: float) -> float: ... - def do_eval_unit(self, model: Optional[Model] = None) -> float: ... def do_eval_xi(self, model: Optional[Model], t: float) -> float: ... def do_prepare(self, model: Optional[Model] = None) -> None: ... def eval_F1(self, model: Optional[Model], t: float) -> float: ... @@ -1167,7 +1166,6 @@ class CSQ1D(GObject.Object): def eval_m(self, model: Optional[Model], t: float) -> float: ... def eval_nu(self, model: Optional[Model], t: float) -> float: ... def eval_nu2(self, model: Optional[Model], t: float) -> float: ... - def eval_unit(self, model: Optional[Model] = None) -> float: ... def eval_xi(self, model: Optional[Model], t: float) -> float: ... def evolve_prop_vector( self, @@ -1235,7 +1233,6 @@ class CSQ1DClass(GObject.GPointer): eval_F1: Callable[[CSQ1D, Optional[Model], float], float] = ... eval_F2: Callable[[CSQ1D, Optional[Model], float], float] = ... eval_FN: Callable[[CSQ1D, Optional[Model], int, float], float] = ... - eval_unit: Callable[[CSQ1D, Optional[Model]], float] = ... prepare: Callable[[CSQ1D, Optional[Model]], None] = ... padding: list[None] = ... diff --git a/tests/test_py_powspec_spline2d.py b/tests/test_py_powspec_spline2d.py index 8adfd9f2..bbba3e1f 100644 --- a/tests/test_py_powspec_spline2d.py +++ b/tests/test_py_powspec_spline2d.py @@ -119,6 +119,23 @@ def _evec(z): assert_allclose(ps_Pka, fa) +def test_get_spline2d(Pk2d: Ncm.Spline2d) -> None: + """Test the getter of the power spectrum.""" + ps = Ncm.PowspecSpline2d.new(Pk2d) + + assert ps is not None + + s2d = ps.peek_spline2d() + + assert s2d is not None + assert s2d == Pk2d + + sd2 = ps.get_spline_2d() + + assert sd2 is not None + assert sd2 == Pk2d + + def test_serialization(Pk2d: Ncm.Spline2d) -> None: """Test the serialization of the power spectrum."""