pyfibers 0.4.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.
Files changed (66) hide show
  1. pyfibers-0.4.2/LICENSE +361 -0
  2. pyfibers-0.4.2/PKG-INFO +123 -0
  3. pyfibers-0.4.2/README.md +83 -0
  4. pyfibers-0.4.2/pyproject.toml +176 -0
  5. pyfibers-0.4.2/src/pyfibers/MOD/AXNODE_myel.mod +247 -0
  6. pyfibers-0.4.2/src/pyfibers/MOD/BK.mod +86 -0
  7. pyfibers-0.4.2/src/pyfibers/MOD/CaPump.mod +57 -0
  8. pyfibers-0.4.2/src/pyfibers/MOD/CaV12.mod +89 -0
  9. pyfibers-0.4.2/src/pyfibers/MOD/CaV22.mod +97 -0
  10. pyfibers-0.4.2/src/pyfibers/MOD/DNav18.mod +107 -0
  11. pyfibers-0.4.2/src/pyfibers/MOD/HCN.mod +104 -0
  12. pyfibers-0.4.2/src/pyfibers/MOD/KA14.mod +91 -0
  13. pyfibers-0.4.2/src/pyfibers/MOD/KA34.mod +93 -0
  14. pyfibers-0.4.2/src/pyfibers/MOD/KM.mod +83 -0
  15. pyfibers-0.4.2/src/pyfibers/MOD/KV21.mod +78 -0
  16. pyfibers-0.4.2/src/pyfibers/MOD/NaCX.mod +74 -0
  17. pyfibers-0.4.2/src/pyfibers/MOD/NaCaPump.mod +81 -0
  18. pyfibers-0.4.2/src/pyfibers/MOD/NaV7.mod +89 -0
  19. pyfibers-0.4.2/src/pyfibers/MOD/NaV9.mod +92 -0
  20. pyfibers-0.4.2/src/pyfibers/MOD/Nakpump.mod +84 -0
  21. pyfibers-0.4.2/src/pyfibers/MOD/NakpumpSchild.mod +66 -0
  22. pyfibers-0.4.2/src/pyfibers/MOD/RattayAberham.mod +118 -0
  23. pyfibers-0.4.2/src/pyfibers/MOD/SK.mod +77 -0
  24. pyfibers-0.4.2/src/pyfibers/MOD/caextscale.mod +79 -0
  25. pyfibers-0.4.2/src/pyfibers/MOD/caintscale.mod +76 -0
  26. pyfibers-0.4.2/src/pyfibers/MOD/can.mod +158 -0
  27. pyfibers-0.4.2/src/pyfibers/MOD/cat.mod +131 -0
  28. pyfibers-0.4.2/src/pyfibers/MOD/extrapump.mod +39 -0
  29. pyfibers-0.4.2/src/pyfibers/MOD/h.mod +93 -0
  30. pyfibers-0.4.2/src/pyfibers/MOD/k_ion_dynamics.mod +54 -0
  31. pyfibers-0.4.2/src/pyfibers/MOD/k_ion_dynamics_tigerholm.mod +54 -0
  32. pyfibers-0.4.2/src/pyfibers/MOD/ka.mod +114 -0
  33. pyfibers-0.4.2/src/pyfibers/MOD/kca.mod +110 -0
  34. pyfibers-0.4.2/src/pyfibers/MOD/kd.mod +109 -0
  35. pyfibers-0.4.2/src/pyfibers/MOD/kdr.mod +91 -0
  36. pyfibers-0.4.2/src/pyfibers/MOD/kdrTiger.mod +67 -0
  37. pyfibers-0.4.2/src/pyfibers/MOD/kds.mod +111 -0
  38. pyfibers-0.4.2/src/pyfibers/MOD/kf.mod +81 -0
  39. pyfibers-0.4.2/src/pyfibers/MOD/kna.mod +50 -0
  40. pyfibers-0.4.2/src/pyfibers/MOD/ks.mod +76 -0
  41. pyfibers-0.4.2/src/pyfibers/MOD/leak.mod +50 -0
  42. pyfibers-0.4.2/src/pyfibers/MOD/leakSchild.mod +59 -0
  43. pyfibers-0.4.2/src/pyfibers/MOD/na_ion_dynamics.mod +55 -0
  44. pyfibers-0.4.2/src/pyfibers/MOD/na_ion_dynamics_tigerholm.mod +55 -0
  45. pyfibers-0.4.2/src/pyfibers/MOD/naf.mod +142 -0
  46. pyfibers-0.4.2/src/pyfibers/MOD/naf97mean.mod +115 -0
  47. pyfibers-0.4.2/src/pyfibers/MOD/nahh.mod +92 -0
  48. pyfibers-0.4.2/src/pyfibers/MOD/nas.mod +114 -0
  49. pyfibers-0.4.2/src/pyfibers/MOD/nas97mean.mod +112 -0
  50. pyfibers-0.4.2/src/pyfibers/MOD/nattxs.mod +131 -0
  51. pyfibers-0.4.2/src/pyfibers/MOD/nav1p9.mod +142 -0
  52. pyfibers-0.4.2/src/pyfibers/MOD/newNaV8.mod +97 -0
  53. pyfibers-0.4.2/src/pyfibers/MOD/train.mod +58 -0
  54. pyfibers-0.4.2/src/pyfibers/__init__.py +43 -0
  55. pyfibers-0.4.2/src/pyfibers/calc.py +2 -0
  56. pyfibers-0.4.2/src/pyfibers/compile.py +43 -0
  57. pyfibers-0.4.2/src/pyfibers/fiber.py +1165 -0
  58. pyfibers-0.4.2/src/pyfibers/model_enum.py +81 -0
  59. pyfibers-0.4.2/src/pyfibers/models/__init__.py +12 -0
  60. pyfibers-0.4.2/src/pyfibers/models/mrg.py +330 -0
  61. pyfibers-0.4.2/src/pyfibers/models/rattay.py +54 -0
  62. pyfibers-0.4.2/src/pyfibers/models/schild.py +130 -0
  63. pyfibers-0.4.2/src/pyfibers/models/sundt.py +61 -0
  64. pyfibers-0.4.2/src/pyfibers/models/thio.py +173 -0
  65. pyfibers-0.4.2/src/pyfibers/models/tigerholm.py +122 -0
  66. pyfibers-0.4.2/src/pyfibers/stimulation.py +1178 -0
