diff --git a/.gitignore b/.gitignore index b093d80f7..f61cd928c 100644 --- a/.gitignore +++ b/.gitignore @@ -157,3 +157,10 @@ arm64 /examples/plot.py /tests/utils/test_rotation.net.nml /tests/utils/test_rotation.net.png +/tests/analysis/test_analysis_if.png +/tests/analysis/test_analysis_iv.png +/tests/analysis/test_analysis_traces.png +/tests/analysis/test_cell_analysis.cell.nml +/tests/plot/test_schematic_plot_2d_test_cell_nml_xy.png +/tests/plot/test_schematic_plot_2d_test_cell_nml_xz.png +/tests/plot/test_schematic_plot_2d_test_cell_nml_yz.png diff --git a/pyneuroml/__init__.py b/pyneuroml/__init__.py index f6e1fa408..0b930af27 100644 --- a/pyneuroml/__init__.py +++ b/pyneuroml/__init__.py @@ -8,7 +8,7 @@ __version__ = importlib_metadata.version("pyNeuroML") -JNEUROML_VERSION = "0.12.2" +JNEUROML_VERSION = "0.12.3" # Define a logger for the package logging.basicConfig( diff --git a/pyneuroml/lib/jNeuroML-0.12.3-jar-with-dependencies.jar b/pyneuroml/lib/jNeuroML-0.12.3-jar-with-dependencies.jar new file mode 100644 index 000000000..058ae1896 Binary files /dev/null and b/pyneuroml/lib/jNeuroML-0.12.3-jar-with-dependencies.jar differ diff --git a/setup.cfg b/setup.cfg index 7b9d5f00c..7f925526d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pyNeuroML -version = 1.0.10 +version = 1.1.0 author = Padraig Gleeson author_email = p.gleeson@gmail.com url = https://github.com/NeuroML/pyNeuroML diff --git a/test-ghactions.sh b/test-ghactions.sh index 7fea64aba..aa261a1d3 100755 --- a/test-ghactions.sh +++ b/test-ghactions.sh @@ -6,9 +6,11 @@ echo echo "################################################" echo "## Running unit tests" + # skip a few tests that segfault etc. on GH pytest --cov=pyneuroml -m "not localonly" . + run_neuron_examples=false if [[ ($# -eq 1) && ($1 == '-neuron') ]]; then @@ -106,7 +108,7 @@ echo echo "################################################" echo "## Test export to PovRay" - pynml-povray NML2_SingleCompHHCell.nml +pynml-povray NML2_SingleCompHHCell.nml # Requires pyelectro, not in .travis.yml yet... diff --git a/tests/analysis/test_cell_analysis.py b/tests/analysis/test_cell_analysis.py index 8138b6f3e..cf3e265af 100644 --- a/tests/analysis/test_cell_analysis.py +++ b/tests/analysis/test_cell_analysis.py @@ -38,16 +38,16 @@ def test_cell_analysis(self): c="-50.0mV", d="100pA", ) - neuroml.writers.NeuroMLWriter.write(doc, "test_cell_analysis.cell.nml") - generate_current_vs_frequency_curve("test_cell_analysis.cell.nml", + neuroml.writers.NeuroMLWriter.write(doc, "tests/analysis/test_cell_analysis.cell.nml") + generate_current_vs_frequency_curve("tests/analysis/test_cell_analysis.cell.nml", "izh2007RS0", plot_voltage_traces=True, plot_iv=True, show_plot_already=False, - save_voltage_traces_to="test_analysis_traces.png", - save_if_figure_to="test_analysis_if.png", - save_iv_figure_to="test_analysis_iv.png" + save_voltage_traces_to="tests/analysis/test_analysis_traces.png", + save_if_figure_to="tests/analysis/test_analysis_if.png", + save_iv_figure_to="tests/analysis/test_analysis_iv.png" ) - self.assertTrue(pathlib.Path("test_analysis_traces.png").is_file()) - self.assertTrue(pathlib.Path("test_analysis_if.png").is_file()) - self.assertTrue(pathlib.Path("test_analysis_iv.png").is_file()) + self.assertTrue(pathlib.Path("tests/analysis/test_analysis_traces.png").is_file()) + self.assertTrue(pathlib.Path("tests/analysis/test_analysis_if.png").is_file()) + self.assertTrue(pathlib.Path("tests/analysis/test_analysis_iv.png").is_file()) diff --git a/tests/plot/test_morphology_plot.py b/tests/plot/test_morphology_plot.py index 151625219..2e24b0b5b 100644 --- a/tests/plot/test_morphology_plot.py +++ b/tests/plot/test_morphology_plot.py @@ -45,7 +45,7 @@ def test_2d_point_plotter(self): for nml_file in nml_files: ofile = pl.Path(nml_file).name for plane in ["xy", "yz", "xz"]: - filename = f"test_morphology_plot_2d_point_{ofile.replace('.', '_', 100)}_{plane}.png" + filename = f"tests/plot/test_morphology_plot_2d_point_{ofile.replace('.', '_', 100)}_{plane}.png" # remove the file first try: pl.Path(filename).unlink() @@ -70,7 +70,7 @@ def test_2d_plotter(self): for nml_file in nml_files: ofile = pl.Path(nml_file).name for plane in ["xy", "yz", "xz"]: - filename = f"test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}.png" + filename = f"tests/plot/test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}.png" # remove the file first try: pl.Path(filename).unlink() @@ -90,7 +90,7 @@ def test_2d_morphology_plotter_data_overlay(self): cell = nml_doc.cells[0] # type: neuroml.Cell ofile = pl.Path(nml_file).name plane = "xy" - filename = f"test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}_with_data.png" + filename = f"tests/plot/test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}_with_data.png" # remove the file first try: pl.Path(filename).unlink() @@ -121,7 +121,7 @@ def test_2d_plotter_network(self): ofile = pl.Path(nml_file).name for plane in ["xy", "yz", "xz"]: filename = ( - f"test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}.png" + f"tests/plot/test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}.png" ) # remove the file first try: @@ -139,7 +139,7 @@ def test_2d_constant_plotter_network(self): nml_file = "tests/plot/L23-example/TestNetwork.net.nml" ofile = pl.Path(nml_file).name for plane in ["xy", "yz", "xz"]: - filename = f"test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}_constant.png" + filename = f"tests/plot/test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}_constant.png" # remove the file first try: pl.Path(filename).unlink() @@ -162,7 +162,7 @@ def test_2d_schematic_plotter_network(self): nml_file = "tests/plot/L23-example/TestNetwork.net.nml" ofile = pl.Path(nml_file).name for plane in ["xy", "yz", "xz"]: - filename = f"test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}_schematic.png" + filename = f"tests/plot/test_morphology_plot_2d_{ofile.replace('.', '_', 100)}_{plane}_schematic.png" # remove the file first try: pl.Path(filename).unlink() @@ -221,7 +221,7 @@ def test_3d_plotter_plotly(self): nml_files = ["tests/plot/Cell_497232312.cell.nml", "tests/plot/test.cell.nml"] for nml_file in nml_files: ofile = pl.Path(nml_file).name - filename = f"test_morphology_plot_3d_{ofile.replace('.', '_', 100)}.png" + filename = f"tests/plot/test_morphology_plot_3d_{ofile.replace('.', '_', 100)}.png" # remove the file first try: pl.Path(filename).unlink() @@ -249,7 +249,7 @@ def test_2d_schematic_plotter(self): for plane in ["xy", "yz", "xz"]: # olm cell filename = ( - f"test_schematic_plot_2d_{olm_ofile.replace('.', '_', 100)}_{plane}.png" + f"tests/plot/test_schematic_plot_2d_{olm_ofile.replace('.', '_', 100)}_{plane}.png" ) try: pl.Path(filename).unlink() @@ -266,7 +266,7 @@ def test_2d_schematic_plotter(self): # more complex cell filename = ( - f"test_schematic_plot_2d_{ofile.replace('.', '_', 100)}_{plane}.png" + f"tests/plot/test_schematic_plot_2d_{ofile.replace('.', '_', 100)}_{plane}.png" ) # remove the file first try: @@ -295,7 +295,7 @@ def test_plot_segment_groups_curtain_plots(self): ofile = pl.Path(nml_file).name # more complex cell - filename = f"test_curtain_plot_2d_{ofile.replace('.', '_', 100)}.png" + filename = f"tests/plot/test_curtain_plot_2d_{ofile.replace('.', '_', 100)}.png" # remove the file first try: pl.Path(filename).unlink() @@ -325,7 +325,7 @@ def test_plot_segment_groups_curtain_plots_with_data(self): ofile = pl.Path(nml_file).name # more complex cell - filename = f"test_curtain_plot_2d_{ofile.replace('.', '_', 100)}_withdata.png" + filename = f"tests/plot/test_curtain_plot_2d_{ofile.replace('.', '_', 100)}_withdata.png" # remove the file first try: pl.Path(filename).unlink() diff --git a/tests/plot/test_plot.py b/tests/plot/test_plot.py index 69847070d..b14a8181f 100644 --- a/tests/plot/test_plot.py +++ b/tests/plot/test_plot.py @@ -24,7 +24,7 @@ class TestPlot(BaseTestCase): def test_generate_plot(self): """Test generate_plot function.""" - filename = "test_generate_plot.png" + filename = "tests/plot/test_generate_plot.png" # remove the file first try: @@ -56,7 +56,7 @@ def test_generate_plot(self): def test_generate_interactive_plot(self): """Test generate_interactive_plot function.""" - filename = "test_generate_interactive_plot.png" + filename = "tests/plot/test_generate_interactive_plot.png" # remove the file first try: