Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For 1.1.3 release #263

Merged
merged 36 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c6ac0f9
To v1.1.3
pgleeson Sep 22, 2023
7e73bf3
Use jnml jar v0.13.0
pgleeson Sep 22, 2023
f9aa70b
feat(vispy-plotter): use instance meshes to improve performance
sanjayankur31 Sep 29, 2023
afbaed6
feat(vispy-plotter): remove text in plotter window
sanjayankur31 Sep 29, 2023
bd87e80
feat(vispy-plotter): update main function for detailed plotting
sanjayankur31 Sep 29, 2023
e3755ec
feat(vispy-plotter): complete instance mesh implementation
sanjayankur31 Sep 30, 2023
aaafbae
fix(vispy-plotter): update schematic method
sanjayankur31 Oct 1, 2023
bef0d82
feat(deps): include pyopengl
sanjayankur31 Oct 1, 2023
664da55
chore(vispy): select opengl when creating new canvas
sanjayankur31 Oct 1, 2023
20c157e
test(vispy): turn off gui
sanjayankur31 Oct 1, 2023
c2d3216
feat(vispy): add progressbar to give user feedback on what's happening
sanjayankur31 Oct 2, 2023
f2281f6
chore(plotter): stop printing namespace
sanjayankur31 Oct 2, 2023
0d38b22
chore(mesh): add todo
sanjayankur31 Oct 2, 2023
eae12e1
fix(vispy-plotter): fix ref axes
sanjayankur31 Oct 2, 2023
2b67212
chore(deps): remove unused pandas
sanjayankur31 Oct 2, 2023
e07cba8
feat(vispy): include scipy requirement
sanjayankur31 Oct 2, 2023
eab99d7
Merge pull request #261 from NeuroML/chore/drop-pandas
sanjayankur31 Oct 2, 2023
61d83da
Merge branch 'development' into feat/vispy-performance
sanjayankur31 Oct 2, 2023
770c996
refactor(plotting): split out on-demand loading to separate function
sanjayankur31 Oct 3, 2023
784fd15
chore: move util to plotting utils
sanjayankur31 Oct 3, 2023
fef3322
feat: centralize mesh heuristic
sanjayankur31 Oct 4, 2023
4e26db9
fix(mesh-plotter): respect min width argument
sanjayankur31 Oct 4, 2023
3782ab9
chore: make logging debug rather than info
sanjayankur31 Oct 4, 2023
c5bcaf2
chore: include PyOpenGL-accelerate for vispy extra
sanjayankur31 Oct 4, 2023
2d52c2d
fix(vispy-plotter): fix calculation of total cells/segments
sanjayankur31 Oct 4, 2023
f2abed7
fix(mesh-maker): handle special case of single compartmental cell
sanjayankur31 Oct 4, 2023
d1568e6
fix(3dplotter): disable optimized loading for older HDF5 compatibility
sanjayankur31 Oct 4, 2023
9512426
chore: log debug mesh addition for each segment
sanjayankur31 Oct 4, 2023
3a9e57d
fix(vispy-plotter): handle point cells
sanjayankur31 Oct 4, 2023
ff794ba
fix(2d-plotter): also tweak for hdf5 files
sanjayankur31 Oct 4, 2023
2d62eb4
feat(vispy-plotter): implement heuristic to ensure performance
sanjayankur31 Oct 10, 2023
1aa7de0
fix(vispy-plotter): correct variable declaration
sanjayankur31 Oct 10, 2023
8ee1189
chore(channel-density-plots): add link to matplotlib colormaps
sanjayankur31 Oct 10, 2023
86f04b5
docs: add vispy and plotly modules
sanjayankur31 Oct 18, 2023
1c64f84
feat(vispy): update deps to use pyqt6, supply min vispy version
sanjayankur31 Oct 19, 2023
03e3230
Merge pull request #260 from NeuroML/feat/vispy-performance
sanjayankur31 Oct 19, 2023
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
15 changes: 15 additions & 0 deletions docs/source/pyneuroml.plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@ pyneuroml.plot.PlotMorphology module
:show-inheritance:
:exclude-members: set, add_line, plot_from_console, main, process_args, LineDataUnits

pyneuroml.plot.PlotMorphologyVispy module
------------------------------------------

.. automodule:: pyneuroml.plot.PlotMorphologyVispy
:members:
:undoc-members:
:show-inheritance:

