Releases: metrumresearchgroup/mrgsolve
mrgsolve 2.0.0
Breaking Changes
-
data_set()andidata_set()no longer accept.subset,.select,
object, orneedarguments. These arguments allowed filtering and
column selection inside the call; that processing should now be done on the
data frame before passing it todata_set()oridata_set(). (#1374) -
The
nargument tosimeta()andsimeps()has been discouraged for a
while and is now removed. Callingsimeta(n)orsimeps(n)to resimulate
a single ETA or EPS value is no longer supported. Usesimeta()orsimeps()
(no argument) to resimulate all values. (#1373) -
knobs(),wf_sweep(), andrender()have been removed. These
functions were previously deprecated. (#1369) -
The default value of
rootin$NMXMLand$NMEXThas changed from
"working"to"cppfile". The root directory for locating NONMEM
output files now defaults to the directory containing the model.cppfile
rather than the R working directory. Passroot = "working"to restore the
previous behavior; but users are highly encouraged to use the new default.
(#1368) -
summarise.each()is removed; it has not been practically reachable by the
user for several years (#1352). -
Several
modlibmodel library models have had parameter and compartment
names standardized (#1361):- The first extravascular compartment is now named
EV(wasEV1) in
pk1cmt,pk2cmt,irm1-irm4, andemax. - The first absorption rate constant is now named
KA(wasKA1) in
models that previously used numbered names. - Code that references these compartments or parameters by name (e.g.,
init(mod, EV1 = 0)orparam(mod, KA1 = 1)) will need to be updated. - We continue to discourage users from using these models in production
code.
- The first extravascular compartment is now named
New Features
-
Models can now use
a ** bsyntax to representpow(a, b); this syntax is
always available, without need to invoke a plugin (#1360). -
With the
nm-varsplugin, mrgsolve now recognizes NONMEM / Fortran
IF / ELSE / THENstatements; this code can be left in your model and
mrgsolve will convert to appropriate C++ under the hood (#1360). -
ERR(n)is now recognized as an alias forEPS(n)when using thenm-vars
plugin (#1367). -
New DSL preprocessing functions convert NONMEM/Fortran model code to
mrgsolve / C++ syntax (#1360, #1362, #1366):convert_pow()converts Fortran**exponentiation topow().convert_fort_if()converts FortranIF/THEN/ELSE/END IFblocks to C++
if/elsesyntax.convert_semicolons()inserts missing trailing semicolons on assignment
statements.- RStudio addins are provided to allow conversion of certain NONMEM source
code blocks to mrgsolve format in the RStudio editor window.
-
Closed-form three-compartment linear models with or without depot compartments
can now be implemented via$PKMODEL(#1345). -
$PKMODELgains anadvaninput for selecting 1, 2, or 3 compartment
models with analytical solutions; for example, settingadvanto 2, 4,
or 12 will give you 1, 2, or 3 compartment model in closed form with a
depot compartment. Whenadvanis specified, compartments with standard
names are automatically registered if neither$INITnor$CMTare
found in the model file and no compartments are registered at the time
that$PKMODELis processed (#1345). -
Two new
modlibmodels,pk3andpk3iv, provide the corresponding
pre-coded model files (#1345). -
mrgx::assign()is now available in themrgxplugin; this is a convenience
function to help you get R objects from your model code back to R when the
simulation finishes (#1353). -
The
plot()method formrgsimsobjects gains afixyargument to fix the
y-axis limits across panels in the plot (#1349). -
Users can now find
plot()method documentation through?plot(#1349). -
env_get()refactored to allow access of R objects inside the model
environment similar tobase::get();env_get_obj()is an alias toenv_get(),
analogous toenv_get_env()(#1355).
Bugs Fixed
- Fixed a bug where the model row counter was not correct when a simulation
was performed with only an idata set (#1351).
mrgsolve 1.8.0
-
mrgsolve now requires R >= 4.1 (#1333).
-
FINAL_ROWandFINAL_IROWmacros are now available to indicate when the
simulation is processing the final output record for the whole problem or for
the current individual, respectively; both macros are reserved words
(#1328, #1327).
Bugs Fixed
-
Fixed S3 registration of the
all.equalmethod (#1337). -
custom_rtol()andcustom_atol()now return without error when called with
no tolerance inputs (#1321, #1336). -
Row counters (
self.rown,self.nrow,self.irown,self.inrow) now only
update when the system advances to an output record; previously, non-output
records between output records could cause the counters to misrepresent the
current position in the output (#1323).
Internal
-
Model parameter and compartment aliases in generated C++ code now use scoped
reference variables rather than preprocessor#definedirectives (#1332).- During this refactor, it was noted that model parameters were mutable
in$TABLE(and$EVENT), against the intention for the parameter
vector. This vector continues to be mutable in these blocks, but plans will
be made to fix this behavior in the future.
- During this refactor, it was noted that model parameters were mutable
-
Initialze
Selfto null pointer inevt::regimenobjects (#1329). -
Refactor
mat2df()(C++) for efficiency, avoiding Rcpp sugar (#1316).
mrgsolve 1.7.2
- An individual record counter has been added. Use
self.inrowto get the number of
output rows for the current individual; useself.irownto get the zero-indexed row
number for the current individual; these are similar toself.nrowandself.rown,
which count records for the entire output data set (#1313).
Bugs Fixed
- The
codeargument tomcode()now accepts a character vector with length
greater than 1; passing multiple lines previously caused a compile error (#1310).
mrgsolve 1.7.1
- The 1.7.0 release added safety checks to help users avoid an unintentional
mismatch between model code and data set. These checks now signal a warning
instead of an error to give downstream tools that use mrgsolve more
flexibility in how they adjust to the checks (#1307).
mrgsolve 1.7.0
- Safety checks added to avoid unintentional mismatch between model code and
data set when infusion duration (Dn) or rate (Rn) are modeled in
$PK(#1304).- If there is a positive infusion duration in the model (e.g.,
D1
in$PK) and data set rate is not -2 on a dosing record, an error will be
issued. If there is a positive infusion rate in the model (e.g.,R1
in$PK) and data set rate is not -1 on a dosing record, a similar error
will be issued (check direction: model to data set). - These checks are in addition to existing behavior that issued an error
when rate was -1 or -2 in the data andR1orD1were not set to a
positive value in the model (the opposite check direction: data set to
model). - Original behavior can be restored by turning off these checks either by a
block option (@!check_modeled_infusions) on$PKor through the
CHECK_MODELED_INFUSIONSmacro available in$PREAMBLEonly.
- If there is a positive infusion duration in the model (e.g.,
mrgsolve 1.6.1
- Internal refactor of
self.mevent()andself.mtime()to not send event
objects back to mrgsolve when the requested object time is in the past; this
preserves previous functionality while respecting change in1.6.0that
generates an error for events (or event sequences) that happen or begin in
the past (#1297).
mrgsolve 1.6.0
-
evt::tgrid()was added to theevtoolsplugin, allowing users to insert
internal-only (non-output) records into the simulation for
monitoring the system at a regular grid of times (#1291). -
evt::evid()was added to theevtoolsplugin allowing users
to reset the event ID attribute of event objects created inside a model (#1291). -
EVIDbehavior was changed so that event IDs greater than or equal to 100
do not trigger a reset of the ODE solver, functioning like observation records
withEVID=0; forEVID < 100, a discontinuity will continue to happen through
ODE solver reset (#1291). -
Event objects created in the model (typically through the
evtoolsplugin) will
now trigger an error when the event or event sequence starts before the
current simulation time; these events were previously ignored silently
(#1291). -
Absolute (
atol) and relative (rtol) tolerances can now be customized for each
compartment in an ODE-based model (#1264)- Use
custom_rtol(),custom_atol(), andcustom_tol()to set tolerances
on a compartment-by-compartment basis. - Use
reset_rtol(),reset_atol(), orreset_tol()to reset custom
tolerances. - Use
use_custom_tol()anduse_scalar_tol()to toggle the model to use
either the customized (vector) values or the scalar values. - Use
get_tol()orget_tol_list()to extract both custom and scalar
tolerance values. - The model print method has been updated to reflect whether the model is
currently set to use the scalar or customized (vector) values.
- Use
Bugs Fixed
mrgsolve 1.5.3
-
D_CMT,ALAG_CMT, andsimeta()are now available to use in$TABLE
($ERROR),$EVENT, and$PREDcode blocks (#1290). -
Added
END_OF_INFUSIONsyntax, which istrueon the internal record that
stops an infusion (#1288). -
mwrite_yaml()andmwrite_cpp()now render block names in upper case,
even for blocks coded with lower case in the original model file (#1282). -
When creating an
evt::regimenobject (viaevtoolsplugin), the default
start time is now the time when the object was created; before this change,
the default time was always0(#1266). -
Added methods for
evt::regimenobjects (viaevtoolsplugin) under
the nametime_next(); this either gets or sets the time of the
next dose in the regimen (#1266).
Bugs Fixed
-
Fixed an issue where
timevalues in the simulated output data frame
were off by a very small amount, due to issues with floating point
mathematical operations (#1287). -
Fixed a problem writing a model to file with
mwrite_yaml()and
mwrite_cpp()when lower case block naming was used (#1282). -
Fixed a bug where invalid item passed through the
$SETblock caused
an error when reading / building a model (#1271). -
Fixed a bug where mrgsolve was not matching NONMEM behavior when an
EVID=4record was included in the data set withSS=1; mrgsolve will
now match NONMEM behavior in this case, with the output being identical
toEVID=1withSS=1(#1262).
mrgsolve 1.5.2
-
Add
$EVENTblock for writing code related to dosing or other events that
are implemented through model code rather than the data set (#1230). -
Add
evt::reset()andevt::reset(self)functions under theevtools
plugin; these reset the compartments in a model; overloaded functions are
also provided to reset and dose with bolus or infusion (#1222). -
Completed dosing functionality in
evtoolsplugin; useevt::addl()to
schedule additional doses through anevt::evobject; useevt::ii()to
set the dosing interval; useevt::ss()to advance the pharmacokinetic
system to steady state just prior to dosing;evt::cmt()sets the compartment
number;evt::amt()sets the dose amount;evt::rate()sets the infusion
rate; see the user guide for the specific signatures that are available
(#1227). -
Add
evtoolsmodel tomodlib(), illustrating how to implement dosing
regimens from inside the model a few different ways (#1230). -
Added more comprehensive checking for duplicate blocks in a model file;
duplicate blocks are always handled when allowed; an error message is always
issued when duplicates are not allowed (#1238). -
Code to audit
$ODE(or$DES) code, looking for an equation for every
model compartment was refactored to use a common approach for both traditional
models and models written with thenm-varsplugin; regardless of approach,
the user will be warned if mrgsolve does not detect code relevant to every
model compartment; the audit system can be bypassed by including the
@!auditblock option to$ODE(#1235). -
The
autodecplugin was lightly refactored to avoid false positive detection
of variables declared asdouble; plans are in place to narrow the
scope of what is detected for declaration in future releases (#1234). -
R help files (
.Rd) reviewed and revised for consistency and formatting
(#1246).
mrgsolve 1.5.1
- Fixed
yaml_to_cpp()example code to prevent saving the file to the working
directory (#1220).