diff --git a/.github/workflows/simulation_test.yml b/.github/workflows/simulation_test.yml index 7a4d98fbd..875d3e2b2 100644 --- a/.github/workflows/simulation_test.yml +++ b/.github/workflows/simulation_test.yml @@ -93,13 +93,13 @@ jobs: - name: Example run run: | export PYTHONPATH=$(pwd)/nrn/build/lib/python:$PYTHONPATH - cp core/hoc/* tests/share/hoc/ + cp neurodamus/data/hoc/* tests/share/hoc/ export HOC_LIBRARY_PATH=$(pwd)/tests/share/hoc # launch simulation with NEURON - mpirun -np 2 ./x86_64/special -mpi -python init.py --configFile=tests/simulations/usecase3/simulation_sonata.json + mpirun -np 2 ./x86_64/special -mpi -python neurodamus/data/init.py --configFile=tests/simulations/usecase3/simulation_sonata.json ls tests/simulations/usecase3/reporting/*.h5 # launch simulation with CORENEURON - mpirun -np 2 ./x86_64/special -mpi -python init.py --configFile=tests/simulations/usecase3/simulation_sonata_coreneuron.json + mpirun -np 2 ./x86_64/special -mpi -python neurodamus/data/init.py --configFile=tests/simulations/usecase3/simulation_sonata_coreneuron.json ls tests/simulations/usecase3/reporting_coreneuron/*.h5 # - name: live debug session, comment out diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index eccfb8519..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -prune tests -prune docs diff --git a/_debug.py b/_debug.py deleted file mode 100644 index 0f23528b5..000000000 --- a/_debug.py +++ /dev/null @@ -1,10 +0,0 @@ -""" -Neurodamus is a software for handling neuronal simulation using neuron. - -Copyright (c) 2018 Blue Brain Project, EPFL. -All rights reserved -""" -from neurodamus import Neurodamus - -if __name__ == "__main__": - Neurodamus("BlueConfig", enable_reports=False, logging_level=3).dump_circuit_config() diff --git a/ci/build_ndcore.sh b/ci/build_ndcore.sh index d945288cf..ff4b6a855 100755 --- a/ci/build_ndcore.sh +++ b/ci/build_ndcore.sh @@ -31,3 +31,7 @@ mkdir -p _lib cp -f x86_64/libnrnmech* _lib/ cp -f $CORE_DIR/hoc/*.hoc _lib/ cp -f $COMMON_DIR/hoc/*.hoc _lib/ + +echo $1 +ls -l +ls -l _lib diff --git a/neurodamus/core/_neuron.py b/neurodamus/core/_neuron.py index 89fb17cf8..ea7f823ac 100644 --- a/neurodamus/core/_neuron.py +++ b/neurodamus/core/_neuron.py @@ -4,6 +4,7 @@ """ from __future__ import absolute_import import logging +import os # os.environ import os.path from contextlib import contextmanager from .configuration import NeuronStdrunDefaults @@ -60,8 +61,8 @@ def load_hoc(cls, mod_name): h = (cls._h or cls._init()) mod_filename = mod_name + ".hoc" if not h.load_file(mod_filename): - raise RuntimeError("Cant load HOC library {}. Consider checking HOC_LIBRARY_PATH" - .format(mod_filename)) + raise RuntimeError("Cant load HOC library {}. Consider checking HOC_LIBRARY_PATH (currently '{}')" + .format(mod_filename, os.environ.get("HOC_LIBRARY_PATH"))) cls._hocs_loaded.add(mod_name) @classmethod diff --git a/core/hoc/Cell.hoc b/neurodamus/data/hoc/Cell.hoc similarity index 100% rename from core/hoc/Cell.hoc rename to neurodamus/data/hoc/Cell.hoc diff --git a/core/hoc/ConnectionUtils.hoc b/neurodamus/data/hoc/ConnectionUtils.hoc similarity index 100% rename from core/hoc/ConnectionUtils.hoc rename to neurodamus/data/hoc/ConnectionUtils.hoc diff --git a/core/hoc/Map.hoc b/neurodamus/data/hoc/Map.hoc similarity index 100% rename from core/hoc/Map.hoc rename to neurodamus/data/hoc/Map.hoc diff --git a/core/hoc/MorphIO.hoc b/neurodamus/data/hoc/MorphIO.hoc similarity index 100% rename from core/hoc/MorphIO.hoc rename to neurodamus/data/hoc/MorphIO.hoc diff --git a/core/hoc/RNGSettings.hoc b/neurodamus/data/hoc/RNGSettings.hoc similarity index 100% rename from core/hoc/RNGSettings.hoc rename to neurodamus/data/hoc/RNGSettings.hoc diff --git a/core/hoc/Report.hoc b/neurodamus/data/hoc/Report.hoc similarity index 100% rename from core/hoc/Report.hoc rename to neurodamus/data/hoc/Report.hoc diff --git a/core/hoc/TPointList.hoc b/neurodamus/data/hoc/TPointList.hoc similarity index 100% rename from core/hoc/TPointList.hoc rename to neurodamus/data/hoc/TPointList.hoc diff --git a/core/hoc/TType.hoc b/neurodamus/data/hoc/TType.hoc similarity index 100% rename from core/hoc/TType.hoc rename to neurodamus/data/hoc/TType.hoc diff --git a/core/hoc/defvar.hoc b/neurodamus/data/hoc/defvar.hoc similarity index 100% rename from core/hoc/defvar.hoc rename to neurodamus/data/hoc/defvar.hoc diff --git a/core/hoc/fileUtils.hoc b/neurodamus/data/hoc/fileUtils.hoc similarity index 100% rename from core/hoc/fileUtils.hoc rename to neurodamus/data/hoc/fileUtils.hoc diff --git a/core/hoc/neurodamus.hoc b/neurodamus/data/hoc/neurodamus.hoc similarity index 100% rename from core/hoc/neurodamus.hoc rename to neurodamus/data/hoc/neurodamus.hoc diff --git a/init.py b/neurodamus/data/init.py similarity index 100% rename from init.py rename to neurodamus/data/init.py diff --git a/core/mod/ALU.mod b/neurodamus/data/mod/ALU.mod similarity index 100% rename from core/mod/ALU.mod rename to neurodamus/data/mod/ALU.mod diff --git a/core/mod/CoreNEURONArtificialCell.mod b/neurodamus/data/mod/CoreNEURONArtificialCell.mod similarity index 100% rename from core/mod/CoreNEURONArtificialCell.mod rename to neurodamus/data/mod/CoreNEURONArtificialCell.mod diff --git a/core/mod/HDF5reader.mod b/neurodamus/data/mod/HDF5reader.mod similarity index 100% rename from core/mod/HDF5reader.mod rename to neurodamus/data/mod/HDF5reader.mod diff --git a/core/mod/SonataReportHelper.mod b/neurodamus/data/mod/SonataReportHelper.mod similarity index 100% rename from core/mod/SonataReportHelper.mod rename to neurodamus/data/mod/SonataReportHelper.mod diff --git a/core/mod/SonataReports.mod b/neurodamus/data/mod/SonataReports.mod similarity index 100% rename from core/mod/SonataReports.mod rename to neurodamus/data/mod/SonataReports.mod diff --git a/core/mod/VecStim.mod b/neurodamus/data/mod/VecStim.mod similarity index 100% rename from core/mod/VecStim.mod rename to neurodamus/data/mod/VecStim.mod diff --git a/core/mod/coreneuron_modlist.txt b/neurodamus/data/mod/coreneuron_modlist.txt similarity index 100% rename from core/mod/coreneuron_modlist.txt rename to neurodamus/data/mod/coreneuron_modlist.txt diff --git a/core/mod/netstim_inhpoisson.mod b/neurodamus/data/mod/netstim_inhpoisson.mod similarity index 100% rename from core/mod/netstim_inhpoisson.mod rename to neurodamus/data/mod/netstim_inhpoisson.mod diff --git a/pyproject.toml b/pyproject.toml index da80065cb..3ee44ad92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,9 @@ [build-system] requires = [ - "setuptools", - "setuptools_scm", - "wheel" - ] -build-backend = "setuptools.build_meta" + "hatchling", + "hatch-vcs", +] +build-backend = "hatchling.build" [project] name="neurodamus" @@ -36,10 +35,15 @@ Homepage = "https://github.com/BlueBrain/neurodamus" Repository = "https://github.com/BlueBrain/neurodamus.git" Tracker = "https://github.com/BlueBrain/neurodamus/issues" -[tool.setuptools.packages.find] -exclude=["tests"] +[tool.hatch.build.targets.sdist] +only-include = [ + "neurodamus", +] + +[tool.hatch.version] +source = "vcs" -[tool.setuptools_scm] +[tool.hatch.version.raw-options] local_scheme = "no-local-version" [tool.pytest.ini_options] diff --git a/tests/integration/test_cell.py b/tests/integration/test_cell.py index 921767411..7cdd3dba1 100644 --- a/tests/integration/test_cell.py +++ b/tests/integration/test_cell.py @@ -10,12 +10,12 @@ @pytest.fixture(scope="session") def morphologies_root(rootdir): - return Path(rootdir) / "tests/sample_data/morphology" + return Path(rootdir) / "tests" / "sample_data" / "morphology" @pytest.fixture def Cell(rootdir): - os.environ["HOC_LIBRARY_PATH"] = str(rootdir) + "/core/hoc" + os.environ.setdefault("HOC_LIBRARY_PATH", str(rootdir / "neurodamus" / "data" / "hoc")) from neurodamus.core import Cell return Cell diff --git a/tox.ini b/tox.ini index cc22875c4..6672f4543 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,7 @@ setenv = allowlist_externals = {toxinidir}/ci/build_ndcore.sh commands = - {toxinidir}/ci/build_ndcore.sh {toxinidir}/core + {toxinidir}/ci/build_ndcore.sh {toxinidir}/neurodamus/data pytest -x --forked tests/integration