From e2b1a85e88e15cd01a20a1231cb76125e4963672 Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Wed, 16 Oct 2024 15:24:30 +0200 Subject: [PATCH] Add overload of length for Parameters --- NAMESPACE | 1 + R/overloads.R | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 R/overloads.R diff --git a/NAMESPACE b/NAMESPACE index f91bf88..2467fe7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,6 +12,7 @@ S3method(repr::repr_latex,pharmpy.model.distributions.symbolic.NormalDistributio S3method(repr::repr_latex,pharmpy.model.random_variables.RandomVariables) S3method(repr::repr_latex,pharmpy.model.statements.Assignment) S3method(repr::repr_latex,pharmpy.modeling.odes.ODEDisplayer) +S3method(length,pharmpy.model.parameters.Parameters) export(add_admid) export(add_allometry) export(add_bioavailability) diff --git a/R/overloads.R b/R/overloads.R new file mode 100644 index 0000000..849e1f8 --- /dev/null +++ b/R/overloads.R @@ -0,0 +1,4 @@ +#' @exportS3Method length pharmpy.model.parameters.Parameters +length.pharmpy.model.parameters.Parameters <- function(obj, ...) { + reticulate::py_len(obj) +}