pypharm


Namepypharm JSON
Version 1.4.2 PyPI version JSON
download
home_pagehttps://github.com/Krash13/PyPharm
SummaryModule for solving pharmacokinetic problems
upload_time2025-01-19 20:24:19
maintainerNone
docs_urlNone
authorKrash13
requires_python>=3.9
licenseNone
keywords pharmacokinetics compartment-model
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PyPharm  
----------  
  **1) Установка пакета**
  
```  
pip install pypharm  
```  
  
**2) Пример использования пакета для модели, где все параметры известны** 

Задана двухкамерная модель такого вида

```mermaid
graph LR
D((Доза D)) --> V1[Камера V1]
V1 -- k12 --> V2[Камера V2]
V2 -- k21 --> V1
V1 -- k10 --> Out(Выведение)
``` 
При этом, нам известны параметры модели 
|  V1|V2  |k12 |K21 | K10
|--|--|--|--|--|
|  228| 629 |0.4586|0.1919|0.0309

Создание и расчет модели при помощи пакета PyPharm  
```python  
from PyPharm import BaseCompartmentModel  
  
model = BaseCompartmentModel([[0, 0.4586], [0.1919, 0]], [0.0309, 0], volumes=[228, 629])  
  
res = model(90, d=5700, compartment_number=0)  
```
res - Результат работы решателя scipy solve_iv

**3) Пример использования пакета для модели, где все параметры неизвестны** 

Задана многокамерная модель такого вида

```mermaid
graph LR
Br(Мозг) --'Kbr-'--> Is[Межклетачное пространство]
Is --'Kbr+'-->Br
Is--'Kis-'-->B(Кровь)
B--'Kis+'-->Is
B--'Ke'-->Out1((Выведение))
B--'Ki+'-->I(Печень)
I--'Ki-'-->Out2((Выведение))
B--'Kh+'-->H(Сердце)
H--'Kh-'-->B
``` 
При этом, известен лишь параметр Ke=0.077

Создание и расчет модели при помощи пакета PyPharm, используя метод minimize:
```python  
from PyPharm import BaseCompartmentModel
import numpy as np
matrix = [[0, None, 0, 0, 0],
[None, 0, None, 0, 0],
[0, None, 0, None, None],
[0, 0, 0, 0, 0],
[0, 0, None, 0, 0]]
outputs = [0, 0, 0.077, None, 0]

model = BaseCompartmentModel(matrix, outputs)

model.load_optimization_data(
	teoretic_x=[0.25, 0.5, 1, 4, 8, 24],
	teoretic_y=[[0, 0, 11.2, 5.3, 5.42, 3.2], [268.5, 783.3, 154.6, 224.2, 92.6, 0], [342, 637, 466, 235, 179, 158]],
	know_compartments=[0, 3, 4],
	c0=[0, 0, 20000, 0, 0]
)

x_min = [1.5, 0.01, 0.5, 0.0001, 0.1, 0.1, 4, 3]
x_max = [2.5, 0.7, 1.5, 0.05, 0.5, 0.5, 7, 5]
x0 = np.random.uniform(x_min, x_max)
bounds = ((1.5, 2.5), (0.01, 0.7), (0.5, 1.5), (0.0001, 0.05), (0.1, 0.5), (0.1, 0.5), (4, 7), (3, 5))

model.optimize(
	bounds=bounds,
	x0=x0,
	options={'disp': True}
)

print(model.configuration_matrix)
```
Или же при помощи алгоритма взаимодействующих стран
```python
from PyPharm import BaseCompartmentModel
import numpy as np
matrix = [[0, None, 0, 0, 0],
[None, 0, None, 0, 0],
[0, None, 0, None, None],
[0, 0, 0, 0, 0],
[0, 0, None, 0, 0]]
outputs = [0, 0, 0.077, None, 0]

model = BaseCompartmentModel(matrix, outputs)

model.load_optimization_data(
	teoretic_x=[0.25, 0.5, 1, 4, 8, 24],
	teoretic_y=[[0, 0, 11.2, 5.3, 5.42, 3.2], [268.5, 783.3, 154.6, 224.2, 92.6, 0], [342, 637, 466, 235, 179, 158]],
	know_compartments=[0, 3, 4],
	c0=[0, 0, 20000, 0, 0]
)

model.optimize(
	method='country_optimization',
	Xmin=[0.5, 0.001, 0.001, 0.00001, 0.01, 0.01, 1, 1],
	Xmax=[5, 2, 2.5, 0.3, 1, 1, 10, 10],
	M=10,
	N=25,
	n=[1, 10],
	p=[0.00001, 2],
	m=[1, 8],
	k=8,
	l=3,
	ep=[0.2, 0.4],
	tmax=300,
	printing=True,
)
```

При оптимизации, вектор неизвестных это
x = [configuration_matrix (неизвестные), outputs(неизвестные), volumes(неизвестные)]

Кроме того, вы можете использовать генетический алгоритм:
```python
model.optimize(
    method='GA',
    x_min=[0.00001, 0.001, 0.01, 1, 1],
    x_max=[1, 2, 1, 10, 3],
    genes=[16, 17, 16, 20, 16],
	n=100,
    child_percent=0.3,
    mutation_chance=0.5,
    max_mutation=5,
    t_max=300,
    max_step=0.5,
    printing=True,
)
```

Вы даже можете использовать свой собственный алгоритм, если это необходимо

```python
# CountriesAlgorithm - ваш класс алгоритма
# start - функция запуска алгоритма
# важно, чтобы ваша функция запуска возвращала numpy.array

model.optimize(
    user_method=CountriesAlgorithm,
    method_is_func=False,
    optimization_func_name='start',
    Xmin=[0.00001, 0.001, 0.01, 1, 1], #ваши настроечные параметры
    Xmax=[1, 2, 1, 10, 3],
    genes=[16, 17, 16, 20, 16],
    M=20,
    N=25,
    n=[1, 10],
    max_mutation=8,
    m=[1, 8],
    k=8,
    l=3,
    ep=[0.2, 0.4],
    tmax=200,
    max_step=0.5,
    printing=True
)
```

или

```python
# my_alg - ваша функция алгоритма, важно, чтобы она принимала только целевую функцию 

model.optimize(
    user_method=my_alg,
    Xmin=[0.00001, 0.001, 0.01, 1, 1], #ваши настроечные параметры
    Xmax=[1, 2, 1, 10, 3],
    genes=[16, 17, 16, 20, 16],
    M=20,
    N=25,
    n=[1, 10],
    max_mutation=8,
    m=[1, 8],
    k=8,
    l=3,
    ep=[0.2, 0.4],
    tmax=200,
    max_step=0.5,
    printing=True
)
```

**4) Модель MagicCompartmentModel** 

Данная модель необходима нам для тех случаев, 
когда мы не знаем как именно стоит переводить входные
единицы измерения в выходные.

В модель добавляется 2 дополнительных параметра:

* magic_coefficient - множитель преобразования входных единиц в выходные;
* exclude_compartments - список номеров камер, которые не 
подвергнутся преобразованию.

```python  
from PyPharm import MagicCompartmentModel  
  
model = MagicCompartmentModel([[0, 0.4586], [0.1919, 0]], [0.0309, 0], volumes=[228, 629], magic_coefficient=None, exclude_compartments=[2])  
  
res = model(90, d=5700, compartment_number=0)  
```

Параметр magic_coefficient может быть задан None,
в таком случае он будет подвергнут оптимизации, в таком 
случае он будет браться из последнего значения в векторе
переменных.
Если оба параметра не заданы, то модель выраздается 
в простую BaseCompartmentModel.

**5) Модель ReleaseCompartmentModel** 

Данная модель учитывает поправку на высвобождение
ЛВ в модель вводятся дополнительные параметры:
* v_release - Объем гепотетической камеры из которой происходит высвобождение
* release_parameters -  Параметры функции высвобождения
* release_compartment - Номер камеры в которую происходит высвобождение
* release_function - Функция высвобождения по умолчанию f(t,m,b,c) = c0 * c * t ** b / (t ** b + m)

При этом d и c0 теперь везде носят характер параметров камеры,
из которой происходит высвобождение
```python
from PyPharm import ReleaseCompartmentModel
import matplotlib.pyplot as plt

model = ReleaseCompartmentModel(
    6.01049235e+00,
    [4.56683781e-03, 1.36845756e+00, 5.61175978e-01],
    0,
    configuration_matrix=[[0, 1.18292665e+01], [3.02373800e-01, 0]],
    outputs=[5.00000000e+00, 0],
    volumes=[1.98530383e+01, 3.81007392e+02],
    numba_option=True
)
teoretic_t = [5/60, 0.25, 0.5, 1, 2, 4, 24, 48]
teoretic_c = [[3558.19,	508.49,	230.95,	52.05,	44.97,	36.52,	17.89,	10.36]]
d = 5 * 0.02 * 1000000
res = model(48, d=d)
plt.plot(teoretic_t, teoretic_c[0], 'r*')
plt.plot(res.t, res.y[0])
plt.grid()
plt.show()
```
Параметры release_parameters и v_release могут подвергаться оптимизации
в таком случае, искомое нужно просто задать как None. Тогда вектор неизвестных это
x = [configuration_matrix (неизвестные), outputs(неизвестные), volumes(неизвестные), release_parameters(неизвестные), v_release]

**6) Использование PBPK модели**

Вы можете использовать PBPK модель как для рассчёта по известным
данным так и для поиска параметров, исходя из ваших экспериментальных данных.

Чтобы задать исзвестные вам константы, при инициализации объекта следует использовать
параметры know_k и know_cl, которые содержат словари с известными параметрами, имена органов следует брать
из класса ORGAN_NAMES.

Ниже приведен пример поиска параметров и построение кривых распределения вещества
в органах с использованием генетического алгоритма.

```python
from PyPharm import PBPKmod
from PyPharm.constants import ORGAN_NAMES, MODEL_CONST

model = PBPKmod()
print(model.get_unknown_params())
model.load_optimization_data(
    time_exp=[12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],
    dict_c_exp = {ORGAN_NAMES.LIVER: [103.2 * 1e-6, 134.54 * 1e-6, 87.89 * 1e-6, 81.87 * 1e-6, 45.83 * 1e-6, 28.48 * 1e-6],
              ORGAN_NAMES.LUNG: [26.96 * 1e-6, 22.67 * 1e-6, 15.51 * 1e-6, 12.07 * 1e-6, 4.53 * 1e-6, 0 * 1e-6],
              ORGAN_NAMES.SPLEEN: [11.84 * 1e-6, 12.22 * 1e-6, 8.52 * 1e-6, 7.01 * 1e-6, 3.65 * 1e-6, 2.16 * 1e-6]
    },
    start_c_in_venous=150 * 1e-3 / MODEL_CONST['rat']['venous_blood']['V']
)
result = model.optimize(
    method='GA',
    x_min=17 * [0.0001],
    x_max=17 * [5],
    genes=17 * [16],
	n=300,
    child_percent=0.3,
    mutation_chance=0.5,
    max_mutation=5,
    t_max=300,
    printing=True,
)
model.update_know_params(result)

result = model(max_time=24 * 60, start_c_in_venous=150 * 1e-3 / MODEL_CONST['rat']['venous_blood']['V'], step=0.1)
model.plot_last_result(
    organ_names=[ORGAN_NAMES.LUNG, ORGAN_NAMES.LIVER, ORGAN_NAMES.SPLEEN],
    user_names={
        ORGAN_NAMES.LUNG: 'Лёгкие',
        ORGAN_NAMES.LIVER: 'Печень',
        ORGAN_NAMES.SPLEEN: 'Селезёнка',
    },
    theoretic_data={
        ORGAN_NAMES.LIVER: {
            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],
            'y': [103.2 * 1e-6, 134.54 * 1e-6, 87.89 * 1e-6, 81.87 * 1e-6, 45.83 * 1e-6, 28.48 * 1e-6],
        },
        ORGAN_NAMES.LUNG: {
            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],
            'y': [26.96 * 1e-6, 22.67 * 1e-6, 15.51 * 1e-6, 12.07 * 1e-6, 4.53 * 1e-6, 0 * 1e-6],
        },
        ORGAN_NAMES.SPLEEN: {
            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],
            'y': [11.84 * 1e-6, 12.22 * 1e-6, 8.52 * 1e-6, 7.01 * 1e-6, 3.65 * 1e-6, 2.16 * 1e-6]
        }
    }
)
```

**7) Использование shared_memory** 

Начиная с версии 1.3.0, вы можете использовать **shared_memory** для получения текущих данных
оптимизации. Имя нужного вам участка памяти хранится в поле **memory_name**.

```python
from multiprocessing import shared_memory

c = shared_memory.ShareableList(name='<your model.memory_name>')
print(c)
# ShareableList([4, 3.5192100752465563, 1.4158559227257506, 1.7264077213115414, 0.008336751860551, 0.2549196311342251, 0.5160375718404234, 6.915499993374695, 2.944744649331201, 0.5, 1.907294741996761], name='wnsm_0c50aa90')
```

Данные хранятся в формате списка [текущая_итерация, x0, ... , xn, f], работает только для алгоритма country_optimization.

**ENG documentation**
----------

**1) Package Installation**

```
pip install pypharm
```

**2) An example of using a package for a model where all parameters are known**

A two-chamber model of this type is given

```mermaid
graph LR
D((Dose D)) --> V1[Compartment V1]
V1 -- k12 --> V2[Compartment V2]
V2 -- k21 --> V1
V1 -- k10 --> Out(Output)
```
At the same time, we know the parameters of the model
| V1|V2 |k12 |K21 | K10
|--|--|--|--|--|
| 228| 629 |0.4586|0.1919|0.0309

Creating and calculating a model using the PyPharm package
```python
from PyPharm import BaseCompartmentModel

model = BaseCompartmentModel([[0, 0.4586], [0.1919, 0]], [0.0309, 0], volumes=[228, 629])

res = model(90, d=5700, compartment_number=0)
```
res is the result of the scipy solve_iv solver

**3) An example of using a package for a model where all parameters are unknown**

A multi-chamber model of this type is given

