drux 0.1__tar.gz → 0.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,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drux
3
- Version: 0.1
3
+ Version: 0.3
4
4
  Summary: Drux: Drug Release Analysis Framework
5
5
  Home-page: https://github.com/openscilab/drux
6
- Download-URL: https://github.com/openscilab/drux/tarball/v0.1
6
+ Download-URL: https://github.com/openscilab/drux/tarball/v0.3
7
7
  Author: Drux Development Team
8
8
  Author-email: drux@openscilab.com
9
9
  License: MIT
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
23
24
  Classifier: Intended Audience :: Developers
24
25
  Classifier: Intended Audience :: Education
25
26
  Classifier: Intended Audience :: End Users/Desktop
@@ -34,7 +35,7 @@ Requires-Python: >=3.7
34
35
  Description-Content-Type: text/markdown
35
36
  License-File: LICENSE
36
37
  License-File: AUTHORS.md
37
- Requires-Dist: numpy>=1.19.0
38
+ Requires-Dist: numpy>=1.21.0
38
39
  Requires-Dist: matplotlib>=3.2.2
39
40
  Dynamic: author
40
41
  Dynamic: author-email
@@ -53,11 +54,14 @@ Dynamic: summary
53
54
 
54
55
 
55
56
  <div align="center">
57
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/logo.png" width="350">
56
58
  <h1>Drux: Drug Release Analysis Framework</h1>
57
59
  <br/>
58
60
  <a href="https://badge.fury.io/py/drux"><img src="https://badge.fury.io/py/drux.svg" alt="PyPI version"></a>
59
61
  <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
62
+ <a href="https://codecov.io/gh/openscilab/drux"><img src="https://codecov.io/gh/openscilab/drux/branch/dev/graph/badge.svg?token=5O41J3XX2L"></a>
60
63
  <a href="https://github.com/openscilab/drux"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/drux"></a>
64
+ <a href="https://discord.gg/8Rf6bGBtse"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>
61
65
  </div>
62
66
 
63
67
  ----------
@@ -101,18 +105,62 @@ Drux is a Python-based framework for simulating drug release profiles using math
101
105
  </td>
102
106
  </tr>
103
107
  </table>
108
+ <table>
109
+ <tr>
110
+ <td align="center">Code Quality</td>
111
+ <td align="center"><a href="https://www.codefactor.io/repository/github/openscilab/drux"><img src="https://www.codefactor.io/repository/github/openscilab/drux/badge" alt="CodeFactor"></a></td>
112
+ <td align="center"><a href="https://app.codacy.com/gh/openscilab/drux/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/06ed95529d284c81a846205baa1f4c6a"></a></td>
113
+ </tr>
114
+ </table>
104
115
 
105
116
 
106
117
  ## Installation
107
118
 
108
119
  ### PyPI
109
120
  - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
110
- - Run `pip install drux==0.1`
121
+ - Run `pip install drux==0.3`
111
122
  ### Source code
