Skip to content

Commit

Permalink
some features visibility changed
Browse files Browse the repository at this point in the history
  • Loading branch information
dokato committed Aug 17, 2015
1 parent 8cfe7b3 commit 85bd729
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
5 changes: 3 additions & 2 deletions connectivipy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#! /usr/bin/env python

from data import Data
from conn import ConnectAR, spectrum, spectrumft, DTF
from conn import conn_estim_dc
from mvarmodel import Mvar
from mvar.fitting import mvar_gen, mvar_gen_inst

__version__ = '0.31'
__version__ = '0.34'
6 changes: 4 additions & 2 deletions connectivipy/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def plot_conn(self, name='', ylim=None, xlim=None, signi=True, show=True):
if show:
plt.show()

def plot_short_time_conn(self, name='',signi=True, show=True):
def plot_short_time_conn(self, name='', signi=True, percmax=1., show=True):
'''
Plot short-time version of estimation results.
Expand All @@ -348,6 +348,8 @@ def plot_short_time_conn(self, name='',signi=True, show=True):
*signi* = True : boolean
reset irrelevant values; it works only after short time
significance calculation using *short_time_significance*
*percmax* = 1. : float (0,1)
percent of maximal value which is maximum on the color map
*show* = True : boolean
show the plot or not
'''
Expand All @@ -365,7 +367,7 @@ def plot_short_time_conn(self, name='',signi=True, show=True):
for i in xrange(self.__chans):
mask[:,:,i,i] = 1
masked_shtimest = np.ma.array(shtvalues, mask=mask)
dtmax = np.max(masked_shtimest)
dtmax = np.max(masked_shtimest)*percmax
dtmin = np.min(masked_shtimest)
for i in xrange(self.__chans):
for j in xrange(self.__chans):
Expand Down
20 changes: 10 additions & 10 deletions connectivipy/mvarmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ class Mvar(object):
acronym of algorithm and value is a function from *mvar.fitting*.
"""

_fit_dict = {'yw': yulewalker,
'ns': nutallstrand,
'vm': vieiramorf}
fit_dict = {'yw': yulewalker,
'ns': nutallstrand,
'vm': vieiramorf}

@classmethod
def fit(cls, data, order=None, method='yw'):
"""
Mvar model fitting.
Args:
*data* : numpy.array
array with data (kXN, k - channels nr, N - data points)
array with data shaped (k, N), k - channels nr, N - data points)
*order*=None : int
model order, when default None it estimates order using
akaike order criteria.
Expand All @@ -34,11 +34,11 @@ def fit(cls, data, order=None, method='yw'):
reflection matrix (kXk)
"""
if order == None:
order, crit_val = cls._order_hq(data, p_max=None, method=method)
return cls._fit_dict[method](data,order)
order, crit_val = cls.order_hq(data, p_max=None, method=method)
return cls.fit_dict[method](data,order)

@classmethod
def _order_akaike(cls, data, p_max=None, method='yw'):
def order_akaike(cls, data, p_max=None, method='yw'):
"""
Akaike criterion of MVAR order estimation.
Expand Down Expand Up @@ -73,7 +73,7 @@ def _order_akaike(cls, data, p_max=None, method='yw'):
return np.argmin(crit)+1, crit

@classmethod
def _order_hq(cls, data, p_max=None, method='yw'):
def order_hq(cls, data, p_max=None, method='yw'):
"""
Hannan-Quin criterion of MVAR order estimation.
Expand Down Expand Up @@ -108,7 +108,7 @@ def _order_hq(cls, data, p_max=None, method='yw'):
return np.argmin(crit)+1, crit

@classmethod
def _order_schwartz(cls, data, p_max=None, method='yw'):
def order_schwartz(cls, data, p_max=None, method='yw'):
"""
Schwartz criterion of MVAR order estimation.
Expand Down Expand Up @@ -143,7 +143,7 @@ def _order_schwartz(cls, data, p_max=None, method='yw'):
return np.argmin(crit)+1, crit

@classmethod
def _order_fpe(cls, data, p_max=None, method='yw'):
def order_fpe(cls, data, p_max=None, method='yw'):
"""
Final Prediction Error criterion of MVAR order estimation.
(not recommended)
Expand Down
13 changes: 9 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
'sphinx.ext.viewcode',
]

#Autodoc
autodoc_member_order = 'bysource'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand All @@ -57,9 +60,9 @@
# built documents.
#
# The short X.Y version.
version = '0.32'
version = '0.34'
# The full version, including alpha/beta/rc tags.
release = '0.32a'
release = '0.34a'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -124,7 +127,7 @@
#html_title = None

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
html_short_title = 'ConnPy'

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
Expand Down Expand Up @@ -158,7 +161,9 @@

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
html_additional_pages = {
'Download': 'https://github.com/dokato/connectivipy',
}

# If false, no module index is generated.
#html_domain_indices = True
Expand Down

0 comments on commit 85bd729

Please sign in to comment.