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

ran black on NetPyNE #616

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 9 additions & 5 deletions netpyne/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@
NetPyNE consists of a number of sub-packages and modules.
"""

__version__ = '1.0.0.2'
__version__ = "1.0.0.2"
import os, sys
display = os.getenv('DISPLAY')
nogui = (sys.argv.count('-nogui')>0)

display = os.getenv("DISPLAY")
nogui = sys.argv.count("-nogui") > 0

__gui__ = True

if nogui: # completely disables graphics (avoids importing matplotlib)
__gui__ = False

elif not display or len(display) == 0: # if no display env available (e.g. clusters) uses 'Agg' backend to plot
elif (
not display or len(display) == 0
): # if no display env available (e.g. clusters) uses 'Agg' backend to plot
import matplotlib
matplotlib.use('Agg')

matplotlib.use("Agg")

from netpyne import analysis
from netpyne import batch
Expand Down
62 changes: 54 additions & 8 deletions netpyne/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
from __future__ import absolute_import

from future import standard_library

standard_library.install_aliases()
import warnings

warnings.filterwarnings("ignore")

# -------------------------------------------------------------------------------------------------------------------
Expand All @@ -21,22 +23,50 @@
# -------------------------------------------------------------------------------------------------------------------
# Import utils methods
# -------------------------------------------------------------------------------------------------------------------
from .utils import exception, _showFigure, _saveFigData, getCellsInclude, getCellsIncludeTags, _roundFigures, \
_smooth1d, syncMeasure, invertDictMapping, checkAvailablePlots
from .utils import (
exception,
_showFigure,
_saveFigData,
getCellsInclude,
getCellsIncludeTags,
_roundFigures,
_smooth1d,
syncMeasure,
invertDictMapping,
checkAvailablePlots,
)


# -------------------------------------------------------------------------------------------------------------------
# Import connectivity-related functions
# -------------------------------------------------------------------------------------------------------------------
from .network import plotConn, _plotConnCalculateFromSim, _plotConnCalculateFromFile, plot2Dnet, plotShape, calculateDisynaptic, \
plot2Dfiring
from .network import (
plotConn,
_plotConnCalculateFromSim,
_plotConnCalculateFromFile,
plot2Dnet,
plotShape,
calculateDisynaptic,
plot2Dfiring,
)


# -------------------------------------------------------------------------------------------------------------------
# Import spike-related functions
# -------------------------------------------------------------------------------------------------------------------
from .spikes import calculateRate, plotRates, plotSyncs, plotRaster, plotSpikeHist, plotSpikeStats, \
plotRatePSD, plotRateSpectrogram, popAvgRates, plotfI, calculatefI
from .spikes import (
calculateRate,
plotRates,
plotSyncs,
plotRaster,
plotSpikeHist,
plotSpikeStats,
plotRatePSD,
plotRateSpectrogram,
popAvgRates,
plotfI,
calculatefI,
)


# -------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -68,9 +98,25 @@
# -------------------------------------------------------------------------------------------------------------------

try:
from .interactive import iplotDipole, iplotDipoleSpectrogram, iplotDipolePSD, iplotRaster, iplotSpikeHist, iplotRatePSD, iplotTraces, iplotLFP, iplotConn, iplotRxDConcentration, iplot2Dnet, iplotSpikeStats, iplotGranger
from .interactive import (
iplotDipole,
iplotDipoleSpectrogram,
iplotDipolePSD,
iplotRaster,
iplotSpikeHist,
iplotRatePSD,
iplotTraces,
iplotLFP,
iplotConn,
iplotRxDConcentration,
iplot2Dnet,
iplotSpikeStats,
iplotGranger,
)
except:
print('Warning: could not import interactive plotting functions; make sure the "bokeh" package is installed.')
print(
'Warning: could not import interactive plotting functions; make sure the "bokeh" package is installed.'
)


# -------------------------------------------------------------------------------------------------------------------
Expand Down
Loading