Skip to content

Commit

Permalink
Merge pull request #421 from NeuroML/feat/ExportSWC-ankur
Browse files Browse the repository at this point in the history
PR 407 + tweaks
  • Loading branch information
sanjayankur31 authored Sep 4, 2024
2 parents 93f8811 + 6aee352 commit 14b61a2
Show file tree
Hide file tree
Showing 41 changed files with 97,178 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ examples/results/*.dat
.mypy_cache/
/examples/test_data/TwoCell.net.png
/examples/test_data/Purk2M9s.png
/.coverage
**/.coverage
/Nav.channel.nml
/iv_izh2007RS0.net.nml
/leak_chan.channel.nml
Expand Down
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
args: [ "--maxkb=5000"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
hooks:
Expand Down
1 change: 1 addition & 0 deletions man/man1/common.h2m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-archive.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-ARCHIVE "1" "August 2024" "pynml-archive v1.3.9" "User Commands"
.TH PYNML-ARCHIVE "1" "September 2024" "pynml-archive v1.3.9" "User Commands"
.SH NAME
pynml-archive \- manual page for pynml-archive v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -45,6 +45,7 @@ master file.
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-channelanalysis.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-CHANNELANALYSIS "1" "August 2024" "pynml-channelanalysis v1.3.9" "User Commands"
.TH PYNML-CHANNELANALYSIS "1" "September 2024" "pynml-channelanalysis v1.3.9" "User Commands"
.SH NAME
pynml-channelanalysis \- manual page for pynml-channelanalysis v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -105,6 +105,7 @@ plot current vs voltage for ion channel
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-channelml2nml.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-CHANNELML2NML "1" "August 2024" "pynml-channelml2nml v1.3.9" "User Commands"
.TH PYNML-CHANNELML2NML "1" "September 2024" "pynml-channelml2nml v1.3.9" "User Commands"
.SH NAME
pynml-channelml2nml \- manual page for pynml-channelml2nml v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -36,6 +36,7 @@ Name of the outputfile file
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-modchananalysis.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-MODCHANANALYSIS "1" "August 2024" "pynml-modchananalysis v1.3.9" "User Commands"
.TH PYNML-MODCHANANALYSIS "1" "September 2024" "pynml-modchananalysis v1.3.9" "User Commands"
.SH NAME
pynml-modchananalysis \- manual page for pynml-modchananalysis v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -70,6 +70,7 @@ Name of the mod file containing the channel
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-plotchan.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-PLOTCHAN "1" "August 2024" "pynml-plotchan v1.3.9" "User Commands"
.TH PYNML-PLOTCHAN "1" "September 2024" "pynml-plotchan v1.3.9" "User Commands"
.SH NAME
pynml-plotchan \- manual page for pynml-plotchan v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -36,6 +36,7 @@ Do not show plots as they are generated
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-plotmorph.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-PLOTMORPH "1" "August 2024" "pynml-plotmorph v1.3.9" "User Commands"
.TH PYNML-PLOTMORPH "1" "September 2024" "pynml-plotmorph v1.3.9" "User Commands"
.SH NAME
pynml-plotmorph \- manual page for pynml-plotmorph v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -79,6 +79,7 @@ Scale axes so that image is approximately square, for
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-plotspikes.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-PLOTSPIKES "1" "August 2024" "pynml-plotspikes v1.3.9" "User Commands"
.TH PYNML-PLOTSPIKES "1" "September 2024" "pynml-plotspikes v1.3.9" "User Commands"
.SH NAME
pynml-plotspikes \- manual page for pynml-plotspikes v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -58,6 +58,7 @@ Number of bins for rate histogram
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-plottimeseries.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-PLOTTIMESERIES "1" "August 2024" "pynml-plottimeseries v1.3.9" "User Commands"
.TH PYNML-PLOTTIMESERIES "1" "September 2024" "pynml-plottimeseries v1.3.9" "User Commands"
.SH NAME
pynml-plottimeseries \- manual page for pynml-plottimeseries v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -36,6 +36,7 @@ Name of the image file to save plot to
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-povray.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-POVRAY "1" "August 2024" "pynml-povray v1.3.9" "User Commands"
.TH PYNML-POVRAY "1" "September 2024" "pynml-povray v1.3.9" "User Commands"
.SH NAME
pynml-povray \- manual page for pynml-povray v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -107,6 +107,7 @@ Show segment ids
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-sonata.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-SONATA "1" "August 2024" "pynml-sonata v1.3.9" "User Commands"
.TH PYNML-SONATA "1" "September 2024" "pynml-sonata v1.3.9" "User Commands"
.SH NAME
pynml-sonata \- manual page for pynml-sonata v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -45,6 +45,7 @@ jNeuroML_NEURON
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-summary.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-SUMMARY "1" "August 2024" "pynml-summary v1.3.9" "User Commands"
.TH PYNML-SUMMARY "1" "September 2024" "pynml-summary v1.3.9" "User Commands"
.SH NAME
pynml-summary \- manual page for pynml-summary v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -30,6 +30,7 @@ print this help text and exit
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
45 changes: 45 additions & 0 deletions man/man1/pynml-swc2nml.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-SWC2NML "1" "September 2024" "pynml-swc2nml v1.3.9" "User Commands"
.SH NAME
pynml-swc2nml \- manual page for pynml-swc2nml v1.3.9
.SH DESCRIPTION
usage: pynml\-swc2nml [\-h] [\-neuromlFile <NeuroML file>] [\-morphOnly]
.IP
<SWC file>
.PP
Convert provided SWC file to NeuroML2
.SS "positional arguments:"
.TP
<SWC file>
Name of the input SWC file
.SS "options:"
.TP
\fB\-h\fR, \fB\-\-help\fR
show this help message and exit
.TP
\fB\-neuromlFile\fR <NeuroML file>
Name of the output NeuroML file
.TP
\fB\-morphOnly\fR
Export as standalone Morphology, not as a Cell
.SH "SEE-ALSO"
.BR pynml (1),
.BR pynml-archive (1),
.BR pynml-channelanalysis (1),
.BR pynml-channelml2nml (1),
.BR pynml-modchananalysis (1),
.BR pynml-plotchan (1),
.BR pynml-plotmorph (1),
.BR pynml-plotspikes (1),
.BR pynml-plottimeseries (1),
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Please see https://docs.neuroml.org for complete documentation on the NeuroML standard and the software ecosystem.
.SH ENVIRONMENT
.PP
pyNeuroML v1.3.9 (libNeuroML v0.6.4, jNeuroML v0.13.3)
3 changes: 2 additions & 1 deletion man/man1/pynml-tune.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-TUNE "1" "August 2024" "pynml-tune v1.3.9" "User Commands"
.TH PYNML-TUNE "1" "September 2024" "pynml-tune v1.3.9" "User Commands"
.SH NAME
pynml-tune \- manual page for pynml-tune v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -143,6 +143,7 @@ as optimisation progresses?
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml-xpp.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML-XPP "1" "August 2024" "pynml-xpp v1.3.9" "User Commands"
.TH PYNML-XPP "1" "September 2024" "pynml-xpp v1.3.9" "User Commands"
.SH NAME
pynml-xpp \- manual page for pynml-xpp v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -45,6 +45,7 @@ Plot saved variables
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
3 changes: 2 additions & 1 deletion man/man1/pynml.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH PYNML "1" "August 2024" "pynml v1.3.9" "User Commands"
.TH PYNML "1" "September 2024" "pynml v1.3.9" "User Commands"
.SH NAME
pynml \- manual page for pynml v1.3.9
.SH DESCRIPTION
Expand Down Expand Up @@ -219,6 +219,7 @@ Load NeuroML file(s), and convert it to swc format
.BR pynml-povray (1),
.BR pynml-sonata (1),
.BR pynml-summary (1),
.BR pynml-swc2nml (1),
.BR pynml-tune (1),
.BR pynml-xpp (1),
.PP
Expand Down
17 changes: 12 additions & 5 deletions pyneuroml/plot/PlotMorphologyVispy.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,18 @@ def plot_interactive_3D(
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 random.choice(get_color_names())
)

# use color if specified in property
try:
color = pop_id_vs_color[pop_id]
except KeyError:
# if single cell only, use default groups
if total_cells == 1:
color = "default groups"
# if multiple cells, use different colors for each cell
else:
color = random.choice(get_color_names())

# if hightlight spec has a color for the cell, use that
try:
color = highlight_spec[cell.id]["cell_color"]
Expand Down
Loading

0 comments on commit 14b61a2

Please sign in to comment.