Skip to content

Commit

Permalink
remove deprecated elements of the C API
Browse files Browse the repository at this point in the history
  • Loading branch information
kingaa committed Dec 5, 2023
1 parent 99a32b3 commit 86b7d58
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 28 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: pomp
Type: Package
Title: Statistical Inference for Partially Observed Markov Processes
Version: 5.5.0.0
Date: 2023-12-02
Version: 5.5.1.0
Date: 2023-12-05
Authors@R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa@umich.edu",comment=c(ORCID="0000-0001-6159-3207")),
person(given=c("Edward","L."),family="Ionides",role="aut",comment=c(ORCID="0000-0002-4190-0174")) ,
person(given="Carles",family="Bretó",role="aut",comment=c(ORCID="0000-0003-4695-4902")),
Expand Down
7 changes: 7 additions & 0 deletions inst/NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
_N_e_w_s _f_o_r _p_a_c_k_a_g_e '_p_o_m_p'

_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _5._5._1:

• C-level functions ‘set_pomp_userdata’ and
‘unset_pomp_userdata’ are no longer exported.

• ‘bspline_eval’ is no longer exported.

_C_h_a_n_g_e_s _i_n '_p_o_m_p' _v_e_r_s_i_o_n _5._4._4:

• C-level functions ‘set_pomp_userdata’ and
Expand Down
6 changes: 6 additions & 0 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
\name{NEWS}
\title{News for package `pomp'}
\section{Changes in \pkg{pomp} version 5.5.1}{
\itemize{
\item C-level functions \code{set_pomp_userdata} and \code{unset_pomp_userdata} are no longer exported.
\item \code{bspline_eval} is no longer exported.
}
}
\section{Changes in \pkg{pomp} version 5.4.4}{
\itemize{
\item C-level functions \code{set_pomp_userdata} and \code{unset_pomp_userdata} have been temporarily restored.
Expand Down
6 changes: 0 additions & 6 deletions inst/include/pomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ void periodic_bspline_basis_eval_deriv_t
(double x, double period, int degree,
int nbasis, int deriv, double *y);

// The following is deprecated and will be removed from the API.
typedef
void bspline_eval_t
(double *y, const double *x, int nx, int i, int p,
int d, const double *knots);

typedef const SEXP get_userdata_t (const char *name);
typedef const int *get_userdata_int_t (const char *name);
typedef const double *get_userdata_double_t (const char *name);
Expand Down
5 changes: 3 additions & 2 deletions src/bspline.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
// B-spline of given degree with given knots at each of the nx points in x.
// knots must point to an array of length nbasis+degree+1
// The results are stored in y.
void bspline_eval (double *y, const double *x, int nx, int i,
int degree, int deriv, const double *knots)
static void bspline_eval
(double *y, const double *x, int nx, int i,
int degree, int deriv, const double *knots)
{
int j;
if (deriv > degree) {
Expand Down
2 changes: 0 additions & 2 deletions src/decls.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* src/bspline.c */
extern void bspline_eval(double *y, const double *x, int nx, int i, int degree, int deriv, const double *knots);
extern SEXP bspline_basis(SEXP range, SEXP x, SEXP nbasis, SEXP degree, SEXP deriv);
extern SEXP periodic_bspline_basis(SEXP x, SEXP nbasis, SEXP degree, SEXP period, SEXP deriv);
extern void bspline_basis_eval_deriv(double x, double *knots, int degree, int nbasis, int deriv, double *y);
Expand Down Expand Up @@ -112,7 +111,6 @@ extern SEXP set_pomp_userdata(SEXP userdata);
extern const SEXP get_userdata(const char *name);
extern const int *get_userdata_int(const char *name);
extern const double *get_userdata_double(const char *name);
extern void unset_pomp_userdata(void);
/* src/vmeasure.c */
extern SEXP do_vmeasure(SEXP object, SEXP x, SEXP times, SEXP params, SEXP gnsi);
/* src/wpfilter.c */
Expand Down
4 changes: 0 additions & 4 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void R_init_pomp (DllInfo *info) {
// C functions provided for users
R_RegisterCCallable("pomp","bspline_basis_eval_deriv",(DL_FUNC) &bspline_basis_eval_deriv);
R_RegisterCCallable("pomp","periodic_bspline_basis_eval_deriv",(DL_FUNC) &periodic_bspline_basis_eval_deriv);
R_RegisterCCallable("pomp","bspline_eval",(DL_FUNC) &bspline_eval); /* DEPRECATED */
R_RegisterCCallable("pomp","get_userdata",(DL_FUNC) &get_userdata);
R_RegisterCCallable("pomp","get_userdata_int",(DL_FUNC) &get_userdata_int);
R_RegisterCCallable("pomp","get_userdata_double",(DL_FUNC) &get_userdata_double);
Expand All @@ -69,9 +68,6 @@ void R_init_pomp (DllInfo *info) {
R_RegisterCCallable("pomp","apply_probe_sim",(DL_FUNC) &apply_probe_sim);
R_RegisterCCallable("pomp","systematic_resampling",(DL_FUNC) &systematic_resampling);
R_RegisterCCallable("pomp","randwalk_perturbation", (DL_FUNC) &randwalk_perturbation);
// THE FOLLOWING TWO FUNCTIONS WILL GO AWAY SOON
R_RegisterCCallable("pomp","set_pomp_userdata",(DL_FUNC) &set_pomp_userdata);
R_RegisterCCallable("pomp","unset_pomp_userdata",(DL_FUNC) &unset_pomp_userdata);

// Register routines
R_registerRoutines(info,NULL,callMethods,NULL,NULL);
Expand Down
6 changes: 0 additions & 6 deletions src/pomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ void periodic_bspline_basis_eval_deriv_t
(double x, double period, int degree,
int nbasis, int deriv, double *y);

// The following is deprecated and will be removed from the API.
typedef
void bspline_eval_t
(double *y, const double *x, int nx, int i, int p,
int d, const double *knots);

typedef const SEXP get_userdata_t (const char *name);
typedef const int *get_userdata_int_t (const char *name);
typedef const double *get_userdata_double_t (const char *name);
Expand Down
6 changes: 0 additions & 6 deletions src/userdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,3 @@ const double *get_userdata_double (const char *name) {
if (!isReal(elt)) err("user-data element '%s' is not a numeric vector.",name);
return REAL(elt);
}

// WILL GO AWAY SOON
void unset_pomp_userdata (void) { // #nocov
warn("'unset_pomp_userdata' is now deprecated and will be removed in a future release."); // #nocov
USERDATA = R_NilValue; // #nocov
}

0 comments on commit 86b7d58

Please sign in to comment.