Infusion#

class pharmpy.model.Infusion(amount, admid=1, rate=None, duration=None)[source]#

Bases: Dose, Immutable

An infusion dose

Parameters:
  • amount (expression) – Symbolic amount of dose

  • admid (int) – Administration ID

  • rate (expression) – Symbolic rate. Mutually exclusive with duration

  • duration (expression) – Symbolic duration. Mutually excluseive with rate

Examples

>>> from pharmpy.model import Infusion
>>> dose = Infusion.create("AMT", duration="D1")
>>> dose
Infusion(AMT, admid=1, duration=D1)
>>> dose = Infusion.create("AMT", rate="R1")
>>> dose
Infusion(AMT, admid=1, rate=R1)

Attributes Summary

duration

Symbolc duration

free_symbols

Get set of all free symbols in the dose

rate

Symbolic rate

Methods Summary

create(amount[, admid, rate, duration])

from_dict(d)

replace(**kwargs)

subs(substitutions)

Substitute expressions or symbols in dose

to_dict()

Attributes Documentation

duration#

Symbolc duration

Mutually exclusive with rate.

free_symbols#

Get set of all free symbols in the dose

Examples

>>> from pharmpy.model import Infusion
>>> dose = Infusion.create("AMT", rate="RATE")
>>> dose.free_symbols   
{AMT, RATE}
rate#

Symbolic rate

Mutually exclusive with duration.

Methods Documentation

classmethod create(amount, admid=1, rate=None, duration=None)[source]#
classmethod from_dict(d)[source]#
replace(**kwargs)[source]#
subs(substitutions)[source]#

Substitute expressions or symbols in dose

Parameters:

substitutions (dict) – Dictionary of from, to pairs

Examples

>>> from pharmpy.model import Infusion
>>> dose = Infusion.create("AMT", duration="DUR")
>>> dose.subs({'DUR': 'D1'})
Infusion(AMT, admid=1, duration=D1)
to_dict()[source]#