pypharm 1.3.2__tar.gz → 1.3.3__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pypharm
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: Module for solving pharmacokinetic problems
5
5
  Home-page: https://github.com/Krash13/PyPharm
6
6
  Author: Krash13
@@ -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._ivp.rk import rk_step, SAFETY, MAX_FACTOR, MIN_FACTOR
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]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pypharm
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: Module for solving pharmacokinetic problems
5
5
  Home-page: https://github.com/Krash13/PyPharm
6
6
  Author: Krash13
@@ -6,7 +6,7 @@ def readme():
6
6
 
7
7
  setup(
8
8
  name='pypharm',
9
- version='1.3.2',
9
+ version='1.3.3',
10
10
  author='Krash13',
11
11
  author_email='krasheninnikov.r.s@muctr.ru',
12
12
  description='Module for solving pharmacokinetic problems',
File without changes
File without changes
File without changes