From 4bc48d5c4433da53ef213ec628c39c3cc9f95dbb Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 20 Dec 2022 07:20:30 +0000 Subject: [PATCH 01/30] check what's installed by cron job --- .github/workflows/gh-ci-cron.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 1234fefe156..477a5b5dd86 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -1,5 +1,9 @@ name: GH Actions Cron CI on: + pull_request: + branches: + - develop + - master schedule: # 3 am Tuesdays and Fridays - cron: "0 3 * * 2,5" @@ -45,8 +49,8 @@ jobs: - name: install_dev_versions run: | - pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy - pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy + python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy + python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy - name: install_other_deps uses: ./.github/actions/setup-deps @@ -62,6 +66,11 @@ jobs: build-tests: true build-docs: false + - name: check_install + run: | + python -m pip list + mamba list + - name: run_tests run: | pytest -n $numprocs testsuite/MDAnalysisTests --disable-pytest-warnings --durations=50 From 0a75811183f723d00f3329ecda2ed60be5361a98 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 20 Dec 2022 09:50:24 +0000 Subject: [PATCH 02/30] add workflow trigger --- .github/workflows/gh-ci-cron.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 477a5b5dd86..942707dccd4 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -1,9 +1,11 @@ name: GH Actions Cron CI on: + push: + branches: + - develop pull_request: branches: - develop - - master schedule: # 3 am Tuesdays and Fridays - cron: "0 3 * * 2,5" From 0b1f58fe98ccacefd73bcb020ecfc4bbb9dc5b88 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 20 Dec 2022 10:02:13 +0000 Subject: [PATCH 03/30] move away from mamba since it won't respect pip installs --- .github/workflows/gh-ci-cron.yaml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 942707dccd4..5c791d251eb 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -38,29 +38,16 @@ jobs: with: os-type: "ubuntu" - - name: setup_miniconda - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.9 - auto-update-conda: true - channel-priority: flexible - channels: conda-forge, bioconda - mamba-version: "*" - add-pip-as-python-dependency: true - architecture: x64 + python-version: ${{ matrix.python-version }} - name: install_dev_versions run: | python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy - - name: install_other_deps - uses: ./.github/actions/setup-deps - with: - mamba: true - numpy: "" - scipy: "" - + # Intentionally going with setup.py builds so we can build with latest - name: build_srcs uses: ./.github/actions/build-src with: @@ -68,10 +55,10 @@ jobs: build-tests: true build-docs: false - - name: check_install + - name: check_and_postinstall run: | + python -m pip install pytest-xdist python -m pip list - mamba list - name: run_tests run: | From ca2c07aae8c9c69c3b8cf8d7642038d62ddbae68 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 20 Dec 2022 11:02:58 +0000 Subject: [PATCH 04/30] add build dependencies --- .github/workflows/gh-ci-cron.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 5c791d251eb..4ba94586645 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -42,10 +42,11 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: install_dev_versions + - name: install_deps run: | python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy + python -m pip install cython packaging setuptools # Intentionally going with setup.py builds so we can build with latest - name: build_srcs From 8b1e8bf85a10b78c06d623afb94e6a4266a34425 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 27 Dec 2022 18:05:22 +0000 Subject: [PATCH 05/30] strict channel priority for cron ci --- .github/workflows/gh-ci-cron.yaml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 4ba94586645..ec8f9d6287c 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -38,15 +38,21 @@ jobs: with: os-type: "ubuntu" - - uses: actions/setup-python@v4 + - uses: conda-incubator/setup-miniconda@v2 with: - python-version: ${{ matrix.python-version }} + python-version: 3.9 + miniforge-variant: Mambaforge + miniforge-version: latest + channel-priority: strict + channels: scipy-wheels-nightly, conda-forge, bioconda + add-pip-as-python-dependency: true + architecture: x64 - name: install_deps - run: | - python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy - python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy - python -m pip install cython packaging setuptools + uses: ./.github/actions/setup-deps + with: + mamba: true + full-deps: true # Intentionally going with setup.py builds so we can build with latest - name: build_srcs @@ -56,11 +62,6 @@ jobs: build-tests: true build-docs: false - - name: check_and_postinstall - run: | - python -m pip install pytest-xdist - python -m pip list - - name: run_tests run: | pytest -n $numprocs testsuite/MDAnalysisTests --disable-pytest-warnings --durations=50 From a6feb4c422ba07521910c538a7fed3c084003793 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 27 Dec 2022 18:13:07 +0000 Subject: [PATCH 06/30] switch things around --- .github/workflows/gh-ci-cron.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index ec8f9d6287c..8abea94cb07 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -40,11 +40,11 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: - python-version: 3.9 + python-version: 3.10 miniforge-variant: Mambaforge miniforge-version: latest channel-priority: strict - channels: scipy-wheels-nightly, conda-forge, bioconda + channels: conda-forge, bioconda add-pip-as-python-dependency: true architecture: x64 @@ -54,6 +54,17 @@ jobs: mamba: true full-deps: true + # overwrite installs by picking up nightly wheels + - name: nightly_wheels + run: | + pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib + + + - name: check_deps + run: | + mamba list + pip list + # Intentionally going with setup.py builds so we can build with latest - name: build_srcs uses: ./.github/actions/build-src From 4cd345839bd4d129bc2f4eea7b50111534541fab Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 27 Dec 2022 18:16:14 +0000 Subject: [PATCH 07/30] commas around your 3.10 --- .github/workflows/gh-ci-cron.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 8abea94cb07..1eac8b9eafa 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -40,7 +40,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: - python-version: 3.10 + python-version: "3.10" miniforge-variant: Mambaforge miniforge-version: latest channel-priority: strict From 58249dc529a609c8ba5f6baee9a1774143e0da3c Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 27 Dec 2022 18:27:02 +0000 Subject: [PATCH 08/30] upgrade on the pip install --- .github/workflows/gh-ci-cron.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 1eac8b9eafa..f91ecd1cd4c 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -57,7 +57,7 @@ jobs: # overwrite installs by picking up nightly wheels - name: nightly_wheels run: | - pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib + pip install -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib - name: check_deps From 2895585b4009f6c201fb7df77670b2bb68a09750 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 27 Dec 2022 22:19:20 +0000 Subject: [PATCH 09/30] use pre flag for pip --- .github/workflows/gh-ci-cron.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index f91ecd1cd4c..063885f2b56 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -57,7 +57,7 @@ jobs: # overwrite installs by picking up nightly wheels - name: nightly_wheels run: | - pip install -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib + pip install --pre -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib - name: check_deps From f239d37d611d39ab92a2e4f7d699bb2cb3f64c9f Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 27 Dec 2022 23:43:37 +0000 Subject: [PATCH 10/30] check if it's caused by numpy 1.25 --- .github/workflows/gh-ci-cron.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 063885f2b56..cad1c9ee412 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -57,7 +57,8 @@ jobs: # overwrite installs by picking up nightly wheels - name: nightly_wheels run: | - pip install --pre -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib + pip install --pre -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy h5py matplotlib + #pip install --pre -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib - name: check_deps From 4f822539062e5d323e71d2b80e772b679bcc8e05 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 28 Dec 2022 00:02:27 +0000 Subject: [PATCH 11/30] add numpy nightly wheels back in --- .github/workflows/gh-ci-cron.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index cad1c9ee412..063885f2b56 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -57,8 +57,7 @@ jobs: # overwrite installs by picking up nightly wheels - name: nightly_wheels run: | - pip install --pre -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy h5py matplotlib - #pip install --pre -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib + pip install --pre -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib - name: check_deps From 1ad15087b88c5816d1c7a330ebfe174ba8be5add Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 18:46:04 +0000 Subject: [PATCH 12/30] circumvent elementwise comparison completely --- package/MDAnalysis/visualization/streamlines_3D.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/MDAnalysis/visualization/streamlines_3D.py b/package/MDAnalysis/visualization/streamlines_3D.py index 8c546b02424..be8d098a637 100644 --- a/package/MDAnalysis/visualization/streamlines_3D.py +++ b/package/MDAnalysis/visualization/streamlines_3D.py @@ -281,7 +281,7 @@ def update_dictionary_point_in_cube_start_frame(array_simulation_particle_coordi axis=0) cube['centroid_of_particles_first_frame'] = centroid_particles_in_cube else: # empty cube - cube['centroid_of_particles_first_frame'] = 'empty' + cube['centroid_of_particles_first_frame'] = None cube_counter += 1 def update_dictionary_end_frame(array_simulation_particle_coordinates, dictionary_cube_data_this_core): @@ -289,7 +289,7 @@ def update_dictionary_end_frame(array_simulation_particle_coordinates, dictionar cube_counter = 0 for key, cube in dictionary_cube_data_this_core.items(): # if there were no particles in the cube in the first frame, then set dx,dy,dz each to 0 - if cube['centroid_of_particles_first_frame'] == 'empty': + if cube['centroid_of_particles_first_frame'] == None: cube['dx'] = 0 cube['dy'] = 0 cube['dz'] = 0 From e2a2da03d929bd70d1c47b1c576e0a8db54ecf24 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 18:58:57 +0000 Subject: [PATCH 13/30] is not == --- package/MDAnalysis/visualization/streamlines_3D.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/MDAnalysis/visualization/streamlines_3D.py b/package/MDAnalysis/visualization/streamlines_3D.py index be8d098a637..94a5d2e9b05 100644 --- a/package/MDAnalysis/visualization/streamlines_3D.py +++ b/package/MDAnalysis/visualization/streamlines_3D.py @@ -289,7 +289,7 @@ def update_dictionary_end_frame(array_simulation_particle_coordinates, dictionar cube_counter = 0 for key, cube in dictionary_cube_data_this_core.items(): # if there were no particles in the cube in the first frame, then set dx,dy,dz each to 0 - if cube['centroid_of_particles_first_frame'] == None: + if cube['centroid_of_particles_first_frame'] is None: cube['dx'] = 0 cube['dy'] = 0 cube['dz'] = 0 From 4ccd37c019e268d4f7c04236736b1faadfea6b27 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 19:16:03 +0000 Subject: [PATCH 14/30] Add changelog entry, make cron-ci cron-only --- .github/workflows/gh-ci-cron.yaml | 6 ------ package/CHANGELOG | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 063885f2b56..f61230abfc2 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -1,11 +1,5 @@ name: GH Actions Cron CI on: - push: - branches: - - develop - pull_request: - branches: - - develop schedule: # 3 am Tuesdays and Fridays - cron: "0 3 * * 2,5" diff --git a/package/CHANGELOG b/package/CHANGELOG index 9cc41c4cdae..94f7f58b8de 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -33,6 +33,9 @@ Deprecations Fixes * np.histogramdd calls in :class:`DensityAnalysis` now pass the `density` argument rather than the NumPy 1.24 removed `normed` (PR #3976) + * visualization.streamlines_3D no longer relies on the scalar return of an + numpy array elementwise comparison which is no longer supported as of + NumPy 1.24 (PR #3977) 12/17/22 IAlibay From 3dc977319d82a4d252f686f6ba24b8f1c3d9e2a1 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 19:17:49 +0000 Subject: [PATCH 15/30] tie off 2.4.2 release --- package/CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 94f7f58b8de..5339ebd9bd4 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -26,7 +26,7 @@ Changes Deprecations -12/21/22 IAlibay +01/03/23 IAlibay * 2.4.2 From 3724efe7dcd1c8b2f2b65985bcdb5e943b057e6a Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 21:15:03 +0000 Subject: [PATCH 16/30] Is actions CI different? --- package/MDAnalysis/visualization/streamlines_3D.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/MDAnalysis/visualization/streamlines_3D.py b/package/MDAnalysis/visualization/streamlines_3D.py index 94a5d2e9b05..d683ab1be99 100644 --- a/package/MDAnalysis/visualization/streamlines_3D.py +++ b/package/MDAnalysis/visualization/streamlines_3D.py @@ -61,7 +61,9 @@ import MDAnalysis -def determine_container_limits(topology_file_path, trajectory_file_path, buffer_value): + +def determine_container_limits(topology_file_path, trajectory_file_path, + buffer_value): """Calculate the extent of the atom coordinates + buffer. A function for the parent process which should take the input trajectory @@ -282,6 +284,7 @@ def update_dictionary_point_in_cube_start_frame(array_simulation_particle_coordi cube['centroid_of_particles_first_frame'] = centroid_particles_in_cube else: # empty cube cube['centroid_of_particles_first_frame'] = None + raise ValueError("I've encountered THE branch") cube_counter += 1 def update_dictionary_end_frame(array_simulation_particle_coordinates, dictionary_cube_data_this_core): From b5b521c6a99038f8641118572f20ae126fbba1eb Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 21:15:34 +0000 Subject: [PATCH 17/30] minor changes to CI yaml file --- .github/workflows/gh-ci-cron.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index f61230abfc2..6ddf31ae2fe 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -32,7 +32,8 @@ jobs: with: os-type: "ubuntu" - - uses: conda-incubator/setup-miniconda@v2 + - name: setup_miniconda + uses: conda-incubator/setup-miniconda@v2 with: python-version: "3.10" miniforge-variant: Mambaforge @@ -54,7 +55,7 @@ jobs: pip install --pre -U -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy numpy h5py matplotlib - - name: check_deps + - name: list_deps run: | mamba list pip list From 3b3e396ff20e1385a4ac617e2ac1e717431a97d5 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 21:39:02 +0000 Subject: [PATCH 18/30] try directly invoking it from the commandline --- .github/workflows/gh-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 64b39152d8c..17a91b7f7ca 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -115,7 +115,7 @@ jobs: run: | PYTEST_FLAGS="--disable-pytest-warnings --durations=50" if [ ${{ matrix.codecov }} = "true" ]; then - PYTEST_FLAGS="${PYTEST_FLAGS} --cov-config=.coveragerc --cov=MDAnalysis --cov-report=xml" + PYTEST_FLAGS="${PYTEST_FLAGS} --cov-config=.coveragerc --concurrency=multiprocessing --cov=MDAnalysis --cov-report=xml" fi echo $PYTEST_FLAGS pytest -n $numprocs testsuite/MDAnalysisTests $PYTEST_FLAGS From 10f9ae1a7f17623259b5d2d9bcb752bdd4bfc048 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 21:45:33 +0000 Subject: [PATCH 19/30] remove intentional ValueError raising --- package/MDAnalysis/visualization/streamlines_3D.py | 1 - 1 file changed, 1 deletion(-) diff --git a/package/MDAnalysis/visualization/streamlines_3D.py b/package/MDAnalysis/visualization/streamlines_3D.py index d683ab1be99..1eb69187466 100644 --- a/package/MDAnalysis/visualization/streamlines_3D.py +++ b/package/MDAnalysis/visualization/streamlines_3D.py @@ -284,7 +284,6 @@ def update_dictionary_point_in_cube_start_frame(array_simulation_particle_coordi cube['centroid_of_particles_first_frame'] = centroid_particles_in_cube else: # empty cube cube['centroid_of_particles_first_frame'] = None - raise ValueError("I've encountered THE branch") cube_counter += 1 def update_dictionary_end_frame(array_simulation_particle_coordinates, dictionary_cube_data_this_core): From ff702687ddf71feee36bc7055a6d250b495e02cd Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 2 Jan 2023 22:11:33 +0000 Subject: [PATCH 20/30] try using the sigterm variable --- .coveragerc | 1 + .github/workflows/gh-ci.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index 850ca2499bf..a93490da9b2 100644 --- a/.coveragerc +++ b/.coveragerc @@ -7,6 +7,7 @@ omit = */legacy/* */due.py concurrency = thread, multiprocessing +sigterm = True parallel = True [report] diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 17a91b7f7ca..64b39152d8c 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -115,7 +115,7 @@ jobs: run: | PYTEST_FLAGS="--disable-pytest-warnings --durations=50" if [ ${{ matrix.codecov }} = "true" ]; then - PYTEST_FLAGS="${PYTEST_FLAGS} --cov-config=.coveragerc --concurrency=multiprocessing --cov=MDAnalysis --cov-report=xml" + PYTEST_FLAGS="${PYTEST_FLAGS} --cov-config=.coveragerc --cov=MDAnalysis --cov-report=xml" fi echo $PYTEST_FLAGS pytest -n $numprocs testsuite/MDAnalysisTests $PYTEST_FLAGS From deb7499840738df4d44a575680810c88dfa57484 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 3 Jan 2023 22:18:43 +0000 Subject: [PATCH 21/30] Maybe the try/finally encapsulation does some magic? --- package/MDAnalysis/visualization/streamlines_3D.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package/MDAnalysis/visualization/streamlines_3D.py b/package/MDAnalysis/visualization/streamlines_3D.py index 1eb69187466..95348087239 100644 --- a/package/MDAnalysis/visualization/streamlines_3D.py +++ b/package/MDAnalysis/visualization/streamlines_3D.py @@ -472,12 +472,14 @@ def log_result_to_parent(process_dict): start_frame, end_frame) #step 4: per process work using the above grid data split pool = multiprocessing.Pool(num_cores) - for sub_dictionary_of_cube_data in list_dictionaries_for_cores: - pool.apply_async(per_core_work, args=( - start_frame_coord_array, end_frame_coord_array, sub_dictionary_of_cube_data, MDA_selection, start_frame, - end_frame), callback=log_result_to_parent) - pool.close() - pool.join() + try: + for sub_dictionary_of_cube_data in list_dictionaries_for_cores: + pool.apply_async(per_core_work, args=( + start_frame_coord_array, end_frame_coord_array, sub_dictionary_of_cube_data, MDA_selection, start_frame, + end_frame), callback=log_result_to_parent) + finally: + pool.close() + pool.join() #so, at this stage the parent process now has a single dictionary with all the cube objects updated from all # available cores #the 3D streamplot (i.e, mayavi flow() function) will require separate 3D np arrays for dx,dy,dz From 301a359685521ad857c01111d323a7d2dd0f5f9e Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 3 Jan 2023 22:42:07 +0000 Subject: [PATCH 22/30] try just one entry in coveragerc --- .coveragerc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.coveragerc b/.coveragerc index a93490da9b2..9f257dbf387 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,9 +6,9 @@ omit = */MDAnalysis/tests/* */legacy/* */due.py -concurrency = thread, multiprocessing -sigterm = True -parallel = True +concurrency = multiprocessing +sigterm = true +parallel = true [report] exclude_lines = From d3c4130a7a1f3c6feb093e5ae437699deada1497 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 4 Jan 2023 00:00:00 +0000 Subject: [PATCH 23/30] add streamlines 2D fix --- .../MDAnalysis/visualization/streamlines.py | 4 ++-- .../visualization/test_streamlines.py | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/package/MDAnalysis/visualization/streamlines.py b/package/MDAnalysis/visualization/streamlines.py index 751dd73eabf..2ac336d8e36 100644 --- a/package/MDAnalysis/visualization/streamlines.py +++ b/package/MDAnalysis/visualization/streamlines.py @@ -176,7 +176,7 @@ def produce_list_centroids_this_frame(list_indices_in_polygon): list_centroids_this_frame = [] for indices in list_indices_in_polygon: if not indices[0].size > 0: # if there are no particles of interest in this particular square - list_centroids_this_frame.append('empty') + list_centroids_this_frame.append(None) else: current_coordinate_array_in_square = relevant_particle_coordinate_array_xy[indices] current_square_indices_centroid = np.average(current_coordinate_array_in_square, axis=0) @@ -201,7 +201,7 @@ def produce_list_centroids_this_frame(list_indices_in_polygon): xy_deltas_to_write = [] for square_1_centroid, square_2_centroid in zip(list_centroids_this_frame_using_indices_from_last_frame, list_previous_frame_centroids): - if square_1_centroid == 'empty' or square_2_centroid == 'empty': + if square_1_centroid is None or square_2_centroid is None: xy_deltas_to_write.append([0, 0]) else: xy_deltas_to_write.append(np.subtract(square_1_centroid, square_2_centroid).tolist()) diff --git a/testsuite/MDAnalysisTests/visualization/test_streamlines.py b/testsuite/MDAnalysisTests/visualization/test_streamlines.py index 8569e1498cb..d9af0ed85ec 100644 --- a/testsuite/MDAnalysisTests/visualization/test_streamlines.py +++ b/testsuite/MDAnalysisTests/visualization/test_streamlines.py @@ -21,6 +21,7 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # import numpy as np +from numpy.testing import assert_allclose import MDAnalysis from MDAnalysis.visualization import (streamlines, streamlines_3D) @@ -83,6 +84,29 @@ def test_streamplot_2D(membrane_xtc, univ, tmpdir): with open(plot_outpath, 'rb'): pass + +def test_streamplot_2D_zero_return(membrane_xtc, univ, tmpdir): + # simple roundtrip test to ensure that + # zeroed arrays are returned by the 2D streamplot + # code when called with an empty selection + u1, v1, avg, std = streamlines.generate_streamlines(topology_file_path=Martini_membrane_gro, + trajectory_file_path=membrane_xtc, + grid_spacing=20, + MDA_selection='name POX', + start_frame=1, + end_frame=2, + xmin=univ.atoms.positions[...,0].min(), + xmax=univ.atoms.positions[...,0].max(), + ymin=univ.atoms.positions[...,1].min(), + ymax=univ.atoms.positions[...,1].max(), + maximum_delta_magnitude=2.0, + num_cores=1) + assert_allclose(u1, np.zeros((5, 5))) + assert_allclose(v1, np.zeros((5, 5))) + assert avg == approx(0.0) + assert std == approx(0.0) + + def test_streamplot_3D(membrane_xtc, univ, tmpdir): # because mayavi is too heavy of a dependency # for a roundtrip plotting test, simply From 2a008a3bd8ce205ec86c25feaa36ba8f6105d900 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 4 Jan 2023 00:01:01 +0000 Subject: [PATCH 24/30] get pytest to fail on FutureWarning for cron CI --- .github/workflows/gh-ci-cron.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 6ddf31ae2fe..2446e162b91 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -70,7 +70,7 @@ jobs: - name: run_tests run: | - pytest -n $numprocs testsuite/MDAnalysisTests --disable-pytest-warnings --durations=50 + pytest -n $numprocs testsuite/MDAnalysisTests --durations=50 -W error::FutureWarning # Issue #3442 From 9d966610c05fb7a262a7997b60001cb52859f459 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 4 Jan 2023 00:24:52 +0000 Subject: [PATCH 25/30] temporarily undo cron only trigger for action --- .github/workflows/gh-ci-cron.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index 2446e162b91..c60d3b3da69 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -1,5 +1,11 @@ name: GH Actions Cron CI on: + push: + branches: + - develop + pull_request: + branches: + - develop schedule: # 3 am Tuesdays and Fridays - cron: "0 3 * * 2,5" From a16d03581cb2a9a55b20b5640b937ca9f00d9523 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 4 Jan 2023 00:55:53 +0000 Subject: [PATCH 26/30] does reverting coveragerc changes affect codecov report? --- .coveragerc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index 9f257dbf387..f87af87aa8f 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,8 +6,7 @@ omit = */MDAnalysis/tests/* */legacy/* */due.py -concurrency = multiprocessing -sigterm = true +concurrency = thread, multiprocessing parallel = true [report] From 2bc1f8851c77b3e19a063f5a0376d83374043333 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 4 Jan 2023 14:01:05 +0000 Subject: [PATCH 27/30] Update changelog, remove try branch in streamlines --- package/CHANGELOG | 6 +++--- package/MDAnalysis/visualization/streamlines_3D.py | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 5339ebd9bd4..3a3f1feb989 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -33,9 +33,9 @@ Deprecations Fixes * np.histogramdd calls in :class:`DensityAnalysis` now pass the `density` argument rather than the NumPy 1.24 removed `normed` (PR #3976) - * visualization.streamlines_3D no longer relies on the scalar return of an - numpy array elementwise comparison which is no longer supported as of - NumPy 1.24 (PR #3977) + * visualization.streamlines_3D and visualization.streamlines no longer + rely on the scalar return of an numpy array elementwise comparison which + is no longer supported as of NumPy 1.24 (PR #3977) 12/17/22 IAlibay diff --git a/package/MDAnalysis/visualization/streamlines_3D.py b/package/MDAnalysis/visualization/streamlines_3D.py index 95348087239..1eb69187466 100644 --- a/package/MDAnalysis/visualization/streamlines_3D.py +++ b/package/MDAnalysis/visualization/streamlines_3D.py @@ -472,14 +472,12 @@ def log_result_to_parent(process_dict): start_frame, end_frame) #step 4: per process work using the above grid data split pool = multiprocessing.Pool(num_cores) - try: - for sub_dictionary_of_cube_data in list_dictionaries_for_cores: - pool.apply_async(per_core_work, args=( - start_frame_coord_array, end_frame_coord_array, sub_dictionary_of_cube_data, MDA_selection, start_frame, - end_frame), callback=log_result_to_parent) - finally: - pool.close() - pool.join() + for sub_dictionary_of_cube_data in list_dictionaries_for_cores: + pool.apply_async(per_core_work, args=( + start_frame_coord_array, end_frame_coord_array, sub_dictionary_of_cube_data, MDA_selection, start_frame, + end_frame), callback=log_result_to_parent) + pool.close() + pool.join() #so, at this stage the parent process now has a single dictionary with all the cube objects updated from all # available cores #the 3D streamplot (i.e, mayavi flow() function) will require separate 3D np arrays for dx,dy,dz From c5dab47de240598f4fd4aafd2e0509d4ae389061 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 4 Jan 2023 14:02:32 +0000 Subject: [PATCH 28/30] update changelog date for 2.4.2 --- package/CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 3a3f1feb989..0407eb68007 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -26,7 +26,7 @@ Changes Deprecations -01/03/23 IAlibay +01/04/23 IAlibay * 2.4.2 From 81e289105dd9ebdb00f846c61a4b177cdb5f60a2 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 4 Jan 2023 14:03:03 +0000 Subject: [PATCH 29/30] set cron job to only work via schedule --- .github/workflows/gh-ci-cron.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/gh-ci-cron.yaml b/.github/workflows/gh-ci-cron.yaml index c60d3b3da69..2446e162b91 100644 --- a/.github/workflows/gh-ci-cron.yaml +++ b/.github/workflows/gh-ci-cron.yaml @@ -1,11 +1,5 @@ name: GH Actions Cron CI on: - push: - branches: - - develop - pull_request: - branches: - - develop schedule: # 3 am Tuesdays and Fridays - cron: "0 3 * * 2,5" From 2f6f57782f321bc03069e0beaa4c9163669d2f34 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Wed, 4 Jan 2023 15:45:44 +0000 Subject: [PATCH 30/30] correct 1.25 not 1.24 --- package/CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 0407eb68007..757e7b23e00 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -35,7 +35,7 @@ Fixes argument rather than the NumPy 1.24 removed `normed` (PR #3976) * visualization.streamlines_3D and visualization.streamlines no longer rely on the scalar return of an numpy array elementwise comparison which - is no longer supported as of NumPy 1.24 (PR #3977) + is no longer supported as of NumPy 1.25 (PR #3977) 12/17/22 IAlibay