Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
[pyemma.util]: removed pystallone usage
Browse files Browse the repository at this point in the history
  • Loading branch information
franknoe committed Apr 13, 2015
1 parent 1e95071 commit b61bf17
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 110 deletions.
4 changes: 0 additions & 4 deletions pyemma/msm/estimation/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,6 @@ def prior_rev(C, alpha=-1.0):
# Transition matrix
################################################################################

# DONE: Frank implemented dense (Nonreversible + reversible with fixed pi)
# DONE: Jan Implement in Python directly (Nonreversible)
# Done: Martin Map to Stallone (Reversible)
# Done: Ben (Fix docstrings)
@shortcut('tmatrix')
def transition_matrix(C, reversible=False, mu=None, **kwargs):
r"""Estimate the transition matrix from the given countmatrix.
Expand Down
45 changes: 1 addition & 44 deletions pyemma/util/config.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,36 @@
r'''
Runtime Configuration
=====================
To configure the runtime behavior like logging system or parameters for the
Java/Python bridge, the configuration module reads several config files to build
its final set of settings. It searches for the file 'pyemma.cfg' in several
locations with different priorities:
1. $CWD/pyemma.cfg
2. /etc/pyemma.cfg
3. ~/pyemma.cfg
4. $PYTHONPATH/pyemma/pyemma.cfg (always taken as default configuration file)
The default values are stored in later file to ensure these values are always
defined. This is preferred over hardcoding them somewhere in the Python code.
Default configuration file
--------------------------
Default settings are stored in a provided pyemma.cfg file, which is included in
the Python package:
.. literalinclude:: ../../pyemma/pyemma.cfg
:language: ini
To access the config at runtime eg. the logging section:
.. code-block:: python
from pyemma.util.config import config
print config.Logging.level
Notes
-----
All values are being stored as strings, so to compare eg. if a value is True,
compare for
.. code-block:: python
if config['section'].my_bool == 'True':
pass
.. codeauthor:: Martin Scherer <m.scherer at fu-berlin.de>
Members of module
-----------------
'''

__docformat__ = "restructuredtext en"
Expand Down Expand Up @@ -87,7 +70,6 @@ def readConfiguration():
TODO: consider using json to support arbitray python objects in ini file (if this getting more complex)
"""
import pkg_resources
import sys

global configParser, conf_values, used_filenames

Expand All @@ -111,31 +93,6 @@ def readConfiguration():
raise RuntimeError("FATAL ERROR: could not read default configuration"
" file %s\n%s" % (default_pyemma_conf, e))

# handle case of different max heap sizes on 32/64 bit
is64bit = sys.maxsize > 2 ** 32
if is64bit:
maxheap = 2000
else:
maxheap = 1280

# if we have psutil, try to maximize memory usage.
try:
import psutil
# available virtual memory in mb
max_avail = psutil.virtual_memory().available / 1024 ** 2

maxheap = max(maxheap, max_avail)
except ImportError:
pass

if maxheap < 1024:
import warnings
warnings.warn('Less than 1 GB of free memory. Underlying Java virtual'
' machine capped to %s mb. Working with trajectories on'
' Java side may cause memory problems.' % maxheap)

defParser.set('Java', 'maxHeap', '%sm' % maxheap)

# store values of defParser in configParser with sections
configParser = ConfigParser.SafeConfigParser()
for section in defParser.sections():
Expand All @@ -153,4 +110,4 @@ def readConfiguration():
for item in configParser.items(section):
conf_values[section][item[0]] = item[1]

readConfiguration()
readConfiguration()
4 changes: 1 addition & 3 deletions pyemma/util/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ class PrecisionWarning(RuntimeWarning):
r"""
This warning indicates that some operation in your code leads
to a conversion of datatypes, which involves a loss/gain in
precision. For instance in the stallone wrapper only 32 bit
integer and doubles are supported. So these types have to be
converted with the known implications.
precision.
"""
pass
Expand Down
59 changes: 0 additions & 59 deletions pyemma/util/pystallone.py

This file was deleted.

0 comments on commit b61bf17

Please sign in to comment.