pyfibers-0.4.2/LICENSE ADDED
@@ -0,0 +1,361 @@
1
+ The copyrights of this software are owned by Duke University. As such,
2
+ two licenses for this software are offered:
3
+
4
+ 1. An open-source license under the GPLv2 license for non-commercial
5
+ use (see below).
6
+ 2. A custom license with Duke University, for commercial use or for
7
+ use without the GPLv2 license restrictions.
8
+
9
+ As a recipient of this software, you may choose which license to
10
+ receive the code under. Outside contributions to the Duke-owned code
11
+ base cannot be accepted unless the contributor transfers the copyright
12
+ to those changes over to Duke University.
13
+
14
+ To enter a custom license agreement without the GPLv2 license
15
+ restrictions, please contact the Digital Innovations department at
16
+ Duke Office for Translation & Commercialization
17
+ (https://olv.duke.edu/software/) at olvquestions@duke.edu with
18
+ reference to "OTC File No. 7483" in your email.
19
+
20
+ Please note that this software is distributed AS IS, WITHOUT ANY
21
+ WARRANTY; and without the implied warranty of MERCHANTABILITY or
22
+ FITNESS FOR A PARTICULAR PURPOSE.
23
+ **********************************************************************
24
+ GNU GENERAL PUBLIC LICENSE
25
+ Version 2, June 1991
26
+
27
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
28
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29
+ Everyone is permitted to copy and distribute verbatim copies
30
+ of this license document, but changing it is not allowed.
31
+
32
+ Preamble
33
+
34
+ The licenses for most software are designed to take away your
35
+ freedom to share and change it. By contrast, the GNU General Public
36
+ License is intended to guarantee your freedom to share and change free
37
+ software--to make sure the software is free for all its users. This
38
+ General Public License applies to most of the Free Software
39
+ Foundation's software and to any other program whose authors commit to
40
+ using it. (Some other Free Software Foundation software is covered by
41
+ the GNU Lesser General Public License instead.) You can apply it to
42
+ your programs, too.
43
+
44
+ When we speak of free software, we are referring to freedom, not
45
+ price. Our General Public Licenses are designed to make sure that you
46
+ have the freedom to distribute copies of free software (and charge for
47
+ this service if you wish), that you receive source code or can get it
48
+ if you want it, that you can change the software or use pieces of it
49
+ in new free programs; and that you know you can do these things.
50
+
51
+ To protect your rights, we need to make restrictions that forbid
52
+ anyone to deny you these rights or to ask you to surrender the rights.
53
+ These restrictions translate to certain responsibilities for you if you
54
+ distribute copies of the software, or if you modify it.
55
+
56
+ For example, if you distribute copies of such a program, whether
57
+ gratis or for a fee, you must give the recipients all the rights that
58
+ you have. You must make sure that they, too, receive or can get the
59
+ source code. And you must show them these terms so they know their
60
+ rights.
61
+
62
+ We protect your rights with two steps: (1) copyright the software, and
63
+ (2) offer you this license which gives you legal permission to copy,
64
+ distribute and/or modify the software.
65
+
66
+ Also, for each author's protection and ours, we want to make certain
67
+ that everyone understands that there is no warranty for this free
68
+ software. If the software is modified by someone else and passed on, we
69
+ want its recipients to know that what they have is not the original, so
70
+ that any problems introduced by others will not reflect on the original
71
+ authors' reputations.
72
+
73
+ Finally, any free program is threatened constantly by software
74
+ patents. We wish to avoid the danger that redistributors of a free
75
+ program will individually obtain patent licenses, in effect making the
76
+ program proprietary. To prevent this, we have made it clear that any
77
+ patent must be licensed for everyone's free use or not licensed at all.
78
+
79
+ The precise terms and conditions for copying, distribution and
80
+ modification follow.
81
+
82
+ GNU GENERAL PUBLIC LICENSE
83
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
84
+
85
+ 0. This License applies to any program or other work which contains
86
+ a notice placed by the copyright holder saying it may be distributed
87
+ under the terms of this General Public License. The "Program", below,
88
+ refers to any such program or work, and a "work based on the Program"
89
+ means either the Program or any derivative work under copyright law:
90
+ that is to say, a work containing the Program or a portion of it,
91
+ either verbatim or with modifications and/or translated into another
92
+ language. (Hereinafter, translation is included without limitation in
93
+ the term "modification".) Each licensee is addressed as "you".
94
+
95
+ Activities other than copying, distribution and modification are not
96
+ covered by this License; they are outside its scope. The act of
97
+ running the Program is not restricted, and the output from the Program
98
+ is covered only if its contents constitute a work based on the
99
+ Program (independent of having been made by running the Program).
100
+ Whether that is true depends on what the Program does.
101
+
102
+ 1. You may copy and distribute verbatim copies of the Program's
103
+ source code as you receive it, in any medium, provided that you
104
+ conspicuously and appropriately publish on each copy an appropriate
105
+ copyright notice and disclaimer of warranty; keep intact all the
106
+ notices that refer to this License and to the absence of any warranty;
107
+ and give any other recipients of the Program a copy of this License
108
+ along with the Program.
109
+
110
+ You may charge a fee for the physical act of transferring a copy, and
111
+ you may at your option offer warranty protection in exchange for a fee.
112
+
113
+ 2. You may modify your copy or copies of the Program or any portion
114
+ of it, thus forming a work based on the Program, and copy and
115
+ distribute such modifications or work under the terms of Section 1
116
+ above, provided that you also meet all of these conditions:
117
+
118
+ a) You must cause the modified files to carry prominent notices
119
+ stating that you changed the files and the date of any change.
120
+
121
+ b) You must cause any work that you distribute or publish, that in
122
+ whole or in part contains or is derived from the Program or any
123
+ part thereof, to be licensed as a whole at no charge to all third
124
+ parties under the terms of this License.
125
+
126
+ c) If the modified program normally reads commands interactively
127
+ when run, you must cause it, when started running for such
128
+ interactive use in the most ordinary way, to print or display an
129
+ announcement including an appropriate copyright notice and a
130
+ notice that there is no warranty (or else, saying that you provide
131
+ a warranty) and that users may redistribute the program under
132
+ these conditions, and telling the user how to view a copy of this
133
+ License. (Exception: if the Program itself is interactive but
134
+ does not normally print such an announcement, your work based on
135
+ the Program is not required to print an announcement.)
136
+
137
+ These requirements apply to the modified work as a whole. If
138
+ identifiable sections of that work are not derived from the Program,
139
+ and can be reasonably considered independent and separate works in
140
+ themselves, then this License, and its terms, do not apply to those
141
+ sections when you distribute them as separate works. But when you
142
+ distribute the same sections as part of a whole which is a work based
143
+ on the Program, the distribution of the whole must be on the terms of
144
+ this License, whose permissions for other licensees extend to the
145
+ entire whole, and thus to each and every part regardless of who wrote it.
146
+
147
+ Thus, it is not the intent of this section to claim rights or contest
148
+ your rights to work written entirely by you; rather, the intent is to
149
+ exercise the right to control the distribution of derivative or
150
+ collective works based on the Program.
151
+
152
+ In addition, mere aggregation of another work not based on the Program
153
+ with the Program (or with a work based on the Program) on a volume of
154
+ a storage or distribution medium does not bring the other work under
155
+ the scope of this License.
156
+
157
+ 3. You may copy and distribute the Program (or a work based on it,
158
+ under Section 2) in object code or executable form under the terms of
159
+ Sections 1 and 2 above provided that you also do one of the following:
160
+
161
+ a) Accompany it with the complete corresponding machine-readable
162
+ source code, which must be distributed under the terms of Sections
163
+ 1 and 2 above on a medium customarily used for software interchange; or,
164
+
165
+ b) Accompany it with a written offer, valid for at least three
166
+ years, to give any third party, for a charge no more than your
167
+ cost of physically performing source distribution, a complete
168
+ machine-readable copy of the corresponding source code, to be
169
+ distributed under the terms of Sections 1 and 2 above on a medium
170
+ customarily used for software interchange; or,
171
+
172
+ c) Accompany it with the information you received as to the offer
173
+ to distribute corresponding source code. (This alternative is
174
+ allowed only for noncommercial distribution and only if you
175
+ received the program in object code or executable form with such
176
+ an offer, in accord with Subsection b above.)
177
+
178
+ The source code for a work means the preferred form of the work for
179
+ making modifications to it. For an executable work, complete source
180
+ code means all the source code for all modules it contains, plus any
181
+ associated interface definition files, plus the scripts used to
182
+ control compilation and installation of the executable. However, as a
183
+ special exception, the source code distributed need not include
184
+ anything that is normally distributed (in either source or binary
185
+ form) with the major components (compiler, kernel, and so on) of the
186
+ operating system on which the executable runs, unless that component
187
+ itself accompanies the executable.
188
+
189
+ If distribution of executable or object code is made by offering
190
+ access to copy from a designated place, then offering equivalent
191
+ access to copy the source code from the same place counts as
192
+ distribution of the source code, even though third parties are not
193
+ compelled to copy the source along with the object code.
194
+
195
+ 4. You may not copy, modify, sublicense, or distribute the Program
196
+ except as expressly provided under this License. Any attempt
197
+ otherwise to copy, modify, sublicense or distribute the Program is
198
+ void, and will automatically terminate your rights under this License.
199
+ However, parties who have received copies, or rights, from you under
200
+ this License will not have their licenses terminated so long as such
201
+ parties remain in full compliance.
202
+
203
+ 5. You are not required to accept this License, since you have not
204
+ signed it. However, nothing else grants you permission to modify or
205
+ distribute the Program or its derivative works. These actions are
206
+ prohibited by law if you do not accept this License. Therefore, by
207
+ modifying or distributing the Program (or any work based on the
208
+ Program), you indicate your acceptance of this License to do so, and
209
+ all its terms and conditions for copying, distributing or modifying
210
+ the Program or works based on it.
211
+
212
+ 6. Each time you redistribute the Program (or any work based on the
213
+ Program), the recipient automatically receives a license from the
214
+ original licensor to copy, distribute or modify the Program subject to
215
+ these terms and conditions. You may not impose any further
216
+ restrictions on the recipients' exercise of the rights granted herein.
217
+ You are not responsible for enforcing compliance by third parties to
218
+ this License.
219
+
220
+ 7. If, as a consequence of a court judgment or allegation of patent
221
+ infringement or for any other reason (not limited to patent issues),
222
+ conditions are imposed on you (whether by court order, agreement or
223
+ otherwise) that contradict the conditions of this License, they do not
224
+ excuse you from the conditions of this License. If you cannot
225
+ distribute so as to satisfy simultaneously your obligations under this
226
+ License and any other pertinent obligations, then as a consequence you
227
+ may not distribute the Program at all. For example, if a patent
228
+ license would not permit royalty-free redistribution of the Program by
229
+ all those who receive copies directly or indirectly through you, then
230
+ the only way you could satisfy both it and this License would be to
231
+ refrain entirely from distribution of the Program.
232
+
233
+ If any portion of this section is held invalid or unenforceable under
234
+ any particular circumstance, the balance of the section is intended to
235
+ apply and the section as a whole is intended to apply in other
236
+ circumstances.
237
+
238
+ It is not the purpose of this section to induce you to infringe any
239
+ patents or other property right claims or to contest validity of any
240
+ such claims; this section has the sole purpose of protecting the
241
+ integrity of the free software distribution system, which is
242
+ implemented by public license practices. Many people have made
243
+ generous contributions to the wide range of software distributed
244
+ through that system in reliance on consistent application of that
245
+ system; it is up to the author/donor to decide if he or she is willing
246
+ to distribute software through any other system and a licensee cannot
247
+ impose that choice.
248
+
249
+ This section is intended to make thoroughly clear what is believed to
250
+ be a consequence of the rest of this License.
251
+
252
+ 8. If the distribution and/or use of the Program is restricted in
253
+ certain countries either by patents or by copyrighted interfaces, the
254
+ original copyright holder who places the Program under this License
255
+ may add an explicit geographical distribution limitation excluding
256
+ those countries, so that distribution is permitted only in or among
257
+ countries not thus excluded. In such case, this License incorporates
258
+ the limitation as if written in the body of this License.
259
+
260
+ 9. The Free Software Foundation may publish revised and/or new versions
261
+ of the General Public License from time to time. Such new versions will
262
+ be similar in spirit to the present version, but may differ in detail to
263
+ address new problems or concerns.
264
+
265
+ Each version is given a distinguishing version number. If the Program
266
+ specifies a version number of this License which applies to it and "any
267
+ later version", you have the option of following the terms and conditions
268
+ either of that version or of any later version published by the Free
269
+ Software Foundation. If the Program does not specify a version number of
270
+ this License, you may choose any version ever published by the Free Software
271
+ Foundation.
272
+
273
+ 10. If you wish to incorporate parts of the Program into other free
274
+ programs whose distribution conditions are different, write to the author
275
+ to ask for permission. For software which is copyrighted by the Free
276
+ Software Foundation, write to the Free Software Foundation; we sometimes
277
+ make exceptions for this. Our decision will be guided by the two goals
278
+ of preserving the free status of all derivatives of our free software and
279
+ of promoting the sharing and reuse of software generally.
280
+
281
+ NO WARRANTY
282
+
283
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
284
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
285
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
286
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
287
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
288
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
289
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
290
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
291
+ REPAIR OR CORRECTION.
292
+
293
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
294
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
295
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
296
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
297
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
298
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
299
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
300
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
301
+ POSSIBILITY OF SUCH DAMAGES.
302
+
303
+ END OF TERMS AND CONDITIONS
304
+
305
+ How to Apply These Terms to Your New Programs
306
+
307
+ If you develop a new program, and you want it to be of the greatest
308
+ possible use to the public, the best way to achieve this is to make it
309
+ free software which everyone can redistribute and change under these terms.
310
+
311
+ To do so, attach the following notices to the program. It is safest
312
+ to attach them to the start of each source file to most effectively
313
+ convey the exclusion of warranty; and each file should have at least
314
+ the "copyright" line and a pointer to where the full notice is found.
315
+
316
+ PyFibers
317
+ Copyright (C) 2025 wmglab
318
+
319
+ This program is free software; you can redistribute it and/or modify
320
+ it under the terms of the GNU General Public License as published by
321
+ the Free Software Foundation.
322
+
323
+ This program is distributed in the hope that it will be useful,
324
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
325
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
326
+ GNU General Public License for more details.
327
+
328
+ You should have received a copy of the GNU General Public License along
329
+ with this program; if not, write to the Free Software Foundation, Inc.,
330
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
331
+
332
+ Also add information on how to contact you by electronic and paper mail.
333
+
334
+ If the program is interactive, make it output a short notice like this
335
+ when it starts in an interactive mode:
336
+
337
+ Gnomovision version 69, Copyright (C) year name of author
338
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
339
+ This is free software, and you are welcome to redistribute it
340
+ under certain conditions; type `show c' for details.
341
+
342
+ The hypothetical commands `show w' and `show c' should show the appropriate
343
+ parts of the General Public License. Of course, the commands you use may
344
+ be called something other than `show w' and `show c'; they could even be
345
+ mouse-clicks or menu items--whatever suits your program.
346
+
347
+ You should also get your employer (if you work as a programmer) or your
348
+ school, if any, to sign a "copyright disclaimer" for the program, if
349
+ necessary. Here is a sample; alter the names:
350
+
351
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
352
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
353
+
354
+ <signature of Ty Coon>, 1 April 1989
355
+ Ty Coon, President of Vice
356
+
357
+ This General Public License does not permit incorporating your program into
358
+ proprietary programs. If your program is a subroutine library, you may
359
+ consider it more useful to permit linking proprietary applications with the
360
+ library. If this is what you want to do, use the GNU Lesser General
361
+ Public License instead of this License.
@@ -0,0 +1,123 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyfibers
3
+ Version: 0.4.2
4
+ Summary: Modeling stimulation of peripheral nerve fibers
5
+ Keywords: stimulation,modeling,computational,fibers,peripheral nerve
6
+ Author: Daniel Marshall, Elie Farah, Eric Musselman
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Operating System :: OS Independent
14
+ License-File: LICENSE
15
+ Requires-Dist: matplotlib==3.10.*
16
+ Requires-Dist: multiprocess==0.*
17
+ Requires-Dist: numpy==2.2.*
18
+ Requires-Dist: pandas==2.2.*
19
+ Requires-Dist: scipy==1.15.*
20
+ Requires-Dist: seaborn==0.13.*
21
+ Requires-Dist: nd_line==0.2.*
22
+ Requires-Dist: aenum==3.1.*
23
+ Requires-Dist: mock==5.* ; extra == "dev"
24
+ Requires-Dist: pre-commit==4.0.* ; extra == "dev"
25
+ Requires-Dist: pytest==8.* ; extra == "dev"
26
+ Requires-Dist: pytest-cov==6.* ; extra == "dev"
27
+ Requires-Dist: pytest-sugar==1.* ; extra == "dev"
28
+ Requires-Dist: sphinx==7.* ; extra == "dev"
29
+ Requires-Dist: sphinx-rtd-theme==3.* ; extra == "dev"
30
+ Requires-Dist: sphinx-copybutton==0.5.* ; extra == "dev"
31
+ Requires-Dist: IPython==8.* ; extra == "dev"
32
+ Requires-Dist: enum-tools[sphinx]==0.12.* ; extra == "dev"
33
+ Requires-Dist: sphinxcontrib-bibtex==2.6.* ; extra == "dev"
34
+ Requires-Dist: moviepy==2.1.* ; extra == "dev"
35
+ Requires-Dist: sphinx_autodoc_typehints==2.3.* ; extra == "dev"
36
+ Requires-Dist: piccolo-theme==0.24.* ; extra == "dev"
37
+ Requires-Dist: myst-nb==1.2.* ; extra == "dev"
38
+ Provides-Extra: dev
39
+
40
+ # PyFibers
41
+ This package implements biophysical models of axons in the NEURON simulation environment using Python. With our package, you can model the responses of axons to electrical stimulation (e.g., find the minimum current amplitude required to activate or block an action potential). You can add your own fiber models and simulations protocols. You can use analytical tools for extracellular potentials, or import from FEM (e.g., COMSOL).
42
+
43
+ We have implemented the following models:
44
+ - MRG (McIntyre, Richardson, and Grill)
45
+ - MRG-discrete
46
+ - MRG-interpolation
47
+ - Small MRG-interpolation
48
+ - Thio
49
+ - Autonomic
50
+ - Cutaneous
51
+ - Sundt
52
+ - Tigerholm
53
+ - Rattay
54
+ - Schild
55
+ - Schild 1994
56
+ - Schild 1997
57
+
58
+ ## Installation
59
+ Note: It is recommended you create a new virtual environment for PyFibers. For example, using Anaconda/Miniconda:
60
+ - `conda create -n pyfibers`
61
+ - `conda activate pyfibers`
62
+ 1. Install NEURON and add to PATH (https://nrn.readthedocs.io/en/latest/)
63
+ - Make sure your NEURON and Python versions are compatible (https://nrn.readthedocs.io/en/latest/changelog.html)
64
+ - Check your installation by running the following command: `python -c "import neuron; neuron.test(); quit()"`. If successful, test outputs along with "OK" should be printed to the terminal.
65
+ 2. Using git, clone PyFibers to your computer (Once the package is released, this step will be eliminated. Also skip if you downloaded or were provided a zipped copy of the repository)
66
+ 3. Install the package using pip
67
+ - Open your terminal where Python is callable (e.g., Anaconda Prompt)
68
+ - Navigate to the repository root directory
69
+ - Run the command `pip install .` if you do not plan to develop PyFibers code.
70
+ - If you do plan to develop the package, instead do the following:
71
+ - Install PyFibers alongside development dependencies with `pip install .[dev]` (If using a zsh shell, use the command `pip install .'[dev]'`)
72
+ - Install pre-commit hooks with `pre-commit install`
73
+ 4. To compile the mod files, in Anaconda prompt, run the command `pyfibers_compile`
74
+ - It is normal to see the following message during compilation: `NEURON mechanisms not found in <path>.` Check the NEURON output that follows for a message that the mechanisms were compiled successfully. (e.g., for Windows: `nrnmech.dll was built successfully.`). In the future while using PyFibers, if you see the `NEURON mechanisms not found in <path>.` message, this is cause for concern, as this means PyFibers cannot find the compiled mechanisms. Failed compiles will commonly cause the error message `Argument not a density mechanism name` to appear when trying to create fibers.
75
+ - Careful! Make sure that that the correct NEURON installation is in your path, as the first found installation will be used for compilation. The version used for compilation must be the same version used to run PyFibers code.
76
+ - Note: if you receive a message that the `pyfibers_compile` command is not found, find the executable for this command in the `Scripts` path of your python directory (e.g. `C:\Users\<username>\Anaconda3\envs\pyfibers\Scripts`) and run the executable (e.g., `pyfibers_compile.exe`).
77
+
78
+
79
+ ## Usage
80
+ See the Documentation for detailed information on usage:
81
+ - [Tutorials](https://wmglab.pages.oit.duke.edu/wmglab-neuron/tutorials/index.html) on various operations.
82
+ - [API Documentation](https://wmglab.pages.oit.duke.edu/wmglab-neuron/autodoc/index.html) on function/class arguments and outputs.
83
+
84
+ The basic steps for running a PyFibers simulation are as follows:
85
+ ### Creating a model fiber
86
+ Use the build_fiber function to create fiber object. The fiber object consists of NEURON sections with ion channel mechanisms inserted for the fiber model chosen when the object is initialized. Users can add custom fiber models as well as using our provided models (See [Custom Fiber Models](https://wmglab.pages.oit.duke.edu/wmglab-neuron/custom.html#how-to-create-a-new-fiber-model))
87
+
88
+ ```python
89
+ from pyfibers import build_fiber
90
+
91
+ fiber = build_fiber(
92
+ fiber_model=FiberModel.MRG_DISCRETE,
93
+ diameter=10, # um
94
+ n_nodes=25, # um
95
+ temperature=37, # C
96
+ )
97
+ ```
98
+ ### Running a Simulatiion
99
+ The fiber object can be run in simulations using our provided `ScaledStim` class; alternatively, users can create their own custom simulation setup (See [Custom Simulations](https://wmglab.pages.oit.duke.edu/wmglab-neuron/custom.html#custom-simulations)). Once you have a fiber object, you can create a `ScaledStim` instance, which is a set of instructions for stimulating model fibers.
100
+
101
+ ```python
102
+ # Add extracellular potentials
103
+ fiber.potentials = potential_values
104
+
105
+ # Create instance of ScaledStim class
106
+ stimulation = ScaledStim(waveform=waveform, dt=time_step, tstop=time_stop)
107
+
108
+ # run threshold search
109
+ amp, _ = stimulation.find_threshold(fiber)
110
+ print(f"Threshold for 5.7 micron fiber: {amp} (mA)")
111
+ ```
112
+ For more examples, see the documentation.
113
+
114
+ ## Contributing
115
+ If you develop additional functionality that would be generally useful to our users, please open a Pull Request for us to review.
116
+
117
+ ## Authors and acknowledgment
118
+ - Developed at Duke University by Daniel Marshall, Elie Farrah, and Eric Musselman
119
+ - Please see: \<Paper REF Forthcoming>
120
+
121
+ ## License
122
+ See LICENSE
123
+
@@ -0,0 +1,83 @@
1
+ # PyFibers
2
+ This package implements biophysical models of axons in the NEURON simulation environment using Python. With our package, you can model the responses of axons to electrical stimulation (e.g., find the minimum current amplitude required to activate or block an action potential). You can add your own fiber models and simulations protocols. You can use analytical tools for extracellular potentials, or import from FEM (e.g., COMSOL).
3
+
4
+ We have implemented the following models:
5
+ - MRG (McIntyre, Richardson, and Grill)
6
+ - MRG-discrete
7
+ - MRG-interpolation
8
+ - Small MRG-interpolation
9
+ - Thio
10
+ - Autonomic
11
+ - Cutaneous
12
+ - Sundt
13
+ - Tigerholm
14
+ - Rattay
15
+ - Schild
16
+ - Schild 1994
17
+ - Schild 1997
18
+
19
+ ## Installation
20
+ Note: It is recommended you create a new virtual environment for PyFibers. For example, using Anaconda/Miniconda:
21
+ - `conda create -n pyfibers`
22
+ - `conda activate pyfibers`
23
+ 1. Install NEURON and add to PATH (https://nrn.readthedocs.io/en/latest/)
24
+ - Make sure your NEURON and Python versions are compatible (https://nrn.readthedocs.io/en/latest/changelog.html)
25
+ - Check your installation by running the following command: `python -c "import neuron; neuron.test(); quit()"`. If successful, test outputs along with "OK" should be printed to the terminal.
26
+ 2. Using git, clone PyFibers to your computer (Once the package is released, this step will be eliminated. Also skip if you downloaded or were provided a zipped copy of the repository)
27
+ 3. Install the package using pip
28
+ - Open your terminal where Python is callable (e.g., Anaconda Prompt)
29
+ - Navigate to the repository root directory
30
+ - Run the command `pip install .` if you do not plan to develop PyFibers code.
31
+ - If you do plan to develop the package, instead do the following:
32
+ - Install PyFibers alongside development dependencies with `pip install .[dev]` (If using a zsh shell, use the command `pip install .'[dev]'`)
33
+ - Install pre-commit hooks with `pre-commit install`
34
+ 4. To compile the mod files, in Anaconda prompt, run the command `pyfibers_compile`
35
+ - It is normal to see the following message during compilation: `NEURON mechanisms not found in <path>.` Check the NEURON output that follows for a message that the mechanisms were compiled successfully. (e.g., for Windows: `nrnmech.dll was built successfully.`). In the future while using PyFibers, if you see the `NEURON mechanisms not found in <path>.` message, this is cause for concern, as this means PyFibers cannot find the compiled mechanisms. Failed compiles will commonly cause the error message `Argument not a density mechanism name` to appear when trying to create fibers.
36
+ - Careful! Make sure that that the correct NEURON installation is in your path, as the first found installation will be used for compilation. The version used for compilation must be the same version used to run PyFibers code.
37
+ - Note: if you receive a message that the `pyfibers_compile` command is not found, find the executable for this command in the `Scripts` path of your python directory (e.g. `C:\Users\<username>\Anaconda3\envs\pyfibers\Scripts`) and run the executable (e.g., `pyfibers_compile.exe`).
38
+
39
+
40
+ ## Usage
41
+ See the Documentation for detailed information on usage:
42
+ - [Tutorials](https://wmglab.pages.oit.duke.edu/wmglab-neuron/tutorials/index.html) on various operations.
43
+ - [API Documentation](https://wmglab.pages.oit.duke.edu/wmglab-neuron/autodoc/index.html) on function/class arguments and outputs.
44
+
45
+ The basic steps for running a PyFibers simulation are as follows:
46
+ ### Creating a model fiber
47
+ Use the build_fiber function to create fiber object. The fiber object consists of NEURON sections with ion channel mechanisms inserted for the fiber model chosen when the object is initialized. Users can add custom fiber models as well as using our provided models (See [Custom Fiber Models](https://wmglab.pages.oit.duke.edu/wmglab-neuron/custom.html#how-to-create-a-new-fiber-model))
48
+
49
+ ```python
50
+ from pyfibers import build_fiber
51
+
52
+ fiber = build_fiber(
53
+ fiber_model=FiberModel.MRG_DISCRETE,
54
+ diameter=10, # um
55
+ n_nodes=25, # um
56
+ temperature=37, # C
57
+ )
58
+ ```
59
+ ### Running a Simulatiion
60
+ The fiber object can be run in simulations using our provided `ScaledStim` class; alternatively, users can create their own custom simulation setup (See [Custom Simulations](https://wmglab.pages.oit.duke.edu/wmglab-neuron/custom.html#custom-simulations)). Once you have a fiber object, you can create a `ScaledStim` instance, which is a set of instructions for stimulating model fibers.
61
+
62
+ ```python
63
+ # Add extracellular potentials
64
+ fiber.potentials = potential_values
65
+
66
+ # Create instance of ScaledStim class
67
+ stimulation = ScaledStim(waveform=waveform, dt=time_step, tstop=time_stop)
68
+
69
+ # run threshold search
70
+ amp, _ = stimulation.find_threshold(fiber)
71
+ print(f"Threshold for 5.7 micron fiber: {amp} (mA)")
72
+ ```
73
+ For more examples, see the documentation.
74
+
75
+ ## Contributing
76
+ If you develop additional functionality that would be generally useful to our users, please open a Pull Request for us to review.
77
+
78
+ ## Authors and acknowledgment
79
+ - Developed at Duke University by Daniel Marshall, Elie Farrah, and Eric Musselman
80
+ - Please see: \<Paper REF Forthcoming>
81
+
82
+ ## License
83
+ See LICENSE