Skip to content

{lib}[foss/2023a] MorphoSONIC v1.0-20240110, PySONIC v1.0-20250519 #23156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
easyblock = 'PythonBundle'

name = 'MorphoSONIC'
version = '1.0-20240110'
local_commit = '64a0a23'

homepage = 'https://github.com/tjjlemaire/MorphoSONIC'
description = """
MorphoSONIC is a Python+NEURON implementation of spatially extended representations of the multi-Scale Optimized
Neuronal Intramembrane Cavitation (SONIC) model. It enables the simulation of the distributed electrical
response of morphologically realistic neuron representations to acoustic stimuli, as predicted by the intramembrane
cavitation hypothesis. The details of the MorphoSONIC framework and of its application to study ultrasound
neuromodulation in peripheral nerve fibers are described in.
"""

toolchain = {'name': 'foss', 'version': '2023a'}

dependencies = [
('Python', '3.11.3'),
('NEURON', '8.2.6'),
('Seaborn', '0.13.2'),
('PySONIC', '1.0-20250519'),
]

exts_list = [
('MarkdownPP', '1.5.1', {
'modulename': '%(name)s',
'checksums': ['a70babf819a6cf7f1035400ffa5763799fa67f2efcb5e701a59fc5ff79dd9696'],
}),
('watchdog', '6.0.0', {
'checksums': ['9ddf7c82fda3ae8e24decda1338ede66e1c99883db93711d8fb941eaa2d8c282'],
}),
(name, version, {
'patches': ['%(name)s-%(version)s_fix-setup.py.patch'],
'source_urls': ['https://github.com/tjjlemaire/MorphoSONIC/archive/'],
'sources': [{'download_filename': '%s.tar.gz' % local_commit, 'filename': SOURCE_TAR_GZ}],
'preinstallopts': "sed -i '/neuron/d' requirements.txt && ",
'modulename': name,
'checksums': [
{'MorphoSONIC-1.0-20240110.tar.gz': 'd264f0af5471bfccac09b7eb1ffa340bcb70192e2c73ff37ae58bfee2c9ddfef'},
{'MorphoSONIC-1.0-20240110_fix-setup.py.patch':
'240c74a5ca911b9dcdf8a321ddc914c5295510c8a55c8fe19f460e7417a5449d'},
],
}),
]

# generate libs from mod files by neuron's nrnivmodl
postinstallcmds = [f'cd %(installdir)s/lib/python%(pyshortver)s/site-packages/{name}/nmodl && nrnivmodl']

sanity_check_commands = [
"python -c 'from MorphoSONIC.core import ExtracellularCurrent'",
"python -c 'from MorphoSONIC.parsers import IextraFiberParser'",
"python -c 'from MorphoSONIC.models import Node'",
]

sanity_check_paths = {
'files': [],
'dirs': [f'lib/python%(pyshortver)s/site-packages/{name}/nmodl'],
}

moduleclass = 'lib'
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
There are 2 fixes in setup.py:
1. use setuptools find_packages()
2. copy either /nmodl dir to installdirs
Author: Pavel Tomanek (Inuits)
--- setup.py.orig 2025-06-12 16:51:55.114977170 +0200
+++ setup.py 2025-06-12 16:24:32.966212906 +0200
@@ -6,7 +6,7 @@
# @Last Modified time: 2023-03-16 13:22:53

import os
-from setuptools import setup
+from setuptools import setup, find_packages

readme_file = 'README.md'
requirements_file = 'requirements.txt'
@@ -61,8 +61,12 @@
author='Théo Lemaire',
author_email='[email protected]',
license='MIT',
- packages=['MorphoSONIC'],
+ packages=find_packages(),
scripts=getFiles('scripts') + getFiles('tests') + getFiles('examples'),
install_requires=get_requirements(),
- zip_safe=False
+ zip_safe=False,
+ include_package_data=True,
+ package_data={
+ 'MorphoSONIC': ['nmodl/*', 'nmodl/x86_64/.libs/*'],
+ },
)
64 changes: 64 additions & 0 deletions easybuild/easyconfigs/p/PySONIC/PySONIC-1.0-20250519-foss-2023a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
easyblock = 'PythonBundle'

name = 'PySONIC'
version = '1.0-20250519'
local_commit = '10ed530'

homepage = 'https://github.com/tjjlemaire/PySONIC'
description = """
Python implementation of the NICE & SONIC models, allowing for rapid
simulations of ultrasound-evoked membrane dynamics in various point-neuron models.
"""

toolchain = {'name': 'foss', 'version': '2023a'}

dependencies = [
('Python', '3.11.3'),
('SciPy-bundle', '2023.07'),
('matplotlib', '3.7.2'),
('tqdm', '4.66.1'),
('multiprocess', '0.70.15'),
('openpyxl', '3.1.2'),
('JupyterLab', '4.0.5'),
]

exts_list = [
('boltons', '23.0.0', {
'checksums': ['8c50a71829525835ca3c849c7ed2511610c972b4dddfcd41a4a5447222beb4b0'],
}),
('colorlog', '6.9.0', {
'checksums': ['bfba54a1b93b94f54e1f4fe48395725a3d92fd2a4af702f6bd70946bdc0c6ac2'],
}),
(name, version, {
'patches': ['%(name)s-%(version)s_fix-setup.py.patch'],
'modulename': name,
# you need to have git-lfs installed or git-lfs module loaded to get full version of sources -
# there are only templates in /lookups dir, if the sources are downloaded from GitHub
'sources': [{
'filename': f'%(name)s-%(version)s-{local_commit}.tar.xz',
'git_config': {
'url': 'https://github.com/tjjlemaire',
'repo_name': name,
'commit': local_commit,
},
}],
'checksums': [
{'PySONIC-1.0-20250519-10ed530.tar.xz':
'025d900480dd59bb7bc509e9fdfeb8a72ce4cec560713aff536d03e908b1d84c'},
{'PySONIC-1.0-20250519_fix-setup.py.patch':
'317e7e3c30df726d8aea206d1b373c1d9c9499c2877d86609dfb466844d3be6d'},
],
}),
]

sanity_check_commands = [
"python -c 'from PySONIC.core import NeuronalBilayerSonophore, AcousticDrive'",
"python -c 'from PySONIC.neurons import getPointNeuron'",
]

sanity_check_paths = {
'files': [],
'dirs': [f'lib/python%(pyshortver)s/site-packages/{name}/lookups'],
}

moduleclass = 'lib'
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Fix setup.py to add either lookups dir to installdir
Author: Pavel Tomanek (Inuits)
--- setup.py.orig 2025-06-18 16:34:19.958477374 +0200
+++ setup.py 2025-06-18 16:36:22.079482402 +0200
@@ -6,7 +6,7 @@
# @Last Modified time: 2023-05-18 09:06:45

import os
-from setuptools import setup
+from setuptools import setup, find_packages

readme_file = 'README.md'
requirements_file = 'requirements.txt'
@@ -56,7 +56,11 @@
author='Theo Lemaire',
author_email='[email protected]',
license='MIT',
- packages=['PySONIC'],
+ packages=find_packages(),
+ include_package_data=True,
+ package_data={
+ 'PySONIC': ['lookups/*'],
+ },
scripts=getFiles('scripts') + getFiles('tests'),
install_requires=get_requirements(),
zip_safe=False