Skip to content

Commit

Permalink
To v1.1.0; Update to jnml v0.12.3 jar
Browse files Browse the repository at this point in the history
Generate pngs of tests in same dirs
  • Loading branch information
pgleeson committed Sep 19, 2023
1 parent 86fab33 commit e4c7963
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 24 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion pyneuroml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyNeuroML
version = 1.0.10
version = 1.1.0
author = Padraig Gleeson
author_email = [email protected]
url = https://github.com/NeuroML/pyNeuroML
Expand Down
4 changes: 3 additions & 1 deletion test-ghactions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...
Expand Down
16 changes: 8 additions & 8 deletions tests/analysis/test_cell_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
22 changes: 11 additions & 11 deletions tests/plot/test_morphology_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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:
Expand All @@ -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()
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand All @@ -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:
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions tests/plot/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e4c7963

Please sign in to comment.