pypharm 1.3.2__py3-none-any.whl → 1.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PyPharm/models.py +17 -2
- {pypharm-1.3.2.dist-info → pypharm-1.3.3.dist-info}/METADATA +1 -1
- pypharm-1.3.3.dist-info/RECORD +8 -0
- pypharm-1.3.2.dist-info/RECORD +0 -8
- {pypharm-1.3.2.dist-info → pypharm-1.3.3.dist-info}/WHEEL +0 -0
- {pypharm-1.3.2.dist-info → pypharm-1.3.3.dist-info}/top_level.txt +0 -0
PyPharm/models.py
CHANGED
|
@@ -2,7 +2,7 @@ from multiprocessing import shared_memory
|
|
|
2
2
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
from scipy.integrate import solve_ivp, RK45
|
|
5
|
-
from scipy.integrate
|
|
5
|
+
from scipy.integrate import simps
|
|
6
6
|
from scipy.optimize import minimize
|
|
7
7
|
from .country_optimization import CountriesAlgorithm
|
|
8
8
|
from .country_optimization_v2 import CountriesAlgorithm_v2
|
|
@@ -129,7 +129,22 @@ class BaseCompartmentModel:
|
|
|
129
129
|
t_eval=t_eval
|
|
130
130
|
)
|
|
131
131
|
return self.last_result
|
|
132
|
-
|
|
132
|
+
|
|
133
|
+
def get_kinetic_params(self, t_max, d, compartment_number, max_step=0.01):
|
|
134
|
+
one_hour_result = self(t_max=1, d=d, compartment_number=compartment_number, max_step=max_step)
|
|
135
|
+
auc_1h = simps(one_hour_result.y[compartment_number], one_hour_result.t)
|
|
136
|
+
self(t_max=t_max, d=d, compartment_number=compartment_number, max_step=max_step)
|
|
137
|
+
auc = simps(self.last_result.y[compartment_number], self.last_result.t)
|
|
138
|
+
result_dict = {
|
|
139
|
+
'c_max': self.last_result.y[compartment_number].max(),
|
|
140
|
+
'V': self.volumes[compartment_number] if self.volumes is not None else None,
|
|
141
|
+
'AUC': auc,
|
|
142
|
+
'AUC_1h': auc_1h,
|
|
143
|
+
'Cl': d / auc
|
|
144
|
+
}
|
|
145
|
+
return result_dict
|
|
146
|
+
|
|
147
|
+
|
|
133
148
|
def load_data_from_list(self, x):
|
|
134
149
|
if self.configuration_matrix_target:
|
|
135
150
|
self.configuration_matrix[self.configuration_matrix_target] = x[:self.configuration_matrix_target_count]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
PyPharm/__init__.py,sha256=hxhMRlWpLMARQV-ZNYkmvhQ9gCYI18an75vlySWjA6s,90
|
|
2
|
+
PyPharm/country_optimization.py,sha256=WsjfAWAWbxRnUUfBiMi1VatCSVbru7F1_G6kQBRVyA0,20452
|
|
3
|
+
PyPharm/country_optimization_v2.py,sha256=3d2mt15DXdr1V3soIJS51xuCv6uzH8pirah1RnI5--8,13156
|
|
4
|
+
PyPharm/models.py,sha256=qZDaVKiSdY3kXXeck5M8CEfmMD_V3AilZXIddyIocck,32080
|
|
5
|
+
pypharm-1.3.3.dist-info/METADATA,sha256=fDQvBkW3wSRuOuyBc3RFNg50h4fBT60of6xMCOAughY,14464
|
|
6
|
+
pypharm-1.3.3.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92
|
|
7
|
+
pypharm-1.3.3.dist-info/top_level.txt,sha256=yybfSkKw8q1G3aEcnlfVL7_L9ufGFSAYZnpc7q6oYJk,8
|
|
8
|
+
pypharm-1.3.3.dist-info/RECORD,,
|
pypharm-1.3.2.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
PyPharm/__init__.py,sha256=hxhMRlWpLMARQV-ZNYkmvhQ9gCYI18an75vlySWjA6s,90
|
|
2
|
-
PyPharm/country_optimization.py,sha256=WsjfAWAWbxRnUUfBiMi1VatCSVbru7F1_G6kQBRVyA0,20452
|
|
3
|
-
PyPharm/country_optimization_v2.py,sha256=3d2mt15DXdr1V3soIJS51xuCv6uzH8pirah1RnI5--8,13156
|
|
4
|
-
PyPharm/models.py,sha256=ecT0cFCbcmDL1jYuQE2IMZ7aPFZXRf63FAuJzJnugxs,31380
|
|
5
|
-
pypharm-1.3.2.dist-info/METADATA,sha256=kVzRdLrOj8_pXPtFgXYhBReVZKju5YTscVzfmDdFJPo,14464
|
|
6
|
-
pypharm-1.3.2.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92
|
|
7
|
-
pypharm-1.3.2.dist-info/top_level.txt,sha256=yybfSkKw8q1G3aEcnlfVL7_L9ufGFSAYZnpc7q6oYJk,8
|
|
8
|
-
pypharm-1.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|