Skip to content

Releases: metrumresearchgroup/mrgsolve

mrgsolve 2.0.2

Choose a tag to compare

@kylebaron kylebaron released this 24 Jun 16:53
375d791

Bugs Fixed

  • Fixed a bug where the system was not correctly reset prior to a reset-and-dose
    event (EVID=4) when the dose had a lag time. The flawed logic was introduced
    when matching NONMEM behavior for EVID=4 with lag times; a new
    system_at_ss flag in odeproblem now prevents an erroneous reset when the
    system has already advanced to steady state. (#1397, fixes #1396)

  • Fixed a bug where a bioavailability parameter (F) derived from a data set
    column was not evaluated correctly under locf advance. The fix
    implements a second call to $MAIN after the locf-targeted
    parameter update so that the dosing record's parameter value determines F,
    consistent with nocb behavior. (#1399, fixes #1395)

mrgsolve 2.0.1

Choose a tag to compare

@kylebaron kylebaron released this 19 May 21:57
a4c3462

Bugs Fixed

  • Fixed a bug causing an error when calling pow_convert() on empty model
    code blocks. (#1381)

  • Fixed a compilation error under C++20, the default standard in R 4.6.0.
    A boost::static_visitor initialization in dsl-preprocess.cpp used
    list initialization (Emitter{}) that is disallowed in C++20; changed
    to value initialization (Emitter()). (#1385, fixes #1384)

Internal

  • Column names are now assigned to the simulation output matrix in place,
    avoiding an extra copy of the simulated data. (#1383, #1387)

  • Updated the simulation loop to clear an individual's records before moving
    to the next individual; this should improve memory utilization, especially
    for very large simulation output. (#1388)

mrgsolve 2.0.0

Choose a tag to compare

@kylebaron kylebaron released this 22 Apr 21:09
0872434

Breaking Changes

  • data_set() and idata_set() no longer accept .subset, .select,
    object, or need arguments. These arguments allowed filtering and
    column selection inside the call; that processing should now be done on the
    data frame before passing it to data_set() or idata_set(). (#1374)

  • The n argument to simeta() and simeps() has been discouraged for a
    while and is now removed. Calling simeta(n) or simeps(n) to resimulate
    a single ETA or EPS value is no longer supported. Use simeta() or simeps()
    (no argument) to resimulate all values. (#1373)

  • knobs(), wf_sweep(), and render() have been removed. These
    functions were previously deprecated. (#1369)

  • The default value of root in $NMXML and $NMEXT has changed from
    "working" to "cppfile". The root directory for locating NONMEM
    output files now defaults to the directory containing the model .cpp file
    rather than the R working directory. Pass root = "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 modlib model library models have had parameter and compartment
    names standardized (#1361):

    • The first extravascular compartment is now named EV (was EV1) in
      pk1cmt, pk2cmt, irm1-irm4, and emax.
    • The first absorption rate constant is now named KA (was KA1) in
      models that previously used numbered names.
    • Code that references these compartments or parameters by name (e.g.,
      init(mod, EV1 = 0) or param(mod, KA1 = 1)) will need to be updated.
    • We continue to discourage users from using these models in production
      code.

New Features

  • Models can now use a ** b syntax to represent pow(a, b); this syntax is
    always available, without need to invoke a plugin (#1360).

  • With the nm-vars plugin, mrgsolve now recognizes NONMEM / Fortran
    IF / ELSE / THEN statements; 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 for EPS(n) when using the nm-vars
    plugin (#1367).

  • New DSL preprocessing functions convert NONMEM/Fortran model code to
    mrgsolve / C++ syntax (#1360, #1362, #1366):

    • convert_pow() converts Fortran ** exponentiation to pow().
    • convert_fort_if() converts Fortran IF/THEN/ELSE/END IF blocks to C++
      if/else syntax.
    • 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).

  • $PKMODEL gains an advan input for selecting 1, 2, or 3 compartment
    models with analytical solutions; for example, setting advan to 2, 4,
    or 12 will give you 1, 2, or 3 compartment model in closed form with a
    depot compartment. When advan is specified, compartments with standard
    names are automatically registered if neither $INIT nor $CMT are
    found in the model file and no compartments are registered at the time
    that $PKMODEL is processed (#1345).

  • Two new modlib models, pk3 and pk3iv, provide the corresponding
    pre-coded model files (#1345).

  • mrgx::assign() is now available in the mrgx plugin; 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 for mrgsims objects gains a fixy argument 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 to base::get(); env_get_obj() is an alias to env_get(),
    analogous to env_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

Choose a tag to compare

@kylebaron kylebaron released this 12 Mar 15:56
4f6f984
  • mrgsolve now requires R >= 4.1 (#1333).

  • FINAL_ROW and FINAL_IROW macros 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.equal method (#1337).

  • custom_rtol() and custom_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 #define directives (#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.
  • Initialze Self to null pointer in evt::regimen objects (#1329).

  • Refactor mat2df() (C++) for efficiency, avoiding Rcpp sugar (#1316).

mrgsolve 1.7.2

Choose a tag to compare

@kylebaron kylebaron released this 16 Jan 14:42
926007e
  • An individual record counter has been added. Use self.inrow to get the number of
    output rows for the current individual; use self.irown to get the zero-indexed row
    number for the current individual; these are similar to self.nrow and self.rown,
    which count records for the entire output data set (#1313).

Bugs Fixed

  • The code argument to mcode() now accepts a character vector with length
    greater than 1; passing multiple lines previously caused a compile error (#1310).

mrgsolve 1.7.1

Choose a tag to compare

@kylebaron kylebaron released this 24 Nov 20:56
3645d76
  • 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

Choose a tag to compare

@kylebaron kylebaron released this 19 Nov 03:30
ec03af7
  • 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 and R1 or D1 were 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 $PK or through the
      CHECK_MODELED_INFUSIONS macro available in $PREAMBLE only.

mrgsolve 1.6.1

Choose a tag to compare

@kylebaron kylebaron released this 31 Jul 15:22
88b72cc
  • Internal refactor of self.mevent() and self.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 in 1.6.0 that
    generates an error for events (or event sequences) that happen or begin in
    the past (#1297).

mrgsolve 1.6.0

Choose a tag to compare

@kylebaron kylebaron released this 31 Jul 11:09
7ac0ffa
  • evt::tgrid() was added to the evtools plugin, 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 the evtools plugin allowing users
    to reset the event ID attribute of event objects created inside a model (#1291).

  • EVID behavior 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
    with EVID=0; for EVID < 100, a discontinuity will continue to happen through
    ODE solver reset (#1291).

  • Event objects created in the model (typically through the evtools plugin) 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)

    • Usecustom_rtol(), custom_atol(), and custom_tol() to set tolerances
      on a compartment-by-compartment basis.
    • Use reset_rtol(), reset_atol(), or reset_tol() to reset custom
      tolerances.
    • Use use_custom_tol() and use_scalar_tol() to toggle the model to use
      either the customized (vector) values or the scalar values.
    • Use get_tol() or get_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.

Bugs Fixed

  • Fixed a bug where incorrectly spelled block names were inadvertently aliased
    resulting in a misleading error message (#1294).

  • Fixed a bug where no OMEGA or SIGMA matrices were imported into the
    model via multiple $NMEXT or $NMXML blocks when the matrix from one
    block was ignored (#1276).

mrgsolve 1.5.3

Choose a tag to compare

@kylebaron kylebaron released this 11 Jul 13:17
c750bcb
  • D_CMT, ALAG_CMT, and simeta() are now available to use in $TABLE
    ($ERROR), $EVENT, and $PRED code blocks (#1290).

  • Added END_OF_INFUSION syntax, which is true on the internal record that
    stops an infusion (#1288).

  • mwrite_yaml() and mwrite_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::regimen object (via evtools plugin), the default
    start time is now the time when the object was created; before this change,
    the default time was always 0 (#1266).

  • Added methods for evt::regimen objects (via evtools plugin) under
    the name time_next(); this either gets or sets the time of the
    next dose in the regimen (#1266).

Bugs Fixed

  • Fixed an issue where time values 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 $SET block caused
    an error when reading / building a model (#1271).

  • Fixed a bug where mrgsolve was not matching NONMEM behavior when an
    EVID=4 record was included in the data set with SS=1; mrgsolve will
    now match NONMEM behavior in this case, with the output being identical
    to EVID=1 with SS=1 (#1262).