-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(connectivity-plots): move matrix plot to new sub-module
- Loading branch information
1 parent
e2d9123
commit cc7d747
Showing
2 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Connectivity plotting methods | ||
File: pyneuroml/plot/Connectivity.py | ||
Copyright 2023 NeuroML contributors | ||
""" | ||
|
||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.INFO) | ||
|
||
|
||
def plot_connectivity_matrix(filename, level): | ||
"""Plot a connectivity matrix | ||
:param filename: name of NeuroML file | ||
:type filename: str | ||
:param level: level at which to plot | ||
:type level: int | ||
""" | ||
from neuromllite.MatrixHandler import MatrixHandler | ||
from neuroml.hdf5.NeuroMLXMLParser import NeuroMLXMLParser | ||
|
||
logger.info("Converting %s to matrix form, level %i" % (filename, level)) | ||
|
||
handler = MatrixHandler(level=level, nl_network=None) | ||
|
||
currParser = NeuroMLXMLParser(handler) | ||
currParser.parse(filename) | ||
handler.finalise_document() | ||
|
||
logger.info("Done with MatrixHandler...") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters