Skip to content

Commit e7a0ca6

Browse files
Merge pull request #221 from NeuroML/experimental
A few minor changes and bugfix for 2d plotting
2 parents c1095a6 + 93a4cc1 commit e7a0ca6

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,7 @@ examples/results/*.dat
151151
/tests/iv_izh2007RS0.net.nml
152152
/tests/leak_chan.channel.nml
153153
/tests/test_cell_analysis.cell.nml
154-
154+
arm64
155155
*.neux
156+
/test_*plot*png
157+
/examples/plot.py

pyneuroml/plot/Plot.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,14 @@ def generate_plot(
177177
label = "" if not labels else labels[i]
178178
marker = None if not markers else markers[i]
179179
linewidth = 1 if not linewidths else linewidths[i]
180-
markersize = 6 if not markersizes else markersizes[i]
180+
markersize = None if not markersizes else markersizes[i]
181181

182182
if colors:
183183
plt.plot(
184184
xvalues[i],
185185
yvalues[i],
186-
"o",
187-
color=colors[i],
188186
marker=marker,
187+
color=colors[i],
189188
markersize=markersize,
190189
linestyle=linestyle,
191190
linewidth=linewidth,
@@ -195,7 +194,6 @@ def generate_plot(
195194
plt.plot(
196195
xvalues[i],
197196
yvalues[i],
198-
"o",
199197
marker=marker,
200198
markersize=markersize,
201199
linestyle=linestyle,
@@ -385,7 +383,7 @@ def generate_interactive_plot(
385383
raise ValueError("labels not provided correctly")
386384

387385
if not markersizes:
388-
markersizes = len(xvalues) * [6.0]
386+
markersizes = len(xvalues) * [6]
389387
if not markers:
390388
markers = len(xvalues) * [0]
391389
if not linestyles:

pyneuroml/plot/PlotSpikes.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@
1212

1313
logger = logging.getLogger(__name__)
1414

15+
FORMAT_ID_T = "id_t"
16+
FORMAT_ID_TIME_NEST_DAT = "id_t_nest_dat"
17+
FORMAT_T_ID = "t_id"
18+
1519

1620
DEFAULTS = {
17-
"format": "id_t",
21+
"format": FORMAT_ID_T,
1822
"rates": False,
1923
"save_spike_plot_to": None,
2024
"rate_window": 50,
@@ -74,8 +78,9 @@ def process_args():
7478
metavar="<format>",
7579
default=DEFAULTS["format"],
7680
help="How the spiketimes are represented on each line of file: \n"
77-
+ "id_t: id of cell, space(s) / tab(s), time of spike (default);\n"
78-
+ "t_id: time of spike, space(s) / tab(s), id of cell;\n"
81+
+ "%s: id of cell, space(s) / tab(s), time of spike (default);\n"%FORMAT_ID_T
82+
+ "%s: id of cell, space(s) / tab(s), time of spike, allowing NEST dat file comments/metadata;\n"%FORMAT_ID_TIME_NEST_DAT
83+
+ "%s: time of spike, space(s) / tab(s), id of cell;\n"%FORMAT_T_ID
7984
+ "sonata: SONATA format HDF5 file containing spike times",
8085
)
8186

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

290295
for line in spikes_file:
291-
if not line.startswith("#"):
292-
if a.format == "id_t":
296+
if not line.startswith("#") and not (line.startswith("sender") and a.format == FORMAT_ID_TIME_NEST_DAT):
297+
if a.format == FORMAT_ID_T or a.format == FORMAT_ID_TIME_NEST_DAT:
293298
[id, t] = line.split()
294-
elif a.format == "t_id":
299+
elif a.format == FORMAT_T_ID:
295300
[t, id] = line.split()
296301
id_shifted = offset_id + int(float(id))
297302
max_id = max(max_id, id_shifted)

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
long_description=open("README.md").read(),
9393
long_description_content_type="text/markdown",
9494
install_requires=[
95-
"argparse",
9695
"pylems>=0.5.7",
9796
"airspeed>=0.5.5",
9897
"neuromllite>=0.4.1", # sets dependency for libNeuroML also

test-ghactions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set -e
22

3-
python setup.py install
3+
pip install .
44

55
echo
66
echo "################################################"

0 commit comments

Comments
 (0)