From 57f0a23e0033ad7a4166a0d2ec6a7087ef7fbbaa Mon Sep 17 00:00:00 2001 From: sebastiankloth Date: Mon, 23 Jan 2023 11:06:20 +0100 Subject: [PATCH] Fixed shiftetd correlation for 1 node --- mdevaluate/correlation.py | 25 ++++++---- requirements.txt | 98 +++++++++++++++++++++++++++++++++------ 2 files changed, 100 insertions(+), 23 deletions(-) diff --git a/mdevaluate/correlation.py b/mdevaluate/correlation.py index 1cc3a8f..74a4bc3 100644 --- a/mdevaluate/correlation.py +++ b/mdevaluate/correlation.py @@ -156,16 +156,21 @@ def shifted_correlation(function, frames, selector=None, segments=10, idx = np.unique(np.int_(ls) - 1) t = np.array([frames[i].time for i in idx]) - frames[0].time - pool = ProcessPool(nodes=nodes) - try: - result = np.array(pool.map(partial(get_correlation, idx=idx, - selector=selector), - start_frames)) - except Exception: - logger.warning("Something went wrong while calculating the shifted correlation!") - finally: - pool.terminate() - pool.restart() + if nodes==1: + result = np.array([get_correlation(start_frame, idx=idx, + selector=selector) + for start_frame in start_frames]) + else: + pool = ProcessPool(nodes=nodes) + try: + result = np.array(pool.map(partial(get_correlation, idx=idx, + selector=selector), + start_frames)) + except Exception: + logger.warning("Something went wrong while calculating the shifted correlation!") + finally: + pool.terminate() + pool.restart() if average == True: clean_result = [] diff --git a/requirements.txt b/requirements.txt index ed7a093..65ab9af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,44 +1,65 @@ +alabaster==0.7.12 anyio==3.6.2 argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 -asttokens==2.1.0 +arrow==1.2.3 +astroid==2.12.12 +atomicwrites==1.4.1 attrs==22.1.0 +autopep8==1.6.0 +Babel==2.11.0 backcall==0.2.0 beautifulsoup4==4.11.1 +binaryornot==0.4.4 biopython==1.79 +black==22.10.0 bleach==5.0.1 certifi==2022.9.24 cffi==1.15.1 +chardet==5.0.0 charset-normalizer==2.1.1 click==8.1.3 cloudpickle==2.2.0 contourpy==1.0.6 +cookiecutter==2.1.1 +cryptography==38.0.3 cycler==0.11.0 dask==2022.10.2 debugpy==1.6.3 decorator==5.1.1 defusedxml==0.7.1 +diff-match-patch==20200713 dill==0.3.6 +docstring-to-markdown==0.10 +docutils==0.19 entrypoints==0.4 -executing==1.2.0 fasteners==0.18 fastjsonschema==2.16.2 +flake8==5.0.4 fonttools==4.38.0 fsspec==2022.10.0 -greenlet==2.0.0 +greenlet==2.0.0.post0 GridDataFormats==1.0.1 -gsd==2.6.0 +gsd==2.6.1 idna==3.4 +imagesize==1.4.1 importlib-metadata==5.0.0 +inflection==0.5.1 +intervaltree==3.1.0 ipydatawidgets==4.3.2 ipykernel==6.17.0 -ipython==8.6.0 +ipython==7.34.0 ipython-genutils==0.2.0 ipyvolume==0.5.2 ipywebrtc==0.6.0 ipywidgets==8.0.2 +isort==5.10.1 +jaraco.classes==3.2.3 jedi==0.18.1 +jeepney==0.8.0 +jellyfish==0.9.0 Jinja2==3.1.2 +jinja2-time==0.2.0 joblib==1.2.0 jsonschema==4.17.0 jupyter==1.0.0 @@ -53,19 +74,23 @@ jupyter_client==7.4.4 jupyter_core==4.11.2 jupyterlab-pygments==0.2.2 jupyterlab-widgets==3.0.3 +keyring==23.11.0 kiwisolver==1.4.4 +lazy-object-proxy==1.8.0 locket==1.0.0 lxml==4.9.1 MarkupSafe==2.1.1 matplotlib==3.6.2 matplotlib-inline==0.1.6 +mccabe==0.7.0 MDAnalysis==2.3.0 -mdevaluate==22.11 mistune==2.0.4 mmtf-python==1.1.3 +more-itertools==9.0.0 mrcfile==1.4.3 msgpack==1.0.4 multiprocess==0.70.14 +mypy-extensions==0.4.3 nbclassic==0.4.8 nbclient==0.7.0 nbconvert==7.2.3 @@ -75,55 +100,102 @@ networkx==2.8.8 notebook==6.5.2 notebook_shim==0.2.2 numpy==1.23.4 +numpydoc==1.5.0 packaging==21.3 pandas==1.5.1 pandocfilters==1.5.0 parso==0.8.3 partd==1.3.0 pathos==0.3.0 +pathspec==0.10.1 pexpect==4.8.0 pickleshare==0.7.5 Pillow==9.3.0 +platformdirs==2.5.2 +pluggy==1.0.0 pox==0.3.2 ppft==1.7.6.6 prometheus-client==0.15.0 -prompt-toolkit==3.0.31 +prompt-toolkit==3.0.32 psutil==5.9.3 psycopg2-binary==2.9.5 ptyprocess==0.7.0 -pure-eval==0.2.2 +pycodestyle==2.9.1 pycparser==2.21 +pydocstyle==6.1.1 +pyflakes==2.5.0 Pygments==2.13.0 +pylint==2.15.5 +pylint-venv==2.3.0 +pyls-spyder==0.4.0 pyparsing==3.0.9 +PyQt5==5.15.7 +PyQt5-Qt5==5.15.2 +PyQt5-sip==12.11.0 +PyQtWebEngine==5.15.6 +PyQtWebEngine-Qt5==5.15.2 pyrsistent==0.19.2 python-dateutil==2.8.2 +python-lsp-black==1.2.1 +python-lsp-jsonrpc==1.0.0 +python-lsp-server==1.6.0 +python-slugify==6.1.2 pythreejs==2.4.1 +pytoolconfig==1.2.2 pytz==2022.6 +pyxdg==0.28 PyYAML==6.0 pyzmq==24.0.1 +QDarkStyle==3.0.3 +qstylizer==0.2.2 +QtAwesome==1.2.1 qtconsole==5.4.0 QtPy==2.2.1 requests==2.28.1 +rope==1.4.0 +Rtree==1.0.1 scipy==1.9.3 +SecretStorage==3.3.3 Send2Trash==1.8.0 six==1.16.0 sniffio==1.3.0 +snowballstemmer==2.2.0 +sortedcontainers==2.4.0 soupsieve==2.3.2.post1 -SQLAlchemy==1.4.42 -stack-data==0.6.0 -store==0.2 +Sphinx==5.3.0 +sphinxcontrib-applehelp==1.0.2 +sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-htmlhelp==2.0.0 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-serializinghtml==1.1.5 +spyder==5.4.0 +spyder-kernels==2.4.0 +SQLAlchemy==1.4.43 terminado==0.17.0 +text-unidecode==1.3 +textdistance==4.5.0 threadpoolctl==3.1.0 +three-merge==0.1.1 tinycss2==1.2.1 +toml==0.10.2 +tomli==2.0.1 +tomlkit==0.11.6 toolz==0.12.0 tornado==6.2 tqdm==4.64.1 traitlets==5.5.0 traittypes==0.2.1 -tudplot==0.1 +typing_extensions==4.4.0 +ujson==5.5.0 urllib3==1.26.12 +watchdog==2.1.9 wcwidth==0.2.5 webencodings==0.5.1 -websocket-client==1.4.1 +websocket-client==1.4.2 +whatthepatch==1.0.2 widgetsnbextension==4.0.3 +wrapt==1.14.1 +wurlitzer==3.0.2 +yapf==0.32.0 zipp==3.10.0