```mermaid
graph LR
Br(Brain) --'Kbr-'--> Is[Intercellular space]
Is --'Kbr+'-->Br
Is--'Kis-'-->B(Blood)
B--'Kis+'-->Is
B--'Ke'-->Out1((Output))
B--'Ki+'-->I(Liver)
I--'Ki-'-->Out2((Output))
B--'Kh+'-->H(Heart)
H--'Kh-'-->B
```
At the same time, only the parameter Ke=0 is known.077

Creating and calculating a model using the PyPharm package using the minimize method:
```python
from PyPharm import BaseCompartmentModel
import numpy as np
matrix = [[0, None, 0, 0, 0],
[None, 0, None, 0, 0],
[0, None, 0, None, None],
[0, 0, 0, 0, 0],
[0, 0, None, 0, 0]]
outputs = [0, 0, 0.077, None, 0]

model = BaseCompartmentModel(matrix, outputs)

model.load_optimization_data(
teoretic_x=[0.25, 0.5, 1, 4, 8, 24],
teoretic_y=[[0, 0, 11.2, 5.3, 5.42, 3.2], [268.5, 783.3, 154.6, 224.2, 92.6, 0], [342, 637, 466, 235, 179, 158]],
know_compartments=[0, 3, 4],
c0=[0, 0, 20000, 0, 0]
)

x_min = [1.5, 0.01, 0.5, 0.0001, 0.1, 0.1, 4, 3]
x_max = [2.5, 0.7, 1.5, 0.05, 0.5, 0.5, 7, 5]
x0 = np.random.uniform(x_min, x_max)
bounds = ((1.5, 2.5), (0.01, 0.7), (0.5, 1.5), (0.0001, 0.05), (0.1, 0.5), (0.1, 0.5), (4, 7), (3, 5))

model.optimize(
bounds=bounds,
x0=x0,
options={'disp': True}
)

print(model.configuration_matrix)
```
Or using the algorithm of interacting countries
```python
from PyPharm import BaseCompartmentModel
import numpy as np
matrix = [[0, None, 0, 0, 0],
[None, 0, None, 0, 0],
[0, None, 0, None, None],
[0, 0, 0, 0, 0],
[0, 0, None, 0, 0]]
outputs = [0, 0, 0.077, None, 0]

model = BaseCompartmentModel(matrix, outputs)

model.load_optimization_data(
teoretic_x=[0.25, 0.5, 1, 4, 8, 24],
teoretic_y=[[0, 0, 11.2, 5.3, 5.42, 3.2], [268.5, 783.3, 154.6, 224.2, 92.6, 0], [342, 637, 466, 235, 179, 158]],
know_compartments=[0, 3, 4],
c0=[0, 0, 20000, 0, 0]
)

model.optimize(
method='country_optimization',
Xmin=[0.5, 0.001, 0.001, 0.00001, 0.01, 0.01, 1, 1],
Xmax=[5, 2, 2.5, 0.3, 1, 1, 10, 10],
M=10,
N=25,
n=[1, 10],
p=[0.00001, 2],
m=[1, 8],
k=8,
l=3,
ep=[0.2, 0.4],
tmax=300,
printing=True,
)
```

When optimizing, the vector of unknowns is
x = [configuration_matrix (unknown), outputs(unknown), volumes(unknown)]

In addition, you can use a genetic algorithm:

```python 

model.optimize(
    method='GA',
    x_min=[0.00001, 0.001, 0.01, 1, 1],
    x_max=[1, 2, 1, 10, 3],
    genes=[16, 17, 16, 20, 16],
    n=100,
    percentage of descendants=0.3,
    the probability of mutation =0.5,
    max_mutation=5,
    t_max=300,
    max_step=0.5,
    print=True,
)
```

You can even use your own algorithm if necessary.

```python
# Countryalgorithm - your class is an algorithm
# start - start the algorithm
# it is important that your application aroused the interest of numpy.array

model.optimize(
    user_method=country Countryalgorithm,
    method_is_func=False,
    optimization_func_name='start',
    Xmin=[0.00001, 0.001, 0.01, 1, 1], # your desktop settings
    Xmax Max=[1, 2, 1, 10, 3],
    genes=[16, 17, 16, 20, 16],
    M=20,
    N=25,
    n=[1, 10],
    max_mutation=8,
    m=[1, 8],
    k=8,
    l=3,
    ep=[0,2, 0,4],
    tmax=200,
    max_step=0.5,
    print=True
)
```

or

```python
# my_alg is your algorithm function, it is important that it accepts only the target function

model.optimize(
    custom method=my_alg,
    Xmin=[0.00001, 0.001, 0.01, 1, 1], # your desktop settings
    Xmax Max=[1, 2, 1, 10, 3],
    genes=[16, 17, 16, 20, 16],
    M=20,
    N=25,
    n=[1, 10],
    max_mutation=8,
    m=[1, 8],
    k=8,
    l=3,
    ep=[0,2, 0,4],
    tmax=200,
    max_step=0.5,
    print=True
)
```

**4) The MagicCompartmentModel model**

We need this model for those cases
when we do not know exactly how to convert input
units of measurement into output units.

2 additional parameters are added to the model:

* magic_coefficient - multiplier for converting input units to output units;
* exclude_compartments - list of camera numbers that are not
they will undergo a transformation.

```python
from PyPharm import MagicCompartmentModel

model = MagicCompartmentModel([[0, 0.4586], [0.1919, 0]], [0.0309, 0], volumes=[228, 629], magic_coefficient=None, exclude_compartments=[2])

res = model(90, d=5700, compartment_number=0)
```

The magic_coefficient parameter can be set to None,
in which case it will be optimized, in
which case it will be taken from the last value in the vector
of variables.
If both parameters are not set, then the model is deleted
into a simple BaseCompartmentModel.

**5) The ReleaseCompartmentModel model**

This model takes into account the release adjustment
medicinal substance additional parameters are introduced into the model:
* v_release - The volume of the hepothetic chamber from which the release occurs
* release_parameters - Parameters of the release function
* release_compartment - The number of the camera into which the release takes place
* release_function - Default release function f(t,m,b,c) = c0 * c * t ** b / (t ** b + m)

At the same time, d and c0 are now everywhere in the nature of the parameters of the chamber
from which the release occurs
```python
from PyPharm import ReleaseCompartmentModel
import matplotlib.pyplot as plt

model = ReleaseCompartmentModel(
6.01049235e+00,
[4.56683781e-03, 1.36845756e+00, 5.61175978e-01],
0,
configuration_matrix=[[0, 1.18292665e+01], [3.02373800e-01, 0]],
outputs=[5.00000000e+00, 0],
volumes=[1.98530383e+01, 3.81007392e+02],
numba_option=True
)
teoretic_t = [5/60, 0.25, 0.5, 1, 2, 4, 24, 48]
teoretic_c = [[3558.19, 508.49, 230.95, 52.05, 44.97, 36.52, 17.89, 10.36]]
d = 5 * 0.02 * 1000000
res = model(48, d=d)
plt.plot(teoretic_t, teoretic_c[0], 'r*')
plt.plot(res.t, res.y[0])
plt.grid()
plt.show()
```
The release_parameters and v_release parameters can be optimized
in this case, you just need to set the desired value as None. Then the vector of unknowns is
x = [configuration_matrix (unknown), outputs(unknown), volumes(unknown), release_parameters(unknown), v_release]

