Skip to content

Commit

Permalink
Merge pull request #259 from NeuroML/development
Browse files Browse the repository at this point in the history
To 1.1.2
  • Loading branch information
sanjayankur31 authored Sep 21, 2023
2 parents b365cd3 + c33a5f1 commit e49d725
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 68 deletions.
6 changes: 3 additions & 3 deletions man/man1/pynml-archive.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-ARCHIVE "1" "August 2023" "pynml-archive v1.0.10" "User Commands"
.TH PYNML-ARCHIVE "1" "September 2023" "pynml-archive v1.1.2" "User Commands"
.SH NAME
pynml-archive \- manual page for pynml-archive v1.0.10
pynml-archive \- manual page for pynml-archive v1.1.2
.SH DESCRIPTION
usage: pynml\-archive [\-h] [\-zipfileName <zip file name>]
.TP
Expand Down Expand Up @@ -29,7 +29,7 @@ Extension to use for archive.
Explicit list of files to create archive of.
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-channelanalysis.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-CHANNELANALYSIS "1" "August 2023" "pynml-channelanalysis v1.0.10" "User Commands"
.TH PYNML-CHANNELANALYSIS "1" "September 2023" "pynml-channelanalysis v1.1.2" "User Commands"
.SH NAME
pynml-channelanalysis \- manual page for pynml-channelanalysis v1.0.10
pynml-channelanalysis \- manual page for pynml-channelanalysis v1.1.2
.SH DESCRIPTION
usage: pynml\-channelanalysis [\-h] [\-v] [\-minV <min v>] [\-maxV <max v>]
.TP
Expand Down Expand Up @@ -94,7 +94,7 @@ Save currents through voltage clamp at each level &
plot current vs voltage for ion channel
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-channelml2nml.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-CHANNELML2NML "1" "August 2023" "pynml-channelml2nml v1.0.10" "User Commands"
.TH PYNML-CHANNELML2NML "1" "September 2023" "pynml-channelml2nml v1.1.2" "User Commands"
.SH NAME
pynml-channelml2nml \- manual page for pynml-channelml2nml v1.0.10
pynml-channelml2nml \- manual page for pynml-channelml2nml v1.1.2
.SH DESCRIPTION
usage: pynml\-channelml2nml [\-h] [\-xsltfile <XSLT file>]
.TP
Expand All @@ -25,7 +25,7 @@ Path to the XSLT file
Name of the outputfile file
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-modchananalysis.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-MODCHANANALYSIS "1" "August 2023" "pynml-modchananalysis v1.0.10" "User Commands"
.TH PYNML-MODCHANANALYSIS "1" "September 2023" "pynml-modchananalysis v1.1.2" "User Commands"
.SH NAME
pynml-modchananalysis \- manual page for pynml-modchananalysis v1.0.10
pynml-modchananalysis \- manual page for pynml-modchananalysis v1.1.2
.SH DESCRIPTION
usage: pynml\-modchananalysis [\-h] [\-v] [\-nogui] [\-minV <min v>]
.TP
Expand Down Expand Up @@ -56,7 +56,7 @@ in mM)
Name of the mod file containing the channel
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-plotchan.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-PLOTCHAN "1" "August 2023" "pynml-plotchan v1.0.10" "User Commands"
.TH PYNML-PLOTCHAN "1" "September 2023" "pynml-plotchan v1.1.2" "User Commands"
.SH NAME
pynml-plotchan \- manual page for pynml-plotchan v1.0.10
pynml-plotchan \- manual page for pynml-plotchan v1.1.2
.SH DESCRIPTION
usage: pynml\-plotchan [\-h] [\-noDistancePlots] [\-nogui]
.IP
Expand All @@ -25,7 +25,7 @@ Do not generate distance plots
Do not show plots as they are generated
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
14 changes: 9 additions & 5 deletions man/man1/pynml-plotmorph.1
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-PLOTMORPH "1" "August 2023" "pynml-plotmorph v1.0.10" "User Commands"
.TH PYNML-PLOTMORPH "1" "September 2023" "pynml-plotmorph v1.1.2" "User Commands"
.SH NAME
pynml-plotmorph \- manual page for pynml-plotmorph v1.0.10
pynml-plotmorph \- manual page for pynml-plotmorph v1.1.2
.SH DESCRIPTION
usage: pynml\-plotmorph [\-h] [\-v] [\-nogui] [\-plane2d <plane, e.g. xy, yz, zx>]
.TP
[\-plotType <type: detailed, constant, or schematic>]
[\-pointFraction <fraction of each population to plot as point cells>]
[\-plotType <type: detailed, constant, schematic, or point>]
[\-theme <theme: light, dark>]
[\-minWidth <min width of lines>] [\-interactive3d]
[\-saveToFile <Image file name>] [\-square]
Expand All @@ -30,7 +31,10 @@ Don't open plot window
\fB\-plane2d\fR <plane, e.g. xy, yz, zx>
Plane to plot on for 2D plot
.TP
\fB\-plotType\fR <type: detailed, constant, or schematic>
\fB\-pointFraction\fR <fraction of each population to plot as point cells>
Fraction of network to plot as point cells
.TP
\fB\-plotType\fR <type: detailed, constant, schematic, or point>
Level of detail to plot in
.TP
\fB\-theme\fR <theme: light, dark>
Expand All @@ -51,7 +55,7 @@ Scale axes so that image is approximately square, for
2D plot
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-plotspikes.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-PLOTSPIKES "1" "August 2023" "pynml-plotspikes v1.0.10" "User Commands"
.TH PYNML-PLOTSPIKES "1" "September 2023" "pynml-plotspikes v1.1.2" "User Commands"
.SH NAME
pynml-plotspikes \- manual page for pynml-plotspikes v1.0.10
pynml-plotspikes \- manual page for pynml-plotspikes v1.1.2
.SH DESCRIPTION
usage: pynml\-plotspikes [\-h] [\-format <format>] [\-rates] [\-showPlotsAlready]
.TP
Expand Down Expand Up @@ -44,7 +44,7 @@ Window for rate calculation in ms
Number of bins for rate histogram
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-povray.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-POVRAY "1" "August 2023" "pynml-povray v1.0.10" "User Commands"
.TH PYNML-POVRAY "1" "September 2023" "pynml-povray v1.1.2" "User Commands"
.SH NAME
pynml-povray \- manual page for pynml-povray v1.0.10
pynml-povray \- manual page for pynml-povray v1.1.2
.SH DESCRIPTION
usage: pynml\-povray [\-h] [\-split] [\-background <background colour>] [\-movie]
.TP
Expand Down Expand Up @@ -96,7 +96,7 @@ cell/network
Show segment ids
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-sonata.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-SONATA "1" "August 2023" "pynml-sonata v1.0.10" "User Commands"
.TH PYNML-SONATA "1" "September 2023" "pynml-sonata v1.1.2" "User Commands"
.SH NAME
pynml-sonata \- manual page for pynml-sonata v1.0.10
pynml-sonata \- manual page for pynml-sonata v1.1.2
.SH DESCRIPTION
usage: pynml\-sonata [\-h] [\-h5] [\-jnml] [\-neuron]
.IP
Expand Down Expand Up @@ -34,7 +34,7 @@ Execute the generated LEMS/NeuroML2 model with
jNeuroML_NEURON
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-summary.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-SUMMARY "1" "August 2023" "pynml-summary v1.0.10" "User Commands"
.TH PYNML-SUMMARY "1" "September 2023" "pynml-summary v1.1.2" "User Commands"
.SH NAME
pynml-summary \- manual page for pynml-summary v1.0.10
pynml-summary \- manual page for pynml-summary v1.1.2
.SH DESCRIPTION
Usage:
.PP
Expand All @@ -19,7 +19,7 @@ enable verbose mode
print this help text and exit
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml-tune.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-TUNE "1" "August 2023" "pynml-tune v1.0.10" "User Commands"
.TH PYNML-TUNE "1" "September 2023" "pynml-tune v1.1.2" "User Commands"
.SH NAME
pynml-tune \- manual page for pynml-tune v1.0.10
pynml-tune \- manual page for pynml-tune v1.1.2
.SH DESCRIPTION
usage: pynml\-tune [\-h] [\-simTime <simTime>] [\-dt <dt>]
.IP
Expand Down Expand Up @@ -132,7 +132,7 @@ Should (some) generated files, e.g. *.dat, be deleted
as optimisation progresses?
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
6 changes: 3 additions & 3 deletions man/man1/pynml.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML "1" "August 2023" "pynml v1.0.10" "User Commands"
.TH PYNML "1" "September 2023" "pynml v1.1.2" "User Commands"
.SH NAME
pynml \- manual page for pynml v1.0.10
pynml \- manual page for pynml v1.1.2
.SH DESCRIPTION
usage: pynml [\-h|\-\-help] [<shared options>] <one of the mutually\-exclusive options>
.PP
Expand Down Expand Up @@ -180,7 +180,7 @@ latest Schema
v1.8.1 Schema
.SH ENVIRONMENT
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
.SH "SEE ALSO"
.BR pynml (1),
.BR pynml-channelanalysis (1),
Expand Down
2 changes: 1 addition & 1 deletion man/man1/version.h2m
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[environment]
.PP
pyNeuroML v1.0.10 (libNeuroML v0.5.3, jNeuroML v0.12.2)
pyNeuroML v1.1.2 (libNeuroML v0.5.3, jNeuroML v0.12.4)
28 changes: 19 additions & 9 deletions pyneuroml/plot/PlotMorphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,24 @@ def plot_2D(
verbose=False,
optimized=True,
)

