drux 0.0.0__tar.gz → 0.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.
drux-0.2/AUTHORS.md ADDED
@@ -0,0 +1,15 @@
1
+ # Core Developers
2
+ ----------
3
+ - Alireza Zolanvari - Open Science Laboratory ([Github](https://github.com/alirezazolanvari)) **
4
+ - Sepand Haghighi - Open Science Laboratory ([Github](https://github.com/sepandhaghighi)) **
5
+ - Sarmin Hamidi - Open Science Laboratory ([Github](https://github.com/sarminh))
6
+ - Nazanin Nabinia - Open Science Laboratory ([Github](https://github.com/nazanin-nabi))
7
+ - Sadra Sabouri - Open Science Laboratory ([Github](https://github.com/sadrasabouri))
8
+
9
+
10
+ ** **Maintainer**
11
+
12
+ # Other Contributors
13
+ ----------
14
+
15
+
drux-0.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 OpenSciLab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
drux-0.2/PKG-INFO ADDED
@@ -0,0 +1,269 @@
1
+ Metadata-Version: 2.4
2
+ Name: drux
3
+ Version: 0.2
4
+ Summary: Drux: Drug Release Analysis Framework
5
+ Home-page: https://github.com/openscilab/drux
6
+ Download-URL: https://github.com/openscilab/drux/tarball/v0.2
7
+ Author: Drux Development Team
8
+ Author-email: drux@openscilab.com
9
+ License: MIT
10
+ Project-URL: Source, https://github.com/openscilab/drux
11
+ Keywords: drug-release drug-delivery mathematical-modeling simulation kinetics
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Natural Language :: English
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Intended Audience :: Developers
24
+ Classifier: Intended Audience :: Education
25
+ Classifier: Intended Audience :: End Users/Desktop
26
+ Classifier: Intended Audience :: Manufacturing
27
+ Classifier: Intended Audience :: Science/Research
28
+ Classifier: Topic :: Education
29
+ Classifier: Topic :: Scientific/Engineering
30
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
31
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
32
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
33
+ Requires-Python: >=3.7
34
+ Description-Content-Type: text/markdown
35
+ License-File: LICENSE
36
+ License-File: AUTHORS.md
37
+ Requires-Dist: numpy>=1.21.0
38
+ Requires-Dist: matplotlib>=3.2.2
39
+ Dynamic: author
40
+ Dynamic: author-email
41
+ Dynamic: classifier
42
+ Dynamic: description
43
+ Dynamic: description-content-type
44
+ Dynamic: download-url
45
+ Dynamic: home-page
46
+ Dynamic: keywords
47
+ Dynamic: license
48
+ Dynamic: license-file
49
+ Dynamic: project-url
50
+ Dynamic: requires-dist
51
+ Dynamic: requires-python
52
+ Dynamic: summary
53
+
54
+
55
+ <div align="center">
56
+ <h1>Drux: Drug Release Analysis Framework</h1>
57
+ <br/>
58
+ <a href="https://badge.fury.io/py/drux"><img src="https://badge.fury.io/py/drux.svg" alt="PyPI version"></a>
59
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
60
+ <a href="https://codecov.io/gh/openscilab/drux"><img src="https://codecov.io/gh/openscilab/drux/branch/dev/graph/badge.svg?token=5O41J3XX2L"></a>
61
+ <a href="https://github.com/openscilab/drux"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/drux"></a>
62
+ <a href="https://discord.gg/8Rf6bGBtse"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>
63
+ </div>
64
+
65
+ ----------
66
+
67
+
68
+ ## Overview
69
+ <p align="justify">
70
+ 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.
71
+ </p>
72
+ <table>
73
+ <tr>
74
+ <td align="center">PyPI Counter</td>
75
+ <td align="center">
76
+ <a href="https://pepy.tech/projects/drux">
77
+ <img src="https://static.pepy.tech/badge/drux">
78
+ </a>
79
+ </td>
80
+ </tr>
81
+ <tr>
82
+ <td align="center">Github Stars</td>
83
+ <td align="center">
84
+ <a href="https://github.com/openscilab/drux">
85
+ <img src="https://img.shields.io/github/stars/openscilab/drux.svg?style=social&label=Stars">
86
+ </a>
87
+ </td>
88
+ </tr>
89
+ </table>
90
+ <table>
91
+ <tr>
92
+ <td align="center">Branch</td>
93
+ <td align="center">main</td>
94
+ <td align="center">dev</td>
95
+ </tr>
96
+ <tr>
97
+ <td align="center">CI</td>
98
+ <td align="center">
99
+ <img src="https://github.com/openscilab/drux/actions/workflows/test.yml/badge.svg?branch=main">
100
+ </td>
101
+ <td align="center">
102
+ <img src="https://github.com/openscilab/drux/actions/workflows/test.yml/badge.svg?branch=dev">
103
+ </td>
104
+ </tr>
105
+ </table>
106
+ <table>
107
+ <tr>
108
+ <td align="center">Code Quality</td>
109
+ <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>
110
+ <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>
111
+ </tr>
112
+ </table>
113
+
114
+
115
+ ## Installation
116
+
117
+ ### PyPI
118
+ - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
119
+ - Run `pip install drux==0.2`
120
+ ### Source code
121
+ - Download [Version 0.2](https://github.com/openscilab/drux/archive/v0.2.zip) or [Latest Source](https://github.com/openscilab/drux/archive/dev.zip)
122
+ - Run `pip install .`
123
+
124
+ ## Supported Models
125
+ ### Zero-Order
126
+ 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:
127
+
128
+ $$
129
+ M_t = M_0 + k_0 t
130
+ $$
131
+
132
+ where:
133
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$.
134
+ - $M_0 (mg)$ is the initial amount of drug in the system. $M_0$ defaults to zero in this model.
135
+ - $k_0 (\frac{mg}{s})$ is the zero-order release rate constant.
136
+
137
+ #### Applications
138
+ 1. Tablets with extended release
139
+ 2. Transdermal Patches
140
+ 3. Implantable Device
141
+ 4. Intraocular Implants
142
+ 5. Infusion Systems
143
+
144
+ ### First-Order
145
+ 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:
146
+
147
+ $$
148
+ M_t = M_0 (1 - e^{-kt})
149
+ $$
150
+
151
+ where:
152
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$.
153
+ - $M_0 (mg)$ is entire releasable amount of drug (the asymptotic maximum).
154
+ - $k (\frac{1}{s})$ is the first-order release rate constant.
155
+
156
+ #### Applications
157
+ 1. Immediate-release tablets and capsules
158
+ 2. Liquid drug formulations (oral solutions, intravenous injections)
159
+ 3. Controlled-release matrix systems
160
+ 4. Elastomeric infusion pumps
161
+
162
+ ### Higuchi
163
+ The Higuchi model describes the release of a drug from a matrix system, where the drug diffuses through a porous medium.
164
+ The Higuchi equation addressed important aspects of drug transport and release from planar
165
+ devices. According to this model, the cumulative amount of drug released at time $t$ is given by:
166
+
167
+ $$
168
+ M_t = \sqrt{D(2c_0 - c_s)c_st}
169
+ $$
170
+
171
+ where:
172
+ - $M_t (\frac{mg}{cm^2})$ is the cumulative absolute amount of drug released at time $t$
173
+ - $D ({\frac{cm^2}{s}})$ is the drug diffusivity in the polymer carrier
174
+ - $c_0 (\frac{mg}{cm^3})$ is the initial drug concentration (total concentration of drug in the matrix)
175
+ - $c_s (\frac{mg}{cm^3})$ is the solubility of the drug in the polymer (carrier)
176
+
177
+ ⚠️ The Higuchi model assumes that $c_0 \ge c_s$
178
+ #### Applications
179
+ 1. Matrix Tablets
180
+ 2. Hydrophilic polymer matrices
181
+ 3. Controlled - Release Microspheres
182
+ 4. Semisolid Systems
183
+ 5. Implantable Drug delivery systems
184
+
185
+ ## Usage
186
+ ### Zero-Order Model
187
+ ```python
188
+ from drux import ZeroOrderModel
189
+ model = ZeroOrderModel(k0=0.1, M0=0)
190
+ model.simulate(duration=1000, time_step=10)
191
+ model.plot(show=True)
192
+ ```
193
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/zero_order_plot.png" alt="Zero-order Plot">
194
+
195
+ ### First-Order Model
196
+ ```python
197
+ from drux import FirstOrderModel
198
+ model = FirstOrderModel(k=0.003, M0=0.1)
199
+ model.simulate(duration=1000, time_step=10)
200
+ model.plot(show=True)
201
+ ```
202
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/first_order_plot.png" alt="First-order Plot">
203
+
204
+ ### Higuchi Model
205
+ ```python
206
+ from drux import HiguchiModel
207
+ model = HiguchiModel(D=1e-6, c0=1, cs=0.5)
208
+ model.simulate(duration=1000, time_step=10)
209
+ model.plot(show=True)
210
+ ```
211
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/higuchi_plot.png" alt="Higuchi Plot">
212
+
213
+ ## Issues & bug reports
214
+
215
+ 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").
216
+
217
+ - Please complete the issue template
218
+
219
+ You can also join our discord server
220
+
221
+ <a href="https://discord.gg/8Rf6bGBtse">
222
+ <img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
223
+ </a>
224
+
225
+
226
+ ## References
227
+ <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>
228
+ <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>
229
+ <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>
230
+ <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>
231
+ <blockquote>5- S. Dash, "Kinetic modeling on drug release from controlled drug delivery systems," <i>Acta Poloniae Pharmaceutica</i>, 2010.</blockquote>
232
+ <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>
233
+
234
+ ## Show your support
235
+ ### Star this repo
236
+
237
+ Give a ⭐️ if this project helped you!
238
+
239
+ ### Donate to our project
240
+ 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 ;-) .
241
+
242
+ <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>
243
+
244
+ # Changelog
245
+ All notable changes to this project will be documented in this file.
246
+
247
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
248
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
249
+
250
+ ## [Unreleased]
251
+ ## [0.2] - 2025-09-27
252
+ ### Added
253
+ - Zero-order model
254
+ - First-order model
255
+ ### Changed
256
+ - `README.md` modified
257
+ - Test system modified
258
+ - Release range bug in `time_for_release` fixed
259
+ - `matplotlib` import bug fixed
260
+ - `plot` method modified
261
+ ## [0.1] - 2025-07-27
262
+ ### Added
263
+ - Base model
264
+ - Higuchi model
265
+
266
+
267
+ [Unreleased]: https://github.com/openscilab/drux/compare/v0.2...dev
268
+ [0.2]: https://github.com/openscilab/drux/compare/v0.1...v0.2
269
+ [0.1]: https://github.com/openscilab/drux/compare/48548f0...v0.1
drux-0.2/README.md ADDED
@@ -0,0 +1,188 @@
1
+ <div align="center">
2
+ <h1>Drux: Drug Release Analysis Framework</h1>
3
+ <br/>
4
+ <a href="https://badge.fury.io/py/drux"><img src="https://badge.fury.io/py/drux.svg" alt="PyPI version"></a>
5
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
6
+ <a href="https://codecov.io/gh/openscilab/drux"><img src="https://codecov.io/gh/openscilab/drux/branch/dev/graph/badge.svg?token=5O41J3XX2L"></a>
7
+ <a href="https://github.com/openscilab/drux"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/drux"></a>
8
+ <a href="https://discord.gg/8Rf6bGBtse"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>
9
+ </div>
10
+
11
+ ----------
12
+
13
+
14
+ ## Overview
15
+ <p align="justify">
16
+ 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.
17
+ </p>
18
+ <table>
19
+ <tr>
20
+ <td align="center">PyPI Counter</td>
21
+ <td align="center">
22
+ <a href="https://pepy.tech/projects/drux">
23
+ <img src="https://static.pepy.tech/badge/drux">
24
+ </a>
25
+ </td>
26
+ </tr>
27
+ <tr>
28
+ <td align="center">Github Stars</td>
29
+ <td align="center">
30
+ <a href="https://github.com/openscilab/drux">
31
+ <img src="https://img.shields.io/github/stars/openscilab/drux.svg?style=social&label=Stars">
32
+ </a>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+ <table>
37
+ <tr>
38
+ <td align="center">Branch</td>
39
+ <td align="center">main</td>
40
+ <td align="center">dev</td>
41
+ </tr>
42
+ <tr>
43
+ <td align="center">CI</td>
44
+ <td align="center">
45
+ <img src="https://github.com/openscilab/drux/actions/workflows/test.yml/badge.svg?branch=main">
46
+ </td>
47
+ <td align="center">
48
+ <img src="https://github.com/openscilab/drux/actions/workflows/test.yml/badge.svg?branch=dev">
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ <table>
53
+ <tr>
54
+ <td align="center">Code Quality</td>
55
+ <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>
56
+ <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>
57
+ </tr>
58
+ </table>
59
+
60
+
61
+ ## Installation
62
+
63
+ ### PyPI
64
+ - Check [Python Packaging User Guide](https://packaging.python.org/installing/)
65
+ - Run `pip install drux==0.2`
66
+ ### Source code
67
+ - Download [Version 0.2](https://github.com/openscilab/drux/archive/v0.2.zip) or [Latest Source](https://github.com/openscilab/drux/archive/dev.zip)
68
+ - Run `pip install .`
69
+
70
+ ## Supported Models
71
+ ### Zero-Order
72
+ 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:
73
+
74
+ $$
75
+ M_t = M_0 + k_0 t
76
+ $$
77
+
78
+ where:
79
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$.
80
+ - $M_0 (mg)$ is the initial amount of drug in the system. $M_0$ defaults to zero in this model.
81
+ - $k_0 (\frac{mg}{s})$ is the zero-order release rate constant.
82
+
83
+ #### Applications
84
+ 1. Tablets with extended release
85
+ 2. Transdermal Patches
86
+ 3. Implantable Device
87
+ 4. Intraocular Implants
88
+ 5. Infusion Systems
89
+
90
+ ### First-Order
91
+ 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:
92
+
93
+ $$
94
+ M_t = M_0 (1 - e^{-kt})
95
+ $$
96
+
97
+ where:
98
+ - $M_t (mg)$ is the cumulative absolute amount of drug released at time $t$.
99
+ - $M_0 (mg)$ is entire releasable amount of drug (the asymptotic maximum).
100
+ - $k (\frac{1}{s})$ is the first-order release rate constant.
101
+
102
+ #### Applications
103
+ 1. Immediate-release tablets and capsules
104
+ 2. Liquid drug formulations (oral solutions, intravenous injections)
105
+ 3. Controlled-release matrix systems
106
+ 4. Elastomeric infusion pumps
107
+
108
+ ### Higuchi
109
+ The Higuchi model describes the release of a drug from a matrix system, where the drug diffuses through a porous medium.
110
+ The Higuchi equation addressed important aspects of drug transport and release from planar
111
+ devices. According to this model, the cumulative amount of drug released at time $t$ is given by:
112
+
113
+ $$
114
+ M_t = \sqrt{D(2c_0 - c_s)c_st}
115
+ $$
116
+
117
+ where:
118
+ - $M_t (\frac{mg}{cm^2})$ is the cumulative absolute amount of drug released at time $t$
119
+ - $D ({\frac{cm^2}{s}})$ is the drug diffusivity in the polymer carrier
120
+ - $c_0 (\frac{mg}{cm^3})$ is the initial drug concentration (total concentration of drug in the matrix)
121
+ - $c_s (\frac{mg}{cm^3})$ is the solubility of the drug in the polymer (carrier)
122
+
123
+ ⚠️ The Higuchi model assumes that $c_0 \ge c_s$
124
+ #### Applications
125
+ 1. Matrix Tablets
126
+ 2. Hydrophilic polymer matrices
127
+ 3. Controlled - Release Microspheres
128
+ 4. Semisolid Systems
129
+ 5. Implantable Drug delivery systems
130
+
131
+ ## Usage
132
+ ### Zero-Order Model
133
+ ```python
134
+ from drux import ZeroOrderModel
135
+ model = ZeroOrderModel(k0=0.1, M0=0)
136
+ model.simulate(duration=1000, time_step=10)
137
+ model.plot(show=True)
138
+ ```
139
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/zero_order_plot.png" alt="Zero-order Plot">
140
+
141
+ ### First-Order Model
142
+ ```python
143
+ from drux import FirstOrderModel
144
+ model = FirstOrderModel(k=0.003, M0=0.1)
145
+ model.simulate(duration=1000, time_step=10)
146
+ model.plot(show=True)
147
+ ```
148
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/first_order_plot.png" alt="First-order Plot">
149
+
150
+ ### Higuchi Model
151
+ ```python
152
+ from drux import HiguchiModel
153
+ model = HiguchiModel(D=1e-6, c0=1, cs=0.5)
154
+ model.simulate(duration=1000, time_step=10)
155
+ model.plot(show=True)
156
+ ```
157
+ <img src="https://github.com/openscilab/drux/raw/main/otherfiles/higuchi_plot.png" alt="Higuchi Plot">
158
+
159
+ ## Issues & bug reports
160
+
161
+ 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").
162
+
163
+ - Please complete the issue template
164
+
165
+ You can also join our discord server
166
+
167
+ <a href="https://discord.gg/8Rf6bGBtse">
168
+ <img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
169
+ </a>
170
+
171
+
172
+ ## References
173
+ <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>
174
+ <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>
175
+ <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>
176
+ <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>
177
+ <blockquote>5- S. Dash, "Kinetic modeling on drug release from controlled drug delivery systems," <i>Acta Poloniae Pharmaceutica</i>, 2010.</blockquote>
178
+ <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>
179
+
180
+ ## Show your support
181
+ ### Star this repo
182
+
183
+ Give a ⭐️ if this project helped you!
184
+
185
+ ### Donate to our project
186
+ 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 ;-) .
187
+
188
+ <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,9 @@
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
+
9
+ __version__ = DRUX_VERSION
@@ -0,0 +1,162 @@
1
+ """This file contains the abstract base class for drug release models."""
2
+
3
+ import numpy as np
4
+ import matplotlib.pyplot as plt
5
+ from abc import ABC, abstractmethod
6
+ from typing import Any, Optional
7
+
8
+ from .messages import (
9
+ ERROR_TARGET_RELEASE_RANGE,
10
+ ERROR_DURATION_TIME_STEP_POSITIVE,
11
+ ERROR_TIME_STEP_GREATER_THAN_DURATION,
12
+ ERROR_NO_SIMULATION_DATA,
13
+ ERROR_RELEASE_PROFILE_TOO_SHORT,
14
+ ERROR_TARGET_RELEASE_EXCEEDS_MAX,
15
+ )
16
+
17
+
18
+ class DrugReleaseModel(ABC):
19
+ """
20
+ Abstract base class for drug release models.
21
+
22
+ This class provides a common interface and functionality for various
23
+ mathematical models of drug release from delivery systems.
24
+
25
+ Subclasses should implement:
26
+ - _model_function(): Core model equation
27
+ - _validate_parameters(): Parameter validation
28
+ """
29
+
30
+ def __init__(self):
31
+ """Initialize the drug release model."""
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"}
39
+
40
+ @abstractmethod
41
+ def _validate_parameters(self) -> None:
42
+ """
43
+ Validate model parameters.
44
+
45
+ Should raise ValueError if parameters are invalid.
46
+ """
47
+ pass
48
+
49
+ @abstractmethod
50
+ def _model_function(self, t: float) -> float:
51
+ """
52
+ Model function that calculates drug release profile over time.
53
+
54
+ :param t: time point at which to calculate drug release
55
+ """
56
+ pass
57
+
58
+ def _get_release_profile(self) -> np.ndarray:
59
+ """Calculate the drug release profile over the specified time points."""
60
+ return np.vectorize(self._model_function)(self._time_points)
61
+
62
+ def _validate_plot(self) -> tuple:
63
+ """
64
+ Validate plotting process.
65
+
66
+ :raises ValueError: if simulation data is not available
67
+ :raises ValueError: if release profile is too short
68
+ """
69
+ if self._time_points is None or self._release_profile is None:
70
+ raise ValueError(ERROR_NO_SIMULATION_DATA)
71
+
72
+ if len(self._release_profile) < 2:
73
+ raise ValueError(ERROR_RELEASE_PROFILE_TOO_SHORT)
74
+ fig, ax = plt.subplots()
75
+ return fig, ax
76
+
77
+ def simulate(self, duration: int, time_step: float = 1) -> np.ndarray:
78
+ """
79
+ Simulate drug release over time.
80
+
81
+ :param duration: total time for simulation (in seconds)
82
+ :param time_step: time step for simulation (in seconds)
83
+ """
84
+ if duration <= 0 or time_step <= 0:
85
+ raise ValueError(ERROR_DURATION_TIME_STEP_POSITIVE)
86
+ if time_step > duration:
87
+ raise ValueError(ERROR_TIME_STEP_GREATER_THAN_DURATION)
88
+ self._time_points = np.arange(0, duration + time_step, time_step)
89
+ self._validate_parameters()
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:
101
+ """
102
+ Plot the drug release profile.
103
+
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
109
+ """
110
+ # Create a new figure and axis if not provided
111
+ fig, ax = self._validate_plot()
112
+
113
+ # Plotting the release profile
114
+ ax.plot(
115
+ self._time_points, self._release_profile, label=label or self._plot_parameters["label"], **kwargs
116
+ )
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"])
120
+ ax.grid()
121
+ ax.legend()
122
+
123
+ # Show the plot if requested
124
+ if show:
125
+ fig.show()
126
+
127
+ return fig, ax
128
+
129
+ def get_release_rate(self) -> np.ndarray:
130
+ """Calculate the instantaneous release rate (derivative of release profile)."""
131
+ if self._time_points is None or self._release_profile is None:
132
+ raise ValueError(ERROR_NO_SIMULATION_DATA)
133
+
134
+ if len(self._release_profile) < 2:
135
+ raise ValueError(ERROR_RELEASE_PROFILE_TOO_SHORT)
136
+
137
+ # Calculate the derivative of the release profile
138
+ release_rate = np.gradient(self._release_profile, self._time_points)
139
+ return release_rate
140
+
141
+ def time_for_release(self, target_release: float) -> float:
142
+ """
143
+ Estimate time needed to reach a specific release percentage.
144
+
145
+ :param target_release: target release fraction (>= 0)
146
+
147
+ :raises ValueError: if target_release is negative
148
+ :raises ValueError: if simulation data is not available
149
+ :raises ValueError: if target_release exceeds maximum release
150
+ """
151
+ if self._time_points is None or self._release_profile is None:
152
+ raise ValueError(ERROR_NO_SIMULATION_DATA)
153
+
154
+ if target_release < 0:
155
+ raise ValueError(ERROR_TARGET_RELEASE_RANGE)
156
+
157
+ if target_release > self._release_profile[-1]:
158
+ raise ValueError(ERROR_TARGET_RELEASE_EXCEEDS_MAX)
159
+
160
+ # Find first time point where release >= target
161
+ idx = np.argmax(self._release_profile >= target_release)
162
+ return self._time_points[idx]