**6) Using the PBPK model**

You can use the PBPK model both for calculations based on known
data and for searching for parameters based on your experimental data.

To set constants known to you, when initializing an object, you should use the
parameters know_k and know_cl, which contain dictionaries with known parameters, the names of organs should be taken
from the ORGAN_NAMES class.

Below is an example of searching for parameters and constructing distribution curves of a substance
in organs using a genetic algorithm.

```python
from PyPharm import PBPKmod
from PyPharm.constants import ORGAN_NAMES, MODEL_CONST

model = PBPKmod()
print(model.get_unknown_params())
model.load_optimization_data(
    time_exp=[12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],
    dict_c_exp = {ORGAN_NAMES.LIVER: [103.2 * 1e-6, 134.54 * 1e-6, 87.89 * 1e-6, 81.87 * 1e-6, 45.83 * 1e-6, 28.48 * 1e-6],
              ORGAN_NAMES.LUNG: [26.96 * 1e-6, 22.67 * 1e-6, 15.51 * 1e-6, 12.07 * 1e-6, 4.53 * 1e-6, 0 * 1e-6],
              ORGAN_NAMES.SPLEEN: [11.84 * 1e-6, 12.22 * 1e-6, 8.52 * 1e-6, 7.01 * 1e-6, 3.65 * 1e-6, 2.16 * 1e-6]
    },
    start_c_in_venous=150 * 1e-3 / MODEL_CONST['rat']['venous_blood']['V']
)
result = model.optimize(
    method='GA',
    x_min=17 * [0.0001],
    x_max=17 * [5],
    genes=17 * [16],
	n=300,
    child_percent=0.3,
    mutation_chance=0.5,
    max_mutation=5,
    t_max=300,
    printing=True,
)
model.update_know_params(result)

result = model(max_time=24 * 60, start_c_in_venous=150 * 1e-3 / MODEL_CONST['rat']['venous_blood']['V'], step=0.1)
model.plot_last_result(
    organ_names=[ORGAN_NAMES.LUNG, ORGAN_NAMES.LIVER, ORGAN_NAMES.SPLEEN],
    user_names={
        ORGAN_NAMES.LUNG: 'Лёгкие',
        ORGAN_NAMES.LIVER: 'Печень',
        ORGAN_NAMES.SPLEEN: 'Селезёнка',
    },
    theoretic_data={
        ORGAN_NAMES.LIVER: {
            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],
            'y': [103.2 * 1e-6, 134.54 * 1e-6, 87.89 * 1e-6, 81.87 * 1e-6, 45.83 * 1e-6, 28.48 * 1e-6],
        },
        ORGAN_NAMES.LUNG: {
            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],
            'y': [26.96 * 1e-6, 22.67 * 1e-6, 15.51 * 1e-6, 12.07 * 1e-6, 4.53 * 1e-6, 0 * 1e-6],
        },
        ORGAN_NAMES.SPLEEN: {
            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],
            'y': [11.84 * 1e-6, 12.22 * 1e-6, 8.52 * 1e-6, 7.01 * 1e-6, 3.65 * 1e-6, 2.16 * 1e-6]
        }
    }
)
```

**7) Using shared_memory**

Since version 1.3.0, you can use **shared_memory** to get current data
optimization. The name of the memory location you need is stored in the **memory_name** field.
```python
from multiprocessing import shared_memory

c = shared_memory.ShareableList(name='<your model.memory_name>')
print(c)
# ShareableList([4, 3.5192100752465563, 1.4158559227257506, 1.7264077213115414, 0.008336751860551, 0.2549196311342251, 0.5160375718404234, 6.915499993374695, 2.944744649331201, 0.5, 1.907294741996761], name='wnsm_0c50aa90')
```