112
- - Download [Version 0.1](https://github.com/openscilab/drux/archive/v0.1.zip) or [Latest Source](https://github.com/openscilab/drux/archive/dev.zip)
123
+ - Download [Version 0.3](https://github.com/openscilab/drux/archive/v0.3.zip) or [Latest Source](https://github.com/openscilab/drux/archive/dev.zip)
113
124
  - Run `pip install .`
114
125
 
115
126
  ## Supported Models
127
+ ### Zero-Order
128
+ The Zero-Order model describes a constant rate of drug release over time. According to this model, the cumulative amount of drug released at time $t$ is given by:
129
+
130
+ $$
131
+ M_t = M_0 + k_0 t
132
+ $$
133
+
134
+ where:
135
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$.
136
+ - $M_0 (mg)$ is the initial amount of drug in the system. $M_0$ defaults to zero in this model.
137
+ - $k_0 (\frac{mg}{s})$ is the zero-order release rate constant.
138
+
139
+ #### Applications
140
+ 1. Tablets with extended release
141
+ 2. Transdermal Patches
142
+ 3. Implantable Device
143
+ 4. Intraocular Implants
144
+ 5. Infusion Systems
145
+
146
+ ### First-Order
147
+ The first-order drug release model describes a process where the rate of drug release is proportional to the remaining amount of drug in the system. According to this model, the cumulative amount of drug released at time $t$ is given by:
148
+
149
+ $$
150
+ M_t = M_0 (1 - e^{-kt})
151
+ $$
152
+
153
+ where:
154
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$.
155
+ - $M_0 (mg)$ is entire releasable amount of drug (the asymptotic maximum).
156
+ - $k (\frac{1}{s})$ is the first-order release rate constant.
157
+
158
+ #### Applications
159
+ 1. Immediate-release tablets and capsules
160
+ 2. Liquid drug formulations (oral solutions, intravenous injections)
161
+ 3. Controlled-release matrix systems
162
+ 4. Elastomeric infusion pumps
163
+
116
164
  ### Higuchi
117
165
  The Higuchi model describes the release of a drug from a matrix system, where the drug diffuses through a porous medium.
118
166
  The Higuchi equation addressed important aspects of drug transport and release from planar
@@ -129,6 +177,7 @@ where:
129
177
  - $c_s (\frac{mg}{cm^3})$ is the solubility of the drug in the polymer (carrier)
130
178
 
131
179
  ⚠️ The Higuchi model assumes that $c_0 \ge c_s$
180
+
132
181
  #### Applications
133
182
  1. Matrix Tablets
134
183
  2. Hydrophilic polymer matrices
@@ -136,7 +185,45 @@ where:
136
185
  4. Semisolid Systems
137
186
  5. Implantable Drug delivery systems
138
187
 
188
+ ### Weibull
189
+ Weibull model is an empirical model used to describe drug release kinetics from various pharmaceutical dosage forms. It is characterized by a flexible empirical equation that captures various release kinetics.
190
+ According to this model, the cumulative amount of drug released at time $t$ is given by:
191
+
192
+ $$
193
+ M_t = M \left(1 - e^{-at^b}\right)
194
+ $$
195
+
196
+ where:
197
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$
198
+ - $M (mg)$ is the total amount of drug released at infinite time
199
+ - $a$ is the scale parameter (related to the release rate)
200
+ - $b$ is the shape parameter (indicates the release mechanism)
201
+
202
+ #### Applications
203
+ 1. Controlled-release modeling
204
+ 2. Dissolution profiling
205
+ 3. Comparative studies
206
+ 4. Vivo predictions
207
+
139
208
  ## Usage
209
+ ### Zero-Order Model
210
+ ```python
211
+ from drux import ZeroOrderModel
212
+ model = ZeroOrderModel(k0=0.1, M0=0)
213
+ model.simulate(duration=1000, time_step=10)
214
+ model.plot(show=True)
215
+ ```
216
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/zero_order_plot.png" alt="Zero-order Plot">
217
+
218
+ ### First-Order Model
219
+ ```python
220
+ from drux import FirstOrderModel
221
+ model = FirstOrderModel(k=0.003, M0=0.1)
222
+ model.simulate(duration=1000, time_step=10)
223
+ model.plot(show=True)
224
+ ```
225
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/first_order_plot.png" alt="First-order Plot">
226
+
140
227
  ### Higuchi Model
141
228
  ```python
142
229
  from drux import HiguchiModel
@@ -146,16 +233,37 @@ model.plot(show=True)
146
233
  ```
147
234
  <img src="https://github.com/openscilab/drux/raw/main/otherfiles/higuchi_plot.png" alt="Higuchi Plot">
148
235
 
236
+ ### Weibull Model
237
+
238
+ ```python
239
+ from drux import WeibullModel
240
+ model = WeibullModel(M=1, a=0.095, b=0.7)
241
+ model.simulate(duration=100, time_step=1)
242
+ model.plot(show=True)
243
+ ```
244
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/weibull_plot.png" alt="Weibull Plot">
245
+
149
246
  ## Issues & bug reports
150
247
 
151
248
  Just fill an issue and describe it. We'll check it ASAP! or send an email to [drux@openscilab.com](mailto:drux@openscilab.com "drux@openscilab.com").
152
249
 
153
250
  - Please complete the issue template
154
251
 
252
+ You can also join our discord server
253
+
254
+ <a href="https://discord.gg/8Rf6bGBtse">
255
+ <img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
256
+ </a>
257
+
258
+
155
259
  ## References
156
260
  <blockquote>1- T. Higuchi, "Rate of release of medicaments from ointment bases containing drugs in suspension," <i>Journal of Pharmaceutical Sciences</i>, vol. 50, no. 10, pp. 874–875, 1961.</blockquote>
157
261
  <blockquote>2- D. R. Paul, "Elaborations on the Higuchi model for drug delivery," <i>International Journal of Pharmaceutics</i>, vol. 418, no. 1, pp. 13–17, 2011.</blockquote>
158
262
  <blockquote>3- R. T. Medarametla, K. V. Gopaiah, J. N. Suresh Kumar, G. Anand Babu, M. Shaggir, G. Raghavendra, D. Naveen Reddy, and B. Venkamma, "Drug Release Kinetics and Mathematical Models," <i>International Journal of Science and Research Methodology</i>, vol. 27, no. 9, pp. 12–19, Sep. 2024.</blockquote>
263
+ <blockquote>4- R. Vaju and K. V. Murthy, "Development and validation of new discriminative dissolution method for carvedilol tablets," <i>Indian Journal of Pharmaceutical Sciences</i>, vol. 73, no. 5, pp. 527–536, Sep. 2011.</blockquote>
264
+ <blockquote>5- S. Dash, "Kinetic modeling on drug release from controlled drug delivery systems," <i>Acta Poloniae Pharmaceutica</i>, 2010.</blockquote>
265
+ <blockquote>6- K. H. Ramteke, P. A. Dighe, A. R. Kharat, S. V. Patil, <i>Mathematical models of drug dissolution: A review</i>, <i>Sch. Acad. J. Pharm.</i>, vol. 3, no. 5, pp. 388-396, 2014.</blockquote>
266
+ <blockquote>7- C. Corsaro, G. Neri, A. M. Mezzasalma, and E. Fazio, "Weibull modeling of controlled drug release from Ag-PMA nanosystems," <i>Polymers</i>, vol. 13, no. 17, p. 2897, 2021.</blockquote>
159
267
 
160
268
  ## Show your support
161
269
  ### Star this repo
@@ -174,11 +282,30 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
174
282
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
175
283
 
176
284
  ## [Unreleased]
285
+ ## [0.3] - 2025-12-08
286
+ ### Added
287
+ - Weibull model
288
+ - Logo
289
+ - `__repr__` method for models
290
+ ### Changed
291
+ - `Python 3.14` added to `test.yml`
292
+ ## [0.2] - 2025-09-27
293
+ ### Added
294
+ - Zero-order model
295
+ - First-order model
296
+ ### Changed
297
+ - `README.md` modified
298
+ - Test system modified
299
+ - Release range bug in `time_for_release` fixed
300
+ - `matplotlib` import bug fixed
301
+ - `plot` method modified
177
302
  ## [0.1] - 2025-07-27
178
303
  ### Added
179
304
  - Base model
180
305
  - Higuchi model
181
306
 
182
307
 
183
- [Unreleased]: https://github.com/openscilab/drux/compare/v0.1...dev
308
+ [Unreleased]: https://github.com/openscilab/drux/compare/v0.3...dev
309
+ [0.3]: https://github.com/openscilab/drux/compare/v0.2...v0.3
310
+ [0.2]: https://github.com/openscilab/drux/compare/v0.1...v0.2
184
311
  [0.1]: https://github.com/openscilab/drux/compare/48548f0...v0.1
drux-0.3/README.md ADDED
@@ -0,0 +1,221 @@
1
+ <div align="center">
2
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/logo.png" width="350">
3
+ <h1>Drux: Drug Release Analysis Framework</h1>
4
+ <br/>
5
+ <a href="https://badge.fury.io/py/drux"><img src="https://badge.fury.io/py/drux.svg" alt="PyPI version"></a>
6
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
7
+ <a href="https://codecov.io/gh/openscilab/drux"><img src="https://codecov.io/gh/openscilab/drux/branch/dev/graph/badge.svg?token=5O41J3XX2L"></a>
8
+ <a href="https://github.com/openscilab/drux"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/drux"></a>
9
+ <a href="https://discord.gg/8Rf6bGBtse"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>
10
+ </div>
11
+
12
+ ----------
13
+
14
+
15
+ ## Overview
16
+ <p align="justify">
17
+ Drux is a Python-based framework for simulating drug release profiles using mathematical models. It offers a reproducible and extensible platform to model, analyze, and visualize time-dependent drug release behavior, making it ideal for pharmaceutical research and development. By combining simplicity with scientific rigor, Drux provides a robust foundation for quantitative analysis of drug delivery kinetics.
18
+ </p>
19
+ <table>
20
+ <tr>
21
+ <td align="center">PyPI Counter</td>
22
+ <td align="center">
23
+ <a href="https://pepy.tech/projects/drux">
24
+ <img src="https://static.pepy.tech/badge/drux">
25
+ </a>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td align="center">Github Stars</td>
30
+ <td align="center">
31
+ <a href="https://github.com/openscilab/drux">
32
+ <img src="https://img.shields.io/github/stars/openscilab/drux.svg?style=social&label=Stars">
33
+ </a>
34
+ </td>
35
+ </tr>
36
+ </table>
37
+ <table>
38
+ <tr>
39
+ <td align="center">Branch</td>
40
+ <td align="center">main</td>
41
+ <td align="center">dev</td>
42
+ </tr>
43
+ <tr>
44
+ <td align="center">CI</td>
45
+ <td align="center">
46
+ <img src="https://github.com/openscilab/drux/actions/workflows/test.yml/badge.svg?branch=main">
47
+ </td>
48
+ <td align="center">
49
+ <img src="https://github.com/openscilab/drux/actions/workflows/test.yml/badge.svg?branch=dev">
50
+ </td>
51
+ </tr>
52
+ </table>
53
+ <table>
54
+ <tr>
55
+ <td align="center">Code Quality</td>
56
+ <td align="center"><a href="https://www.codefactor.io/repository/github/openscilab/drux"><img src="https://www.codefactor.io/repository/github/openscilab/drux/badge" alt="CodeFactor"></a></td>
57
+ <td align="center"><a href="https://app.codacy.com/gh/openscilab/drux/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/06ed95529d284c81a846205baa1f4c6a"></a></td>
58
+ </tr>
59
+ </table>
60
+
61
+
62
+ ## Installation
63
+
64
+ ### PyPI
65
+ - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
66
+ - Run `pip install drux==0.3`
67
+ ### Source code
68
+ - Download [Version 0.3](https://github.com/openscilab/drux/archive/v0.3.zip) or [Latest Source](https://github.com/openscilab/drux/archive/dev.zip)
69
+ - Run `pip install .`
70
+
71
+ ## Supported Models
72
+ ### Zero-Order
73
+ The Zero-Order model describes a constant rate of drug release over time. According to this model, the cumulative amount of drug released at time $t$ is given by:
74
+
75
+ $$
76
+ M_t = M_0 + k_0 t
77
+ $$
78
+
79
+ where:
80
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$.
81
+ - $M_0 (mg)$ is the initial amount of drug in the system. $M_0$ defaults to zero in this model.
82
+ - $k_0 (\frac{mg}{s})$ is the zero-order release rate constant.
83
+
84
+ #### Applications
85
+ 1. Tablets with extended release
86
+ 2. Transdermal Patches
87
+ 3. Implantable Device
88
+ 4. Intraocular Implants
89
+ 5. Infusion Systems
90
+
91
+ ### First-Order
92
+ The first-order drug release model describes a process where the rate of drug release is proportional to the remaining amount of drug in the system. According to this model, the cumulative amount of drug released at time $t$ is given by:
93
+
94
+ $$
95
+ M_t = M_0 (1 - e^{-kt})
96
+ $$
97
+
98
+ where:
99
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$.
100
+ - $M_0 (mg)$ is entire releasable amount of drug (the asymptotic maximum).
101
+ - $k (\frac{1}{s})$ is the first-order release rate constant.
102
+
103
+ #### Applications
104
+ 1. Immediate-release tablets and capsules
105
+ 2. Liquid drug formulations (oral solutions, intravenous injections)
106
+ 3. Controlled-release matrix systems
107
+ 4. Elastomeric infusion pumps
108
+
109
+ ### Higuchi
110
+ The Higuchi model describes the release of a drug from a matrix system, where the drug diffuses through a porous medium.
111
+ The Higuchi equation addressed important aspects of drug transport and release from planar
112
+ devices. According to this model, the cumulative amount of drug released at time $t$ is given by:
113
+
114
+ $$
115
+ M_t = \sqrt{D(2c_0 - c_s)c_st}
116
+ $$
117
+
118
+ where:
119
+ - $M_t (\frac{mg}{cm^2})$ is the cumulative absolute amount of drug released at time $t$
120
+ - $D ({\frac{cm^2}{s}})$ is the drug diffusivity in the polymer carrier
121
+ - $c_0 (\frac{mg}{cm^3})$ is the initial drug concentration (total concentration of drug in the matrix)
122
+ - $c_s (\frac{mg}{cm^3})$ is the solubility of the drug in the polymer (carrier)
123
+
124
+ ⚠️ The Higuchi model assumes that $c_0 \ge c_s$
125
+
126
+ #### Applications
127
+ 1. Matrix Tablets
128
+ 2. Hydrophilic polymer matrices
129
+ 3. Controlled - Release Microspheres
130
+ 4. Semisolid Systems
131
+ 5. Implantable Drug delivery systems
132
+
133
+ ### Weibull
134
+ Weibull model is an empirical model used to describe drug release kinetics from various pharmaceutical dosage forms. It is characterized by a flexible empirical equation that captures various release kinetics.
135
+ According to this model, the cumulative amount of drug released at time $t$ is given by:
136
+
137
+ $$
138
+ M_t = M \left(1 - e^{-at^b}\right)
139
+ $$
140
+
141
+ where:
142
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$
143
+ - $M (mg)$ is the total amount of drug released at infinite time
144
+ - $a$ is the scale parameter (related to the release rate)
145
+ - $b$ is the shape parameter (indicates the release mechanism)
146
+
147
+ #### Applications
148
+ 1. Controlled-release modeling
149
+ 2. Dissolution profiling
150
+ 3. Comparative studies
151
+ 4. Vivo predictions
152
+
153
+ ## Usage
154
+ ### Zero-Order Model
155
+ ```python
156
+ from drux import ZeroOrderModel
157
+ model = ZeroOrderModel(k0=0.1, M0=0)
158
+ model.simulate(duration=1000, time_step=10)
159
+ model.plot(show=True)
160
+ ```
161
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/zero_order_plot.png" alt="Zero-order Plot">
162
+
163
+ ### First-Order Model
164
+ ```python
165
+ from drux import FirstOrderModel
166
+ model = FirstOrderModel(k=0.003, M0=0.1)
167
+ model.simulate(duration=1000, time_step=10)
168
+ model.plot(show=True)
169
+ ```
170
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/first_order_plot.png" alt="First-order Plot">
171
+
172
+ ### Higuchi Model
173
+ ```python
174
+ from drux import HiguchiModel
175
+ model = HiguchiModel(D=1e-6, c0=1, cs=0.5)
176
+ model.simulate(duration=1000, time_step=10)
177
+ model.plot(show=True)
178
+ ```
179
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/higuchi_plot.png" alt="Higuchi Plot">
180
+
181
+ ### Weibull Model
182
+
183
+ ```python
184
+ from drux import WeibullModel
185
+ model = WeibullModel(M=1, a=0.095, b=0.7)
186
+ model.simulate(duration=100, time_step=1)
187
+ model.plot(show=True)
188
+ ```
189
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/weibull_plot.png" alt="Weibull Plot">
190
+
191
+ ## Issues & bug reports
192
+
193
+ Just fill an issue and describe it. We'll check it ASAP! or send an email to [drux@openscilab.com](mailto:drux@openscilab.com "drux@openscilab.com").
194
+
195
+ - Please complete the issue template
196
+
197
+ You can also join our discord server
198
+
199
+ <a href="https://discord.gg/8Rf6bGBtse">
200
+ <img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
201
+ </a>
202
+
203
+
204
+ ## References
205
+ <blockquote>1- T. Higuchi, "Rate of release of medicaments from ointment bases containing drugs in suspension," <i>Journal of Pharmaceutical Sciences</i>, vol. 50, no. 10, pp. 874–875, 1961.</blockquote>
206
+ <blockquote>2- D. R. Paul, "Elaborations on the Higuchi model for drug delivery," <i>International Journal of Pharmaceutics</i>, vol. 418, no. 1, pp. 13–17, 2011.</blockquote>
207
+ <blockquote>3- R. T. Medarametla, K. V. Gopaiah, J. N. Suresh Kumar, G. Anand Babu, M. Shaggir, G. Raghavendra, D. Naveen Reddy, and B. Venkamma, "Drug Release Kinetics and Mathematical Models," <i>International Journal of Science and Research Methodology</i>, vol. 27, no. 9, pp. 12–19, Sep. 2024.</blockquote>
208
+ <blockquote>4- R. Vaju and K. V. Murthy, "Development and validation of new discriminative dissolution method for carvedilol tablets," <i>Indian Journal of Pharmaceutical Sciences</i>, vol. 73, no. 5, pp. 527–536, Sep. 2011.</blockquote>
209
+ <blockquote>5- S. Dash, "Kinetic modeling on drug release from controlled drug delivery systems," <i>Acta Poloniae Pharmaceutica</i>, 2010.</blockquote>
210
+ <blockquote>6- K. H. Ramteke, P. A. Dighe, A. R. Kharat, S. V. Patil, <i>Mathematical models of drug dissolution: A review</i>, <i>Sch. Acad. J. Pharm.</i>, vol. 3, no. 5, pp. 388-396, 2014.</blockquote>
211
+ <blockquote>7- C. Corsaro, G. Neri, A. M. Mezzasalma, and E. Fazio, "Weibull modeling of controlled drug release from Ag-PMA nanosystems," <i>Polymers</i>, vol. 13, no. 17, p. 2897, 2021.</blockquote>
212
+
213
+ ## Show your support
214
+ ### Star this repo
215
+
216
+ Give a ⭐️ if this project helped you!
217
+
218
+ ### Donate to our project
219
+ If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .
220
+
221
+ <a href="https://openscilab.com/#donation" target="_blank"><img src="https://github.com/openscilab/drux/raw/main/otherfiles/donation.png" height="90px" width="270px" alt="Drux Donation"></a>
@@ -0,0 +1,10 @@
1
+ # -*- coding: utf-8 -*-
2
+ """Drux modules."""
3
+
4
+ from .params import DRUX_VERSION
5
+ from .higuchi import HiguchiModel, HiguchiParameters
6
+ from .zero_order import ZeroOrderModel, ZeroOrderParameters
7
+ from .first_order import FirstOrderModel, FirstOrderParameters
8
+ from .weibull import WeibullModel, WeibullParameters
9
+
10
+ __version__ = DRUX_VERSION
@@ -1,8 +1,9 @@
1
1
  """This file contains the abstract base class for drug release models."""
2
2
 
3
3
  import numpy as np
4
+ import matplotlib.pyplot as plt
4
5
  from abc import ABC, abstractmethod
5
- from typing import Any
6
+ from typing import Any, Optional
6
7
 
7
8
  from .messages import (
8
9
  ERROR_TARGET_RELEASE_RANGE,
@@ -11,7 +12,6 @@ from .messages import (
11
12
  ERROR_NO_SIMULATION_DATA,
12
13
  ERROR_RELEASE_PROFILE_TOO_SHORT,
13
14
  ERROR_TARGET_RELEASE_EXCEEDS_MAX,
14
- MATPLOT_IMPORT_ERROR,
15
15
  )
16
16
 
17
17
 
@@ -29,8 +29,13 @@ class DrugReleaseModel(ABC):
29
29
 
30
30
  def __init__(self):
31
31
  """Initialize the drug release model."""
32
- self.time_points = None
33
- self.release_profile = None
32
+ self._time_points = None
33
+ self._release_profile = None
34
+ self._plot_parameters = {
35
+ "xlabel": "Time (s)",
36
+ "ylabel": "Cumulative Release",
37
+ "title": "Drug Release Profile",
38
+ "label": "Release Profile"}
34
39
 
35
40
  @abstractmethod
36
41
  def _validate_parameters(self) -> None:
@@ -52,25 +57,19 @@ class DrugReleaseModel(ABC):
52
57
 
53
58
  def _get_release_profile(self) -> np.ndarray:
54
59
  """Calculate the drug release profile over the specified time points."""
55
- return np.vectorize(self._model_function)(self.time_points)
60
+ return np.vectorize(self._model_function)(self._time_points)
56
61
 
57
62
  def _validate_plot(self) -> tuple:
58
63
  """
59
64
  Validate plotting process.
60
65
 
61
- :raises ImportError: if matplotlib is not installed
62
66
  :raises ValueError: if simulation data is not available
63
67
  :raises ValueError: if release profile is too short
64
68
  """
65
- try:
66
- import matplotlib.pyplot as plt
67
- except ImportError:
68
- raise ImportError(MATPLOT_IMPORT_ERROR)
69
-
70
- if self.time_points is None or self.release_profile is None:
69
+ if self._time_points is None or self._release_profile is None:
71
70
  raise ValueError(ERROR_NO_SIMULATION_DATA)
72
71
 
73
- if len(self.release_profile) < 2:
72
+ if len(self._release_profile) < 2:
74
73
  raise ValueError(ERROR_RELEASE_PROFILE_TOO_SHORT)
75
74
  fig, ax = plt.subplots()
76
75
  return fig, ax
@@ -86,27 +85,38 @@ class DrugReleaseModel(ABC):
86
85
  raise ValueError(ERROR_DURATION_TIME_STEP_POSITIVE)
87
86
  if time_step > duration:
88
87
  raise ValueError(ERROR_TIME_STEP_GREATER_THAN_DURATION)
89
- self.time_points = np.arange(0, duration + time_step, time_step)
88
+ self._time_points = np.arange(0, duration + time_step, time_step)
90
89
  self._validate_parameters()
91
- self.release_profile = self._get_release_profile()
92
- return self.release_profile
93
-
94
- def plot(self, show: bool = True, **kwargs: Any) -> tuple:
90
+ self._release_profile = self._get_release_profile()
91
+ return self._release_profile
92
+
93
+ def plot(
94
+ self,
95
+ show: bool = True,
96
+ label: Optional[str] = None,
97
+ xlabel: Optional[str] = None,
98
+ ylabel: Optional[str] = None,
99
+ title: Optional[str] = None,
100
+ **kwargs: Any) -> tuple:
95
101
  """
96
102
  Plot the drug release profile.
97
103
 
98
104
  :param show: Whether to display the plot (default: True)
105
+ :param label: The legend label for the release profile curve
106
+ :param xlabel: Label for the x-axis
107
+ :param ylabel: Label for the y-axis
108
+ :param title: Title of the plot
99
109
  """
100
110
  # Create a new figure and axis if not provided
101
111
  fig, ax = self._validate_plot()
102
112
 
103
113
  # Plotting the release profile
104
114
  ax.plot(
105
- self.time_points, self.release_profile, label="Release Profile", **kwargs
115
+ self._time_points, self._release_profile, label=label or self._plot_parameters["label"], **kwargs
106
116
  )
107
- ax.set_xlabel("Time (s)")
108
- ax.set_ylabel("Cumulative Release")
109
- ax.set_title("Drug Release Profile")
117
+ ax.set_xlabel(xlabel or self._plot_parameters["xlabel"])
118
+ ax.set_ylabel(ylabel or self._plot_parameters["ylabel"])
119
+ ax.set_title(title or self._plot_parameters["title"])
110
120
  ax.grid()
111
121
  ax.legend()
112
122
 
@@ -118,35 +128,35 @@ class DrugReleaseModel(ABC):
118
128
 
119
129
  def get_release_rate(self) -> np.ndarray:
120
130
  """Calculate the instantaneous release rate (derivative of release profile)."""
121
- if self.time_points is None or self.release_profile is None:
131
+ if self._time_points is None or self._release_profile is None:
122
132
  raise ValueError(ERROR_NO_SIMULATION_DATA)
123
133
 
124
- if len(self.release_profile) < 2:
134
+ if len(self._release_profile) < 2:
125
135
  raise ValueError(ERROR_RELEASE_PROFILE_TOO_SHORT)
126
136
 
127
137
  # Calculate the derivative of the release profile
128
- release_rate = np.gradient(self.release_profile, self.time_points)
138
+ release_rate = np.gradient(self._release_profile, self._time_points)
129
139
  return release_rate
130
140
 
131
141
  def time_for_release(self, target_release: float) -> float:
132
142
  """
133
143
  Estimate time needed to reach a specific release percentage.
134
144
 
135
- :param target_release: target release fraction (0-1)
145
+ :param target_release: target release fraction (>= 0)
136
146
 
137
- :raises ValueError: if target_release is not between 0 and 1
147
+ :raises ValueError: if target_release is negative
138
148
  :raises ValueError: if simulation data is not available
139
149
  :raises ValueError: if target_release exceeds maximum release
140
150
  """
141
- if self.time_points is None or self.release_profile is None:
151
+ if self._time_points is None or self._release_profile is None:
142
152
  raise ValueError(ERROR_NO_SIMULATION_DATA)
143
153
 
144
- if target_release < 0 or target_release > 1:
154
+ if target_release < 0:
145
155
  raise ValueError(ERROR_TARGET_RELEASE_RANGE)
146
156
 
147
- if target_release > self.release_profile[-1]:
157
+ if target_release > self._release_profile[-1]:
148
158
  raise ValueError(ERROR_TARGET_RELEASE_EXCEEDS_MAX)
149
159
 
150
160
  # Find first time point where release >= target
151
- idx = np.argmax(self.release_profile >= target_release)
152
- return self.time_points[idx]
161
+ idx = np.argmax(self._release_profile >= target_release)
162
+ return self._time_points[idx]