pyneuroml.plot.PlotMorphologyPlotly module
------------------------------------------

.. automodule:: pyneuroml.plot.PlotMorphologyPlotly
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion pyneuroml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
__version__ = importlib_metadata.version("pyNeuroML")


JNEUROML_VERSION = "0.12.4"
JNEUROML_VERSION = "0.13.0"

# Define a logger for the package
logging.basicConfig(
Expand Down
8 changes: 5 additions & 3 deletions pyneuroml/analysis/ChannelDensityPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def plot_channel_densities(
show_plots_already: bool = True,
morph_plot_type: str = "constant",
morph_min_width: float = 2.0,
target_directory=None
target_directory=None,
):
"""Plot channel densities on a Cell on morphology plots.

Expand Down Expand Up @@ -601,11 +601,13 @@ def plot_channel_densities(
:param colormap_name: name of matplotlib colormap to use for morph plot.
Note that if there's only one overlay value, the colormap is modified
to only show the max value of the colormap to indicate this.

See: https://matplotlib.org/stable/users/explain/colors/colormaps.html
:type colormap_name: str
:returns: None
"""
tgt_dir = target_directory+'/' if target_directory else './'
tgt_dir = target_directory + "/" if target_directory else "./"

if channel_density_ids is not None and ion_channels is not None:
raise ValueError(
"Only one of channel_density_ids or ions channels may be provided"
Expand Down
Binary file not shown.
58 changes: 30 additions & 28 deletions pyneuroml/plot/PlotMorphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,31 @@


import argparse
import logging
import os
import sys
import random

import sys
import typing
import logging

import numpy
import matplotlib
import numpy
from matplotlib import pyplot as plt

from neuroml import Cell, NeuroMLDocument, Segment, SegmentGroup
from neuroml.neuro_lex_ids import neuro_lex_ids
from pyneuroml.pynml import read_neuroml2_file
from pyneuroml.utils.cli import build_namespace
from pyneuroml.utils import extract_position_info
from pyneuroml.utils.cli import build_namespace
from pyneuroml.utils.plot import (
add_text_to_matplotlib_2D_plot,
get_next_hex_color,
DEFAULTS,
add_box_to_matplotlib_2D_plot,
get_new_matplotlib_morph_plot,
autoscale_matplotlib_plot,
add_scalebar_to_matplotlib_plot,
add_line_to_matplotlib_2D_plot,
DEFAULTS,
add_scalebar_to_matplotlib_plot,
add_text_to_matplotlib_2D_plot,
autoscale_matplotlib_plot,
get_new_matplotlib_morph_plot,
get_next_hex_color,
load_minimal_morphplottable__model,
)
from neuroml import SegmentGroup, Cell, Segment, NeuroMLDocument
from neuroml.neuro_lex_ids import neuro_lex_ids


logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -144,7 +142,7 @@ def plot_from_console(a: typing.Optional[typing.Any] = None, **kwargs: str):
:param kwargs: other arguments
"""
a = build_namespace(DEFAULTS, a, **kwargs)
print(a)
logger.debug(a)
if a.interactive3d:
from pyneuroml.plot.PlotMorphologyVispy import plot_interactive_3D

Expand Down Expand Up @@ -251,21 +249,27 @@ def plot_2D(
if verbose:
print("Plotting %s" % nml_file)

# do not recursive read the file, the extract_position_info function will
# do that for us, from a copy of the model
if type(nml_file) is str:
nml_model = read_neuroml2_file(
nml_file,
include_includes=False,
check_validity_pre_include=False,
verbose=False,
optimized=True,
)
# load without optimization for older HDF5 API
# TODO: check if this is required: must for MultiscaleISN
if nml_file.endswith(".h5"):
nml_model = read_neuroml2_file(nml_file)
else:
nml_model = read_neuroml2_file(
nml_file,
include_includes=False,
check_validity_pre_include=False,
verbose=False,
optimized=True,
)
load_minimal_morphplottable__model(nml_model, nml_file)

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)
Expand All @@ -290,9 +294,7 @@ def plot_2D(
positions,
pop_id_vs_color,
pop_id_vs_radii,
) = extract_position_info(
nml_model, verbose, nml_file if type(nml_file) is str else ""
)
) = extract_position_info(nml_model, verbose)

if verbose:
logger.debug(f"positions: {positions}")
Expand Down
Loading