Skip to content

Commit

Permalink
ci(example): update to test pyneuroml/netpyne imports
Browse files Browse the repository at this point in the history
to ensure that matplotlib is not also imported
  • Loading branch information
sanjayankur31 committed Nov 6, 2023
1 parent 2baf027 commit 0fb5260
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Binary file modified example/example.zip
Binary file not shown.
16 changes: 11 additions & 5 deletions example/example_dir/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from netpyne import specs
from netpyne import sim
from netpyne import __version__ as version
from pyneuroml import pynml

import sys
import pkg_resources
Expand All @@ -21,14 +22,19 @@
print(f"Python version is: {sys.version}", file=f)
print("Installed packages on NSG:", file=f)
dists = [str(d).replace(" ", "==") for d in pkg_resources.working_set]
for i in dists:
print(i, file=f)

# also check if netpyne/pyneuroml etc. cause importing matplotlib: we can't
# use matplotlib on NSG because the different mpi processes cause the same
# cache file to be read, which causes crashes
print("Checking if matplotlib loaded...")
print(f"Args are: {sys.argv}")
if sys.argv.count("-nogui") > 0:
print("nogui option found")

for i in dists:
print(i, file=f)
for k in sys.modules.keys():
if "matplotlib" in k:
print(f"matplotlib still loaded: {k}")

print(f"Args are: {sys.argv}")
if sys.argv.count("-nogui") > 0:
print("nogui found")
print("Done!")
2 changes: 1 addition & 1 deletion example/testParam.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
toolId=OSBv2_EXPANSE_0_7_3
number_cores_=2
number_nodes_=1
number_nodes_=2
tasks_per_node_=2
runtime_=0.5
nrnivmodl_o_=0
Expand Down

0 comments on commit 0fb5260

Please sign in to comment.