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

Commit 3f13a09

Browse files
authored
Merge pull request #1242 from marscher/minor
Bugfixes and export_to_hdf5
2 parents 4173ebe + 0f74323 commit 3f13a09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+628
-489
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ env:
2929
- CONDA_PY=3.5
3030
- CONDA_PY=3.6
3131

32+
matrix:
33+
exclude: # test only 2.7 on osx.
34+
- env: CONDA_PY=3.5
35+
os: osx
36+
- os: osx
37+
env: CONDA_PY=3.6
38+
3239
before_install:
3340
- source devtools/ci/travis/install_miniconda.sh
3441

conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ def add_np(doctest_namespace):
2424
np.set_printoptions(legacy='1.13')
2525
except TypeError:
2626
pass
27+
28+
29+
@pytest.fixture(autouse=True)
30+
def filter_warnings():
31+
import warnings
32+
old_filters = warnings.filters[:]
33+
warnings.filterwarnings('ignore', message='You have not selected any features. Returning plain coordinates.')
34+
yield
35+
warnings.filters = old_filters

devtools/conda-recipe/meta.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ requirements:
2727
- python
2828
- scipy
2929
- setuptools
30-
- gcc # [ not win ]
30+
- toolchain
31+
3132
run:
3233
- bhmm >=0.6,<0.7
3334
- decorator >=4.0.0
3435
- h5py
35-
- libgcc # [linux or osx]
3636
- matplotlib
3737
- mdtraj
3838
- mock # TODO: remove when py3k only.
@@ -59,6 +59,7 @@ test:
5959
requires:
6060
- pytest
6161
- pytest-cov
62+
- coverage
6263
# TODO: disabled on win64, until https://bugs.python.org/issue31701 is fixed.
6364
- pytest-faulthandler # [not win]
6465
- pytest-xdist

devtools/conda-recipe/run_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"{njobs_args} "
2323
"--junit-xml={junit_xml} "
2424
"-c {pytest_cfg}"
25+
#"--durations=20 "
2526
.format(test_pkg=test_pkg, cover_pkg=cover_pkg,
2627
junit_xml=junit_xml, pytest_cfg='setup.cfg',
2728
dest_report=os.path.join(os.path.expanduser('~/'), 'coverage.xml'),

doc/source/CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ your Python installation to at least version 3.5 to catch future updates.
1919
extracted per iteration from a data source. This is invariant to the dimension of data sets. #1190
2020
- datasets: added Prinz potential (quadwell). #1226
2121
- coordinates: added VAMP estimator. #1237
22-
22+
- coordinates: added method 'write_to_hdf5' for easy exporting streams to HDF5. #1242
2323

2424
- References:
2525

pyemma/_base/loggable.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ def logger(self):
6161
self.__create_logger()
6262
return self._logger_instance
6363

64-
@property
65-
def _logger(self):
66-
return self.logger
67-
6864
def _logger_is_active(self, level):
6965
""" @param level: int log level (debug=10, info=20, warn=30, error=40, critical=50)"""
7066
return self.logger.level >= level

pyemma/_base/serialization/serialization.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ def _get_interpolation_map(cls):
194194
return map
195195

196196
def save(self, file_name, model_name='default', overwrite=False, save_streaming_chain=False):
197-
r"""
197+
r""" saves the current state of this object to given file and name.
198+
198199
Parameters
199200
-----------
200201
file_name: str

pyemma/coordinates/api.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,16 @@ def _check_old_chunksize_arg(chunksize, chunk_size_default, **kw):
8080
chosen_chunk_size = chunksize
8181
else:
8282
import warnings
83+
from pyemma.util.annotators import get_culprit
84+
filename, lineno = get_culprit(3)
8385
if is_default: # case 2.
84-
warnings.warn('Passed deprecated argument "chunk_size", please use "chunksize"',
85-
category=_PyEMMA_DeprecationWarning)
86+
warnings.warn_explicit('Passed deprecated argument "chunk_size", please use "chunksize"',
87+
category=_PyEMMA_DeprecationWarning, filename=filename, lineno=lineno)
8688
chosen_chunk_size = kw.pop('chunk_size') # remove this argument to avoid further passing to other funcs.
8789
else: # case 3.
88-
warnings.warn('Passed two values for chunk size: "chunk_size" and "chunksize", while the first one'
89-
' is deprecated. Please use "chunksize" in the future.', category=_PyEMMA_DeprecationWarning)
90+
warnings.warn_explicit('Passed two values for chunk size: "chunk_size" and "chunksize", while the first one'
91+
' is deprecated. Please use "chunksize" in the future.',
92+
category=_PyEMMA_DeprecationWarning, filename=filename, lineno=lineno)
9093
chosen_chunk_size = chunksize
9194
assert chosen_chunk_size is not NotImplemented
9295
return chosen_chunk_size

pyemma/coordinates/clustering/include/bits/kmeans_bits.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@ KMeans<dtype>::cluster(const np_array &np_chunk, const np_array &np_centers, int
8787
}
8888
#else
8989
{
90+
std::mutex mutex;
91+
9092
std::vector<scoped_thread> threads;
9193
threads.reserve(static_cast<std::size_t>(n_threads));
9294

93-
std::mutex mutex;
9495
std::size_t grainSize = n_frames / n_threads;
9596

9697
auto worker = [&](std::size_t tid, std::size_t begin, std::size_t end, std::mutex& m) {

0 commit comments

Comments
 (0)