The data is stored in list format [current_iteration, x0, ... , xn, f], works only for the country_optimization algorithm.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Krash13/PyPharm",
    "name": "pypharm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "pharmacokinetics compartment-model",
    "author": "Krash13",
    "author_email": "krasheninnikov.r.s@muctr.ru",
    "download_url": "https://files.pythonhosted.org/packages/ff/d2/535d0f628df793e78e2717a7a5c27b337c924040410b50a8f4245b23e8e9/pypharm-1.4.2.tar.gz",
    "platform": null,
    "description": "PyPharm  \n----------  \n  **1) \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u0430**\n  \n```  \npip install pypharm  \n```  \n  \n**2) \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b** \n\n\u0417\u0430\u0434\u0430\u043d\u0430 \u0434\u0432\u0443\u0445\u043a\u0430\u043c\u0435\u0440\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430\n\n```mermaid\ngraph LR\nD((\u0414\u043e\u0437\u0430 D)) --> V1[\u041a\u0430\u043c\u0435\u0440\u0430 V1]\nV1 -- k12 --> V2[\u041a\u0430\u043c\u0435\u0440\u0430 V2]\nV2 -- k21 --> V1\nV1 -- k10 --> Out(\u0412\u044b\u0432\u0435\u0434\u0435\u043d\u0438\u0435)\n``` \n\u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043d\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \n|  V1|V2  |k12 |K21 | K10\n|--|--|--|--|--|\n|  228| 629 |0.4586|0.1919|0.0309\n\n\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0440\u0430\u0441\u0447\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 PyPharm  \n```python  \nfrom PyPharm import BaseCompartmentModel  \n  \nmodel = BaseCompartmentModel([[0, 0.4586], [0.1919, 0]], [0.0309, 0], volumes=[228, 629])  \n  \nres = model(90, d=5700, compartment_number=0)  \n```\nres - \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0435\u0448\u0430\u0442\u0435\u043b\u044f scipy solve_iv\n\n**3) \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b** \n\n\u0417\u0430\u0434\u0430\u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u043a\u0430\u043c\u0435\u0440\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430\n\n```mermaid\ngraph LR\nBr(\u041c\u043e\u0437\u0433) --'Kbr-'--> Is[\u041c\u0435\u0436\u043a\u043b\u0435\u0442\u0430\u0447\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e]\nIs --'Kbr+'-->Br\nIs--'Kis-'-->B(\u041a\u0440\u043e\u0432\u044c)\nB--'Kis+'-->Is\nB--'Ke'-->Out1((\u0412\u044b\u0432\u0435\u0434\u0435\u043d\u0438\u0435))\nB--'Ki+'-->I(\u041f\u0435\u0447\u0435\u043d\u044c)\nI--'Ki-'-->Out2((\u0412\u044b\u0432\u0435\u0434\u0435\u043d\u0438\u0435))\nB--'Kh+'-->H(\u0421\u0435\u0440\u0434\u0446\u0435)\nH--'Kh-'-->B\n``` \n\u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043b\u0438\u0448\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Ke=0.077\n\n\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0440\u0430\u0441\u0447\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 PyPharm, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 minimize:\n```python  \nfrom PyPharm import BaseCompartmentModel\nimport numpy as np\nmatrix = [[0, None, 0, 0, 0],\n[None, 0, None, 0, 0],\n[0, None, 0, None, None],\n[0, 0, 0, 0, 0],\n[0, 0, None, 0, 0]]\noutputs = [0, 0, 0.077, None, 0]\n\nmodel = BaseCompartmentModel(matrix, outputs)\n\nmodel.load_optimization_data(\n\tteoretic_x=[0.25, 0.5, 1, 4, 8, 24],\n\tteoretic_y=[[0, 0, 11.2, 5.3, 5.42, 3.2], [268.5, 783.3, 154.6, 224.2, 92.6, 0], [342, 637, 466, 235, 179, 158]],\n\tknow_compartments=[0, 3, 4],\n\tc0=[0, 0, 20000, 0, 0]\n)\n\nx_min = [1.5, 0.01, 0.5, 0.0001, 0.1, 0.1, 4, 3]\nx_max = [2.5, 0.7, 1.5, 0.05, 0.5, 0.5, 7, 5]\nx0 = np.random.uniform(x_min, x_max)\nbounds = ((1.5, 2.5), (0.01, 0.7), (0.5, 1.5), (0.0001, 0.05), (0.1, 0.5), (0.1, 0.5), (4, 7), (3, 5))\n\nmodel.optimize(\n\tbounds=bounds,\n\tx0=x0,\n\toptions={'disp': True}\n)\n\nprint(model.configuration_matrix)\n```\n\u0418\u043b\u0438 \u0436\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0440\u0430\u043d\n```python\nfrom PyPharm import BaseCompartmentModel\nimport numpy as np\nmatrix = [[0, None, 0, 0, 0],\n[None, 0, None, 0, 0],\n[0, None, 0, None, None],\n[0, 0, 0, 0, 0],\n[0, 0, None, 0, 0]]\noutputs = [0, 0, 0.077, None, 0]\n\nmodel = BaseCompartmentModel(matrix, outputs)\n\nmodel.load_optimization_data(\n\tteoretic_x=[0.25, 0.5, 1, 4, 8, 24],\n\tteoretic_y=[[0, 0, 11.2, 5.3, 5.42, 3.2], [268.5, 783.3, 154.6, 224.2, 92.6, 0], [342, 637, 466, 235, 179, 158]],\n\tknow_compartments=[0, 3, 4],\n\tc0=[0, 0, 20000, 0, 0]\n)\n\nmodel.optimize(\n\tmethod='country_optimization',\n\tXmin=[0.5, 0.001, 0.001, 0.00001, 0.01, 0.01, 1, 1],\n\tXmax=[5, 2, 2.5, 0.3, 1, 1, 10, 10],\n\tM=10,\n\tN=25,\n\tn=[1, 10],\n\tp=[0.00001, 2],\n\tm=[1, 8],\n\tk=8,\n\tl=3,\n\tep=[0.2, 0.4],\n\ttmax=300,\n\tprinting=True,\n)\n```\n\n\u041f\u0440\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u0435\u043a\u0442\u043e\u0440 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u044d\u0442\u043e\nx = [configuration_matrix (\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435), outputs(\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435), volumes(\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435)]\n\n\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c:\n```python\nmodel.optimize(\n    method='GA',\n    x_min=[0.00001, 0.001, 0.01, 1, 1],\n    x_max=[1, 2, 1, 10, 3],\n    genes=[16, 17, 16, 20, 16],\n\tn=100,\n    child_percent=0.3,\n    mutation_chance=0.5,\n    max_mutation=5,\n    t_max=300,\n    max_step=0.5,\n    printing=True,\n)\n```\n\n\u0412\u044b \u0434\u0430\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\n\n```python\n# CountriesAlgorithm - \u0432\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\n# start - \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\n# \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0430 numpy.array\n\nmodel.optimize(\n    user_method=CountriesAlgorithm,\n    method_is_func=False,\n    optimization_func_name='start',\n    Xmin=[0.00001, 0.001, 0.01, 1, 1], #\u0432\u0430\u0448\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b\n    Xmax=[1, 2, 1, 10, 3],\n    genes=[16, 17, 16, 20, 16],\n    M=20,\n    N=25,\n    n=[1, 10],\n    max_mutation=8,\n    m=[1, 8],\n    k=8,\n    l=3,\n    ep=[0.2, 0.4],\n    tmax=200,\n    max_step=0.5,\n    printing=True\n)\n```\n\n\u0438\u043b\u0438\n\n```python\n# my_alg - \u0432\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \n\nmodel.optimize(\n    user_method=my_alg,\n    Xmin=[0.00001, 0.001, 0.01, 1, 1], #\u0432\u0430\u0448\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b\n    Xmax=[1, 2, 1, 10, 3],\n    genes=[16, 17, 16, 20, 16],\n    M=20,\n    N=25,\n    n=[1, 10],\n    max_mutation=8,\n    m=[1, 8],\n    k=8,\n    l=3,\n    ep=[0.2, 0.4],\n    tmax=200,\n    max_step=0.5,\n    printing=True\n)\n```\n\n**4) \u041c\u043e\u0434\u0435\u043b\u044c MagicCompartmentModel** \n\n\u0414\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u043d\u0430\u043c \u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \n\u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u044b\u0435\n\u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435.\n\n\u0412 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f 2 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:\n\n* magic_coefficient - \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0435\u0434\u0438\u043d\u0438\u0446 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435;\n* exclude_compartments - \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u043a\u0430\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \n\u043f\u043e\u0434\u0432\u0435\u0440\u0433\u043d\u0443\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e.\n\n```python  \nfrom PyPharm import MagicCompartmentModel  \n  \nmodel = MagicCompartmentModel([[0, 0.4586], [0.1919, 0]], [0.0309, 0], volumes=[228, 629], magic_coefficient=None, exclude_compartments=[2])  \n  \nres = model(90, d=5700, compartment_number=0)  \n```\n\n\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 magic_coefficient \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0430\u043d None,\n\u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u043d\u0443\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0432 \u0442\u0430\u043a\u043e\u043c \n\u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u0435\n\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.\n\u0415\u0441\u043b\u0438 \u043e\u0431\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d\u044b, \u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0440\u0430\u0437\u0434\u0430\u0435\u0442\u0441\u044f \n\u0432 \u043f\u0440\u043e\u0441\u0442\u0443\u044e BaseCompartmentModel.\n\n**5) \u041c\u043e\u0434\u0435\u043b\u044c ReleaseCompartmentModel** \n\n\u0414\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0443 \u043d\u0430 \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435\n\u041b\u0412 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:\n* v_release - \u041e\u0431\u044a\u0435\u043c \u0433\u0435\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0430\u043c\u0435\u0440\u044b \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435\n* release_parameters -  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f\n* release_compartment - \u041d\u043e\u043c\u0435\u0440 \u043a\u0430\u043c\u0435\u0440\u044b \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435\n* release_function - \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e f(t,m,b,c) = c0 * c * t ** b / (t ** b + m)\n\n\u041f\u0440\u0438 \u044d\u0442\u043e\u043c d \u0438 c0 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0437\u0434\u0435 \u043d\u043e\u0441\u044f\u0442 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u0430\u043c\u0435\u0440\u044b,\n\u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435\n```python\nfrom PyPharm import ReleaseCompartmentModel\nimport matplotlib.pyplot as plt\n\nmodel = ReleaseCompartmentModel(\n    6.01049235e+00,\n    [4.56683781e-03, 1.36845756e+00, 5.61175978e-01],\n    0,\n    configuration_matrix=[[0, 1.18292665e+01], [3.02373800e-01, 0]],\n    outputs=[5.00000000e+00, 0],\n    volumes=[1.98530383e+01, 3.81007392e+02],\n    numba_option=True\n)\nteoretic_t = [5/60, 0.25, 0.5, 1, 2, 4, 24, 48]\nteoretic_c = [[3558.19,\t508.49,\t230.95,\t52.05,\t44.97,\t36.52,\t17.89,\t10.36]]\nd = 5 * 0.02 * 1000000\nres = model(48, d=d)\nplt.plot(teoretic_t, teoretic_c[0], 'r*')\nplt.plot(res.t, res.y[0])\nplt.grid()\nplt.show()\n```\n\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b release_parameters \u0438 v_release \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438\n\u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043a\u0430\u043a None. \u0422\u043e\u0433\u0434\u0430 \u0432\u0435\u043a\u0442\u043e\u0440 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u044d\u0442\u043e\nx = [configuration_matrix (\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435), outputs(\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435), volumes(\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435), release_parameters(\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435), v_release]\n\n**6) \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PBPK \u043c\u043e\u0434\u0435\u043b\u0438**\n\n\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c PBPK \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u0430\u043a \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u0447\u0451\u0442\u0430 \u043f\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\n\u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0432\u0430\u0448\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.\n\n\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u0438\u0441\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0432\u0430\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\n\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b know_k \u0438 know_cl, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0441 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u0438\u043c\u0435\u043d\u0430 \u043e\u0440\u0433\u0430\u043d\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0431\u0440\u0430\u0442\u044c\n\u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 ORGAN_NAMES.\n\n\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043a\u0440\u0438\u0432\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0430\n\u0432 \u043e\u0440\u0433\u0430\u043d\u0430\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0433\u0435\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430.\n\n```python\nfrom PyPharm import PBPKmod\nfrom PyPharm.constants import ORGAN_NAMES, MODEL_CONST\n\nmodel = PBPKmod()\nprint(model.get_unknown_params())\nmodel.load_optimization_data(\n    time_exp=[12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],\n    dict_c_exp = {ORGAN_NAMES.LIVER: [103.2 * 1e-6, 134.54 * 1e-6, 87.89 * 1e-6, 81.87 * 1e-6, 45.83 * 1e-6, 28.48 * 1e-6],\n              ORGAN_NAMES.LUNG: [26.96 * 1e-6, 22.67 * 1e-6, 15.51 * 1e-6, 12.07 * 1e-6, 4.53 * 1e-6, 0 * 1e-6],\n              ORGAN_NAMES.SPLEEN: [11.84 * 1e-6, 12.22 * 1e-6, 8.52 * 1e-6, 7.01 * 1e-6, 3.65 * 1e-6, 2.16 * 1e-6]\n    },\n    start_c_in_venous=150 * 1e-3 / MODEL_CONST['rat']['venous_blood']['V']\n)\nresult = model.optimize(\n    method='GA',\n    x_min=17 * [0.0001],\n    x_max=17 * [5],\n    genes=17 * [16],\n\tn=300,\n    child_percent=0.3,\n    mutation_chance=0.5,\n    max_mutation=5,\n    t_max=300,\n    printing=True,\n)\nmodel.update_know_params(result)\n\nresult = model(max_time=24 * 60, start_c_in_venous=150 * 1e-3 / MODEL_CONST['rat']['venous_blood']['V'], step=0.1)\nmodel.plot_last_result(\n    organ_names=[ORGAN_NAMES.LUNG, ORGAN_NAMES.LIVER, ORGAN_NAMES.SPLEEN],\n    user_names={\n        ORGAN_NAMES.LUNG: '\u041b\u0451\u0433\u043a\u0438\u0435',\n        ORGAN_NAMES.LIVER: '\u041f\u0435\u0447\u0435\u043d\u044c',\n        ORGAN_NAMES.SPLEEN: '\u0421\u0435\u043b\u0435\u0437\u0451\u043d\u043a\u0430',\n    },\n    theoretic_data={\n        ORGAN_NAMES.LIVER: {\n            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],\n            'y': [103.2 * 1e-6, 134.54 * 1e-6, 87.89 * 1e-6, 81.87 * 1e-6, 45.83 * 1e-6, 28.48 * 1e-6],\n        },\n        ORGAN_NAMES.LUNG: {\n            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],\n            'y': [26.96 * 1e-6, 22.67 * 1e-6, 15.51 * 1e-6, 12.07 * 1e-6, 4.53 * 1e-6, 0 * 1e-6],\n        },\n        ORGAN_NAMES.SPLEEN: {\n            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],\n            'y': [11.84 * 1e-6, 12.22 * 1e-6, 8.52 * 1e-6, 7.01 * 1e-6, 3.65 * 1e-6, 2.16 * 1e-6]\n        }\n    }\n)\n```\n\n**7) \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 shared_memory** \n\n\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 1.3.0, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c **shared_memory** \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445\n\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0418\u043c\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0432\u0430\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u0435 **memory_name**.\n\n```python\nfrom multiprocessing import shared_memory\n\nc = shared_memory.ShareableList(name='<your model.memory_name>')\nprint(c)\n# ShareableList([4, 3.5192100752465563, 1.4158559227257506, 1.7264077213115414, 0.008336751860551, 0.2549196311342251, 0.5160375718404234, 6.915499993374695, 2.944744649331201, 0.5, 1.907294741996761], name='wnsm_0c50aa90')\n```\n\n\u0414\u0430\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 [\u0442\u0435\u043a\u0443\u0449\u0430\u044f_\u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f, x0, ... , xn, f], \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 country_optimization.\n\n**ENG documentation**\n----------\n\n**1) Package Installation**\n\n```\npip install pypharm\n```\n\n**2) An example of using a package for a model where all parameters are known**\n\nA two-chamber model of this type is given\n\n```mermaid\ngraph LR\nD((Dose D)) --> V1[Compartment V1]\nV1 -- k12 --> V2[Compartment V2]\nV2 -- k21 --> V1\nV1 -- k10 --> Out(Output)\n```\nAt the same time, we know the parameters of the model\n| V1|V2 |k12 |K21 | K10\n|--|--|--|--|--|\n| 228| 629 |0.4586|0.1919|0.0309\n\nCreating and calculating a model using the PyPharm package\n```python\nfrom PyPharm import BaseCompartmentModel\n\nmodel = BaseCompartmentModel([[0, 0.4586], [0.1919, 0]], [0.0309, 0], volumes=[228, 629])\n\nres = model(90, d=5700, compartment_number=0)\n```\nres is the result of the scipy solve_iv solver\n\n**3) An example of using a package for a model where all parameters are unknown**\n\nA multi-chamber model of this type is given\n\n```mermaid\ngraph LR\nBr(Brain) --'Kbr-'--> Is[Intercellular space]\nIs --'Kbr+'-->Br\nIs--'Kis-'-->B(Blood)\nB--'Kis+'-->Is\nB--'Ke'-->Out1((Output))\nB--'Ki+'-->I(Liver)\nI--'Ki-'-->Out2((Output))\nB--'Kh+'-->H(Heart)\nH--'Kh-'-->B\n```\nAt the same time, only the parameter Ke=0 is known.077\n\nCreating and calculating a model using the PyPharm package using the minimize method:\n```python\nfrom PyPharm import BaseCompartmentModel\nimport numpy as np\nmatrix = [[0, None, 0, 0, 0],\n[None, 0, None, 0, 0],\n[0, None, 0, None, None],\n[0, 0, 0, 0, 0],\n[0, 0, None, 0, 0]]\noutputs = [0, 0, 0.077, None, 0]\n\nmodel = BaseCompartmentModel(matrix, outputs)\n\nmodel.load_optimization_data(\nteoretic_x=[0.25, 0.5, 1, 4, 8, 24],\nteoretic_y=[[0, 0, 11.2, 5.3, 5.42, 3.2], [268.5, 783.3, 154.6, 224.2, 92.6, 0], [342, 637, 466, 235, 179, 158]],\nknow_compartments=[0, 3, 4],\nc0=[0, 0, 20000, 0, 0]\n)\n\nx_min = [1.5, 0.01, 0.5, 0.0001, 0.1, 0.1, 4, 3]\nx_max = [2.5, 0.7, 1.5, 0.05, 0.5, 0.5, 7, 5]\nx0 = np.random.uniform(x_min, x_max)\nbounds = ((1.5, 2.5), (0.01, 0.7), (0.5, 1.5), (0.0001, 0.05), (0.1, 0.5), (0.1, 0.5), (4, 7), (3, 5))\n\nmodel.optimize(\nbounds=bounds,\nx0=x0,\noptions={'disp': True}\n)\n\nprint(model.configuration_matrix)\n```\nOr using the algorithm of interacting countries\n```python\nfrom PyPharm import BaseCompartmentModel\nimport numpy as np\nmatrix = [[0, None, 0, 0, 0],\n[None, 0, None, 0, 0],\n[0, None, 0, None, None],\n[0, 0, 0, 0, 0],\n[0, 0, None, 0, 0]]\noutputs = [0, 0, 0.077, None, 0]\n\nmodel = BaseCompartmentModel(matrix, outputs)\n\nmodel.load_optimization_data(\nteoretic_x=[0.25, 0.5, 1, 4, 8, 24],\nteoretic_y=[[0, 0, 11.2, 5.3, 5.42, 3.2], [268.5, 783.3, 154.6, 224.2, 92.6, 0], [342, 637, 466, 235, 179, 158]],\nknow_compartments=[0, 3, 4],\nc0=[0, 0, 20000, 0, 0]\n)\n\nmodel.optimize(\nmethod='country_optimization',\nXmin=[0.5, 0.001, 0.001, 0.00001, 0.01, 0.01, 1, 1],\nXmax=[5, 2, 2.5, 0.3, 1, 1, 10, 10],\nM=10,\nN=25,\nn=[1, 10],\np=[0.00001, 2],\nm=[1, 8],\nk=8,\nl=3,\nep=[0.2, 0.4],\ntmax=300,\nprinting=True,\n)\n```\n\nWhen optimizing, the vector of unknowns is\nx = [configuration_matrix (unknown), outputs(unknown), volumes(unknown)]\n\nIn addition, you can use a genetic algorithm:\n\n```python \n\nmodel.optimize(\n    method='GA',\n    x_min=[0.00001, 0.001, 0.01, 1, 1],\n    x_max=[1, 2, 1, 10, 3],\n    genes=[16, 17, 16, 20, 16],\n    n=100,\n    percentage of descendants=0.3,\n    the probability of mutation =0.5,\n    max_mutation=5,\n    t_max=300,\n    max_step=0.5,\n    print=True,\n)\n```\n\nYou can even use your own algorithm if necessary.\n\n```python\n# Countryalgorithm - your class is an algorithm\n# start - start the algorithm\n# it is important that your application aroused the interest of numpy.array\n\nmodel.optimize(\n    user_method=country Countryalgorithm,\n    method_is_func=False,\n    optimization_func_name='start',\n    Xmin=[0.00001, 0.001, 0.01, 1, 1], # your desktop settings\n    Xmax Max=[1, 2, 1, 10, 3],\n    genes=[16, 17, 16, 20, 16],\n    M=20,\n    N=25,\n    n=[1, 10],\n    max_mutation=8,\n    m=[1, 8],\n    k=8,\n    l=3,\n    ep=[0,2, 0,4],\n    tmax=200,\n    max_step=0.5,\n    print=True\n)\n```\n\nor\n\n```python\n# my_alg is your algorithm function, it is important that it accepts only the target function\n\nmodel.optimize(\n    custom method=my_alg,\n    Xmin=[0.00001, 0.001, 0.01, 1, 1], # your desktop settings\n    Xmax Max=[1, 2, 1, 10, 3],\n    genes=[16, 17, 16, 20, 16],\n    M=20,\n    N=25,\n    n=[1, 10],\n    max_mutation=8,\n    m=[1, 8],\n    k=8,\n    l=3,\n    ep=[0,2, 0,4],\n    tmax=200,\n    max_step=0.5,\n    print=True\n)\n```\n\n**4) The MagicCompartmentModel model**\n\nWe need this model for those cases\nwhen we do not know exactly how to convert input\nunits of measurement into output units.\n\n2 additional parameters are added to the model:\n\n* magic_coefficient - multiplier for converting input units to output units;\n* exclude_compartments - list of camera numbers that are not\nthey will undergo a transformation.\n\n```python\nfrom PyPharm import MagicCompartmentModel\n\nmodel = MagicCompartmentModel([[0, 0.4586], [0.1919, 0]], [0.0309, 0], volumes=[228, 629], magic_coefficient=None, exclude_compartments=[2])\n\nres = model(90, d=5700, compartment_number=0)\n```\n\nThe magic_coefficient parameter can be set to None,\nin which case it will be optimized, in\nwhich case it will be taken from the last value in the vector\nof variables.\nIf both parameters are not set, then the model is deleted\ninto a simple BaseCompartmentModel.\n\n**5) The ReleaseCompartmentModel model**\n\nThis model takes into account the release adjustment\nmedicinal substance additional parameters are introduced into the model:\n* v_release - The volume of the hepothetic chamber from which the release occurs\n* release_parameters - Parameters of the release function\n* release_compartment - The number of the camera into which the release takes place\n* release_function - Default release function f(t,m,b,c) = c0 * c * t ** b / (t ** b + m)\n\nAt the same time, d and c0 are now everywhere in the nature of the parameters of the chamber\nfrom which the release occurs\n```python\nfrom PyPharm import ReleaseCompartmentModel\nimport matplotlib.pyplot as plt\n\nmodel = ReleaseCompartmentModel(\n6.01049235e+00,\n[4.56683781e-03, 1.36845756e+00, 5.61175978e-01],\n0,\nconfiguration_matrix=[[0, 1.18292665e+01], [3.02373800e-01, 0]],\noutputs=[5.00000000e+00, 0],\nvolumes=[1.98530383e+01, 3.81007392e+02],\nnumba_option=True\n)\nteoretic_t = [5/60, 0.25, 0.5, 1, 2, 4, 24, 48]\nteoretic_c = [[3558.19, 508.49, 230.95, 52.05, 44.97, 36.52, 17.89, 10.36]]\nd = 5 * 0.02 * 1000000\nres = model(48, d=d)\nplt.plot(teoretic_t, teoretic_c[0], 'r*')\nplt.plot(res.t, res.y[0])\nplt.grid()\nplt.show()\n```\nThe release_parameters and v_release parameters can be optimized\nin this case, you just need to set the desired value as None. Then the vector of unknowns is\nx = [configuration_matrix (unknown), outputs(unknown), volumes(unknown), release_parameters(unknown), v_release]\n\n**6) Using the PBPK model**\n\nYou can use the PBPK model both for calculations based on known\ndata and for searching for parameters based on your experimental data.\n\nTo set constants known to you, when initializing an object, you should use the\nparameters know_k and know_cl, which contain dictionaries with known parameters, the names of organs should be taken\nfrom the ORGAN_NAMES class.\n\nBelow is an example of searching for parameters and constructing distribution curves of a substance\nin organs using a genetic algorithm.\n\n```python\nfrom PyPharm import PBPKmod\nfrom PyPharm.constants import ORGAN_NAMES, MODEL_CONST\n\nmodel = PBPKmod()\nprint(model.get_unknown_params())\nmodel.load_optimization_data(\n    time_exp=[12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],\n    dict_c_exp = {ORGAN_NAMES.LIVER: [103.2 * 1e-6, 134.54 * 1e-6, 87.89 * 1e-6, 81.87 * 1e-6, 45.83 * 1e-6, 28.48 * 1e-6],\n              ORGAN_NAMES.LUNG: [26.96 * 1e-6, 22.67 * 1e-6, 15.51 * 1e-6, 12.07 * 1e-6, 4.53 * 1e-6, 0 * 1e-6],\n              ORGAN_NAMES.SPLEEN: [11.84 * 1e-6, 12.22 * 1e-6, 8.52 * 1e-6, 7.01 * 1e-6, 3.65 * 1e-6, 2.16 * 1e-6]\n    },\n    start_c_in_venous=150 * 1e-3 / MODEL_CONST['rat']['venous_blood']['V']\n)\nresult = model.optimize(\n    method='GA',\n    x_min=17 * [0.0001],\n    x_max=17 * [5],\n    genes=17 * [16],\n\tn=300,\n    child_percent=0.3,\n    mutation_chance=0.5,\n    max_mutation=5,\n    t_max=300,\n    printing=True,\n)\nmodel.update_know_params(result)\n\nresult = model(max_time=24 * 60, start_c_in_venous=150 * 1e-3 / MODEL_CONST['rat']['venous_blood']['V'], step=0.1)\nmodel.plot_last_result(\n    organ_names=[ORGAN_NAMES.LUNG, ORGAN_NAMES.LIVER, ORGAN_NAMES.SPLEEN],\n    user_names={\n        ORGAN_NAMES.LUNG: '\u041b\u0451\u0433\u043a\u0438\u0435',\n        ORGAN_NAMES.LIVER: '\u041f\u0435\u0447\u0435\u043d\u044c',\n        ORGAN_NAMES.SPLEEN: '\u0421\u0435\u043b\u0435\u0437\u0451\u043d\u043a\u0430',\n    },\n    theoretic_data={\n        ORGAN_NAMES.LIVER: {\n            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],\n            'y': [103.2 * 1e-6, 134.54 * 1e-6, 87.89 * 1e-6, 81.87 * 1e-6, 45.83 * 1e-6, 28.48 * 1e-6],\n        },\n        ORGAN_NAMES.LUNG: {\n            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],\n            'y': [26.96 * 1e-6, 22.67 * 1e-6, 15.51 * 1e-6, 12.07 * 1e-6, 4.53 * 1e-6, 0 * 1e-6],\n        },\n        ORGAN_NAMES.SPLEEN: {\n            'x': [12, 60, 3 * 60, 5* 60, 15 * 60, 24 * 60],\n            'y': [11.84 * 1e-6, 12.22 * 1e-6, 8.52 * 1e-6, 7.01 * 1e-6, 3.65 * 1e-6, 2.16 * 1e-6]\n        }\n    }\n)\n```\n\n**7) Using shared_memory**\n\nSince version 1.3.0, you can use **shared_memory** to get current data\noptimization. The name of the memory location you need is stored in the **memory_name** field.\n```python\nfrom multiprocessing import shared_memory\n\nc = shared_memory.ShareableList(name='<your model.memory_name>')\nprint(c)\n# ShareableList([4, 3.5192100752465563, 1.4158559227257506, 1.7264077213115414, 0.008336751860551, 0.2549196311342251, 0.5160375718404234, 6.915499993374695, 2.944744649331201, 0.5, 1.907294741996761], name='wnsm_0c50aa90')\n```\n\nThe data is stored in list format [current_iteration, x0, ... , xn, f], works only for the country_optimization algorithm.\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Module for solving pharmacokinetic problems",
    "version": "1.4.2",
    "project_urls": {
        "Homepage": "https://github.com/Krash13/PyPharm"
    },
    "split_keywords": [
        "pharmacokinetics",
        "compartment-model"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ec2d602dbf703aa349188aa026052473dee5936646baeb0cb74751427b6ce13",
                "md5": "979ae9b95fc04d75f335d9c9346f5c3d",
                "sha256": "b24b8a8d563b15f9678b7afa4a6bba45656cfa9540a38257e6f8d2847b95313f"
            },
            "downloads": -1,
            "filename": "pypharm-1.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "979ae9b95fc04d75f335d9c9346f5c3d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 48706,
            "upload_time": "2025-01-19T20:24:10",
            "upload_time_iso_8601": "2025-01-19T20:24:10.828153Z",
            "url": "https://files.pythonhosted.org/packages/6e/c2/d602dbf703aa349188aa026052473dee5936646baeb0cb74751427b6ce13/pypharm-1.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ffd2535d0f628df793e78e2717a7a5c27b337c924040410b50a8f4245b23e8e9",
                "md5": "8cc9f52364199fa38b4eae381279dd44",
                "sha256": "32dd27d52b80835ad88d9481e5aa159b7dc1c2ddb2be8bd5188740c7efebe038"
            },
            "downloads": -1,
            "filename": "pypharm-1.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "8cc9f52364199fa38b4eae381279dd44",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 29558,
            "upload_time": "2025-01-19T20:24:19",
            "upload_time_iso_8601": "2025-01-19T20:24:19.627329Z",
            "url": "https://files.pythonhosted.org/packages/ff/d2/535d0f628df793e78e2717a7a5c27b337c924040410b50a8f4245b23e8e9/pypharm-1.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-19 20:24:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Krash13",
    "github_project": "PyPharm",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pypharm"
}
        
Elapsed time: 0.37407s