pypharm 1.6.0__tar.gz → 1.6.2__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.6.0
3
+ Version: 1.6.2
4
4
  Summary: Module for solving pharmacokinetic problems
5
5
  Home-page: https://github.com/Krash13/PyPharm
6
6
  Author: Krash13
@@ -0,0 +1,4 @@
1
+ from .models import (BaseCompartmentModel, MagicCompartmentModel,
2
+ ReleaseCompartmentModel, TwoSubstancesCompartmentModel, PBPKmod)
3
+
4
+
@@ -0,0 +1,3 @@
1
+ from .compartment_models import (BaseCompartmentModel, MagicCompartmentModel,
2
+ ReleaseCompartmentModel, TwoSubstancesCompartmentModel)
3
+ from .pbpk import PBPKmod
@@ -316,7 +316,6 @@ class BaseCompartmentModel:
316
316
  plt.cla()
317
317
 
318
318
 
319
-
320
319
  class MagicCompartmentModel(BaseCompartmentModel):
321
320
 
322
321
  need_magic_optimization = False
@@ -340,7 +339,7 @@ class MagicCompartmentModel(BaseCompartmentModel):
340
339
  raise Exception("Magic_coefficient parameter not specified")
341
340
  res = super().__call__(t_max, c0, d, compartment_number, max_step, t_eval)
342
341
  magic_arr = np.ones(self.configuration_matrix.shape[0]) * self.magic_coefficient
343
- if self.exclude_compartments:
342
+ if self.exclude_compartments.size:
344
343
  magic_arr[self.exclude_compartments] = 1
345
344
  magic_arr = np.repeat(magic_arr, res.y.shape[1])
346
345
  magic_arr = np.reshape(magic_arr, res.y.shape)
@@ -745,7 +744,7 @@ class TwoSubstancesCompartmentModel(MagicCompartmentModel):
745
744
  c0 = np.array(c0)
746
745
  c0 = c0.reshape((1, c0.size))[0]
747
746
  ts = [0, t_max]
748
- self.last_result = solve_ivp(
747
+ res = solve_ivp(
749
748
  fun=self._compartment_model if
750
749
  not self.numba_option
751
750
  else lambda t, c: self._numba_compartment_model(t, c,
@@ -766,6 +765,13 @@ class TwoSubstancesCompartmentModel(MagicCompartmentModel):
766
765
  method=self.TwoSubstancesRK45,
767
766
  release_function=self.get_release_function()
768
767
  )
768
+ magic_arr = np.ones(self.configuration_matrix.shape[0] + self.released_configuration_matrix.shape[0]) * self.magic_coefficient
769
+ if self.exclude_compartments.size:
770
+ magic_arr[self.exclude_compartments] = 1
771
+ magic_arr = np.repeat(magic_arr, res.y.shape[1])
772
+ magic_arr = np.reshape(magic_arr, res.y.shape)
773
+ res.y = magic_arr * res.y
774
+ self.last_result = res
769
775
  return self.last_result
770
776
 
771
777
  def _default_release_function(self, current_c, t):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pypharm
3
- Version: 1.6.0
3
+ Version: 1.6.2
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.6.0',
9
+ version='1.6.2',
10
10
  author='Krash13',
11
11
  author_email='krasheninnikov.r.s@muctr.ru',
12
12
  description='Module for solving pharmacokinetic problems',
@@ -1,3 +0,0 @@
1
- from .models import BaseCompartmentModel, MagicCompartmentModel, ReleaseCompartmentModel, PBPKmod
2
-
3
-
@@ -1,2 +0,0 @@
1
- from .compartment_models import BaseCompartmentModel, MagicCompartmentModel, ReleaseCompartmentModel
2
- from .pbpk import PBPKmod
File without changes
File without changes
File without changes
File without changes