if title is None:
try:
title = f"{nml_model.networks[0].id} from {nml_file}"
except IndexError:
title = f"{nml_model.cells[0].id} from {nml_file}"
elif isinstance(nml_file, Cell):
nml_model = NeuroMLDocument(id="newdoc")
nml_model.add(nml_file)
if title is None:
title = f"{nml_model.cells[0].id}"

elif isinstance(nml_file, NeuroMLDocument):
nml_model = nml_file
if title is None:
try:
title = f"{nml_model.networks[0].id} from {nml_file.id}"
except IndexError:
title = f"{nml_model.cells[0].id} from {nml_file.id}"
else:
raise TypeError(
"Passed model is not a NeuroML file path, nor a neuroml.Cell, nor a neuroml.NeuroMLDocument"
Expand All @@ -283,19 +294,16 @@ def plot_2D(
nml_model, verbose, nml_file if type(nml_file) is str else ""
)

if title is None:
if len(nml_model.networks) > 0:
title = "2D plot of %s from %s" % (nml_model.networks[0].id, nml_file)
else:
title = "2D plot of %s" % (nml_model.cells[0].id)

if verbose:
logger.debug(f"positions: {positions}")
logger.debug(f"pop_id_vs_cell: {pop_id_vs_cell}")
logger.debug(f"cell_id_vs_cell: {cell_id_vs_cell}")
logger.debug(f"pop_id_vs_color: {pop_id_vs_color}")
logger.debug(f"pop_id_vs_radii: {pop_id_vs_radii}")

# not used, clear up
del cell_id_vs_cell

fig, ax = get_new_matplotlib_morph_plot(title, plane2d)
axis_min_max = [float("inf"), -1 * float("inf")]

Expand All @@ -322,7 +330,8 @@ def plot_2D(
except KeyError:
pass

for pop_id, cell in pop_id_vs_cell.items():
while pop_id_vs_cell:
pop_id, cell = pop_id_vs_cell.popitem()
pos_pop = positions[pop_id] # type: typing.Dict[typing.Any, typing.List[float]]

# reinit point_cells for each loop
Expand All @@ -337,7 +346,8 @@ def plot_2D(
except KeyError:
pass

for cell_index, pos in pos_pop.items():
while pos_pop:
cell_index, pos = pos_pop.popitem()
radius = pop_id_vs_radii[pop_id] if pop_id in pop_id_vs_radii else 10
color = pop_id_vs_color[pop_id] if pop_id in pop_id_vs_color else None

Expand Down
Loading

0 comments on commit e49d725

Please sign in to comment.