Package gmisclib :: Module mcmc_indexclass :: Class index_counted
[frames] | no frames]

Class index_counted

source code


This is a special-purpose wrapped version of index. Its only function is to make sure that all parameters were used, in addition to the normal checking that you do not use any parameters that are undefined.

Use it exactly as you would use index, but it is slower.

Instance Methods
 
__init__(self, idxr)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
float
p(self, *key)
Returns: the parameter indexed by *key.
source code
 
p_lower(self, ll, *key) source code
 
p_range(self, lb, ub, *key) source code
 
p_periodic(self, ub, *key)
A range with periodic boundary conditions 0 to ub.
source code
 
confirm_all_used(self)
This can be used to check that we aren't using an indexer with a problem that is too small (for instance, if the indexer was read in from a log file).
source code
 
__call__(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
__repr__(self)
repr(x) (Inherited from gmisclib.mcmc_indexclass.index)
source code
 
clear(self) (Inherited from gmisclib.mcmc_indexclass.index) source code
 
columns(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
comment(self, c) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
get_all(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
a dictionary from parameter name to value.
get_fixed(self)
Get only the fixed parameters. (Inherited from gmisclib.mcmc_indexclass.index_base)
source code
numpy.ndarray
get_prms(self)
Returns: a vector of the adjustable parameters (Inherited from gmisclib.mcmc_indexclass.index)
source code
 
hash(self) (Inherited from gmisclib.mcmc_indexclass.index) source code
 
i_k_val(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
sequence( (key, value) ) where key could be anything hashable, but is usually a tuple of strings, and value is a float.
items(self)
Returns: a sequence of all the parameter, fixed or adjustable. (Inherited from gmisclib.mcmc_indexclass.index)
source code
 
keys(self) (Inherited from gmisclib.mcmc_indexclass.index) source code
 
logdens(self, x) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
int
n(self)
Returns: the number of adjustable parameters. (Inherited from gmisclib.mcmc_indexclass.index_base)
source code
 
pN(self, num, *key) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
pNl(self, num, low, high, *key) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
pNr(self, num, low, high, *key) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
float
pc(self, *key)
Returns: the parameter indexed by *key. (Inherited from gmisclib.mcmc_indexclass.index)
source code
 
pc_lower(self, ll, *key) (Inherited from gmisclib.mcmc_indexclass.index) source code
 
set_all_fixed(self, kv)
This sets a whole dictionary's worth of fixed parameters. (Inherited from gmisclib.mcmc_indexclass.index_base)
source code
 
set_fixed(self, v, *k)
You can have "fixed" parameters that are not updated by the MCMC optimizer. (Inherited from gmisclib.mcmc_indexclass.index_base)
source code
 
set_prm(self, v, *key)
This sets one element of the parameters vector. (Inherited from gmisclib.mcmc_indexclass.index)
source code
 
set_prms(self, prm)
This sets the vector of parameters to be used and modified. (Inherited from gmisclib.mcmc_indexclass.index)
source code
 
toDisplay(self, reprkeys=None) (Inherited from gmisclib.mcmc_indexclass.index) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  reprkeys = re.compile(r'.') (Inherited from gmisclib.mcmc_indexclass.index)
Properties

Inherited from object: __class__

Method Details

__init__(self, idxr)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

p(self, *key)

source code 
Returns: float
the parameter indexed by *key.
Overrides: index_base.p

p_lower(self, ll, *key)

source code 
Raises:
  • KeyError - when you apply it to a fixed parameter below the specified ll.
Overrides: index_base.p_lower

p_range(self, lb, ub, *key)

source code 
Raises:
  • KeyError - when you apply it to a fixed parameter outside specified range (lb,ub).
Overrides: index_base.p_range

p_periodic(self, ub, *key)

source code 

A range with periodic boundary conditions 0 to ub.

Raises:
  • KeyError - when you apply it to a fixed parameter outside specified range (lb,ub).
Overrides: index.p_periodic
(inherited documentation)

confirm_all_used(self)

source code 

This can be used to check that we aren't using an indexer with a problem that is too small (for instance, if the indexer was read in from a log file).

Raises:
  • IndexKeyError - if there are some keys in the index that have not been used.