pharmpy.source module

Generic Sources/Resources I/O

Source code/resource manager for a Model class implementation.

Noteworthy

Module is target for all generalizable and non-agnostic code that concerns:

  1. Reading in streams/file-like resources.

  2. Formatting/generating source code from current state of Model.

  3. Writing out source code to streams/file-like resources.

class pharmpy.source.FileSource(obj)[source]

Bases: pharmpy.source.SourceBase

Source formats for files property: filename_extension (includes the dot)

read(path_or_io)[source]

Read source from io object or from str path or path object

pharmpy.source.Source(obj)[source]

Factory to create source object

class pharmpy.source.SourceBase(obj)[source]

Bases: object

API to manage the original source object of a model.

Is a model API attached to attribute Model.source.

The source format can be a text file, but it could also be any kind of object, i.e. an R object.

write(path, force=False)[source]

Write source to file.

Inheritance Diagram

Inheritance diagram of pharmpy.source