Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,7 @@ examples/results/*.dat
/tests/iv_izh2007RS0.net.nml
/tests/leak_chan.channel.nml
/tests/test_cell_analysis.cell.nml

arm64
*.neux
/test_*plot*png
/examples/plot.py
8 changes: 3 additions & 5 deletions pyneuroml/plot/Plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,14 @@ def generate_plot(
label = "" if not labels else labels[i]
marker = None if not markers else markers[i]
linewidth = 1 if not linewidths else linewidths[i]
markersize = 6 if not markersizes else markersizes[i]
markersize = None if not markersizes else markersizes[i]

if colors:
plt.plot(
xvalues[i],
yvalues[i],
"o",
color=colors[i],
marker=marker,
color=colors[i],
markersize=markersize,
linestyle=linestyle,
linewidth=linewidth,
Expand All @@ -195,7 +194,6 @@ def generate_plot(
plt.plot(
xvalues[i],
yvalues[i],
"o",
marker=marker,
markersize=markersize,
linestyle=linestyle,
Expand Down Expand Up @@ -385,7 +383,7 @@ def generate_interactive_plot(
raise ValueError("labels not provided correctly")

if not markersizes:
markersizes = len(xvalues) * [6.0]
markersizes = len(xvalues) * [6]
if not markers:
markers = len(xvalues) * [0]
if not linestyles:
Expand Down
17 changes: 11 additions & 6 deletions pyneuroml/plot/PlotSpikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@

logger = logging.getLogger(__name__)

FORMAT_ID_T = "id_t"
FORMAT_ID_TIME_NEST_DAT = "id_t_nest_dat"
FORMAT_T_ID = "t_id"


DEFAULTS = {
"format": "id_t",
"format": FORMAT_ID_T,
"rates": False,
"save_spike_plot_to": None,
"rate_window": 50,
Expand Down Expand Up @@ -74,8 +78,9 @@ def process_args():
metavar="<format>",
default=DEFAULTS["format"],
help="How the spiketimes are represented on each line of file: \n"
+ "id_t: id of cell, space(s) / tab(s), time of spike (default);\n"
+ "t_id: time of spike, space(s) / tab(s), id of cell;\n"
+ "%s: id of cell, space(s) / tab(s), time of spike (default);\n"%FORMAT_ID_T
+ "%s: id of cell, space(s) / tab(s), time of spike, allowing NEST dat file comments/metadata;\n"%FORMAT_ID_TIME_NEST_DAT
+ "%s: time of spike, space(s) / tab(s), id of cell;\n"%FORMAT_T_ID
+ "sonata: SONATA format HDF5 file containing spike times",
)

Expand Down Expand Up @@ -288,10 +293,10 @@ def run(a=None, **kwargs):
ids_in_file[name] = []

for line in spikes_file:
if not line.startswith("#"):
if a.format == "id_t":
if not line.startswith("#") and not (line.startswith("sender") and a.format == FORMAT_ID_TIME_NEST_DAT):
if a.format == FORMAT_ID_T or a.format == FORMAT_ID_TIME_NEST_DAT:
[id, t] = line.split()
elif a.format == "t_id":
elif a.format == FORMAT_T_ID:
[t, id] = line.split()
id_shifted = offset_id + int(float(id))
max_id = max(max_id, id_shifted)
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
install_requires=[
"argparse",
"pylems>=0.5.7",
"airspeed>=0.5.5",
"neuromllite>=0.4.1", # sets dependency for libNeuroML also
Expand Down
2 changes: 1 addition & 1 deletion test-ghactions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e

python setup.py install
pip install .

echo
echo "################################################"
Expand Down