Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python maintenance #4489

Merged
merged 10 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/push_pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.8'
- name: Check without sanitizer
uses: ./.github/actions/build_and_check
with:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.8'
- name: Check with sanitizer
uses: ./.github/actions/build_and_check
with:
Expand Down
72 changes: 48 additions & 24 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ stages:
timeout: 40m
interruptible: false
tags:
- linux
- docker
- espresso
- no-cuda

variables:
GIT_SUBMODULE_STRATEGY: recursive
Expand All @@ -44,7 +46,8 @@ style:
- sh maintainer/CI/fix_style.sh
tags:
- docker
- linux
- espresso
- no-cuda
variables:
GIT_SUBMODULE_STRATEGY: none
artifacts:
Expand All @@ -65,7 +68,8 @@ style_doxygen:
- sh ../maintainer/CI/dox_warnings.sh
tags:
- docker
- linux
- espresso
- no-cuda

### Builds without CUDA

Expand All @@ -85,7 +89,8 @@ default:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- no-cuda

maxset:
<<: *global_job_definition
Expand All @@ -105,7 +110,9 @@ maxset:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- no-cuda
- numa

no_rotation:
<<: *global_job_definition
Expand All @@ -122,7 +129,9 @@ no_rotation:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- no-cuda
- numa

ubuntu:wo-dependencies:
<<: *global_job_definition
Expand All @@ -138,7 +147,8 @@ ubuntu:wo-dependencies:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- no-cuda

### Builds with different distributions

Expand All @@ -155,7 +165,8 @@ debian:10:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- no-cuda

fedora:34:
<<: *global_job_definition
Expand All @@ -170,7 +181,8 @@ fedora:34:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- no-cuda

### Builds with CUDA

Expand All @@ -195,8 +207,9 @@ clang-sanitizer:
timeout: 2h
tags:
- docker
- linux
- espresso
- cuda
- numa

fast_math:
<<: *global_job_definition
Expand All @@ -215,7 +228,7 @@ fast_math:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- cuda
when: manual

Expand All @@ -238,8 +251,9 @@ cuda11-maxset:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- cuda
- numa

cuda10-maxset:
<<: *global_job_definition
Expand All @@ -263,8 +277,9 @@ cuda10-maxset:
expire_in: 1 week
tags:
- docker
- linux
- espresso
- cuda
- numa

tutorials-samples-maxset:
<<: *global_job_definition
Expand All @@ -287,7 +302,7 @@ tutorials-samples-maxset:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- cuda

tutorials-samples-default:
Expand All @@ -310,7 +325,7 @@ tutorials-samples-default:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- cuda
only:
- schedules
Expand All @@ -336,7 +351,7 @@ tutorials-samples-empty:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- cuda
only:
- schedules
Expand All @@ -362,7 +377,8 @@ tutorials-samples-no-gpu:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- no-cuda
only:
- schedules

Expand Down Expand Up @@ -397,7 +413,7 @@ installation:
- make -j2 check_tutorials
tags:
- docker
- linux
- espresso
- cuda
when: manual

Expand All @@ -417,8 +433,9 @@ empty:
- bash maintainer/CI/build_cmake.sh
tags:
- docker
- linux
- espresso
- cuda
- numa

check_sphinx:
<<: *global_job_definition
Expand All @@ -440,8 +457,9 @@ check_sphinx:
expire_in: 1 week
tags:
- docker
- linux
- espresso
- cuda
- numa

run_tutorials:
<<: *global_job_definition
Expand All @@ -464,8 +482,9 @@ run_tutorials:
expire_in: 1 week
tags:
- docker
- linux
- espresso
- cuda
- numa
only:
- schedules

Expand All @@ -486,7 +505,9 @@ run_doxygen:
expire_in: 1 week
tags:
- docker
- linux
- espresso
- no-cuda
- numa

maxset_no_gpu:
<<: *global_job_definition
Expand All @@ -500,7 +521,9 @@ maxset_no_gpu:
- make -t && make check
tags:
- docker
- linux
- espresso
- no-cuda
- numa

maxset_3_cores:
<<: *global_job_definition
Expand All @@ -514,8 +537,9 @@ maxset_3_cores:
- make -t && make check_unit_tests && make check_python_parallel_odd
tags:
- docker
- linux
- espresso
- cuda
- numa

status_success:
<<: *notification_job_definition
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ if(WITH_CUDA)
endif()
endif(WITH_CUDA)

find_package(PythonInterp 3.7 REQUIRED)
find_package(PythonInterp 3.8 REQUIRED)

if(WITH_PYTHON)
find_package(Cython 0.29.14 REQUIRED)
Expand Down
5 changes: 5 additions & 0 deletions doc/sphinx/inter_bonded.rst
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ angle between the planes defined by the particle triples :math:`p_1`,
Together with appropriate Lennard-Jones interactions, this potential can
mimic a large number of atomic torsion potentials.

Note that there is a singularity in the forces, but not in the energy, when
:math:`\phi = 0` and :math:`\phi = \pi`.


Tabulated dihedral potential
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -414,6 +417,8 @@ A tabulated dihedral interaction can be instantiated via
The energy and force tables must be sampled from :math:`0` to :math:`2\pi`.
For details of the interpolation, see :ref:`Tabulated interaction`.

Note that there is a singularity in the forces, but not in the energy, when
:math:`\phi = 0` and :math:`\phi = \pi`.

.. _Immersed Boundary Method interactions:

Expand Down
6 changes: 3 additions & 3 deletions doc/sphinx/system_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Lees--Edwards boundary conditions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lees--Edwards boundary conditions (LEbc) are special periodic boundary
conditions to simulation systems under shear stress :cite:`lees72a`.
conditions to simulate systems under shear stress :cite:`lees72a`.
Periodic images of particles across the shear boundary appear with a
time-dependent position offset. When a particle crosses the shear boundary,
it appears to the opposite side of the simulation box with a position offset
Expand Down Expand Up @@ -227,13 +227,13 @@ The properties of the cell system can be accessed by

* :py:attr:`~espressomd.cellsystem.CellSystem.node_grid`

(int[3]) 3D node grid for real space domain decomposition (optional, if
3D node grid for real space domain decomposition (optional, if
unset an optimal set is chosen automatically). The domain decomposition
can be visualized with :file:`samples/visualization_cellsystem.py`.

* :py:attr:`~espressomd.cellsystem.CellSystem.skin`

(float) Skin for the Verlet list. This value has to be set, otherwise the simulation will not start.
Skin for the Verlet list. This value has to be set, otherwise the simulation will not start.

Details about the cell system can be obtained by :meth:`espressomd.system.System.cell_system.get_state() <espressomd.cellsystem.CellSystem.get_state>`:

Expand Down
8 changes: 7 additions & 1 deletion maintainer/CI/build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ set_default_value() {
fi
}

# the number of available processors depends on the CI runner
if grep -q "i7-3820" /proc/cpuinfo; then
ci_procs=2
else
ci_procs=4
fi

# handle environment variables
set_default_value srcdir "$(pwd)"
Expand All @@ -82,7 +88,7 @@ set_default_value with_ubsan false
set_default_value with_asan false
set_default_value with_static_analysis false
set_default_value myconfig "default"
set_default_value build_procs 2
set_default_value build_procs ${ci_procs}
set_default_value check_procs ${build_procs}
set_default_value check_odd_only false
set_default_value check_gpu_only false
Expand Down
12 changes: 5 additions & 7 deletions maintainer/CI/deploy_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,18 @@

"""List all tutorial files to deploy (PDF, HTML and figures)"""

import os
import glob
import pathlib
import lxml.html

deploy_list = glob.glob('*/*.pdf')
for filepath in glob.glob('*/*.html'):
deploy_list = list(pathlib.Path().glob('*/*.pdf'))
for filepath in pathlib.Path().glob('*/*.html'):
deploy_list.append(filepath)
# extract all figures
dirname = os.path.dirname(filepath)
with open(filepath, encoding='utf-8') as f:
html = lxml.html.parse(f)
figures = filter(lambda src: not src.startswith('data:image'),
html.xpath('//img/@src'))
deploy_list += list(map(lambda src: os.path.join(dirname, src), figures))
deploy_list += list(map(lambda src: filepath.parent / src, figures))

with open('deploy_list.txt', 'w') as f:
f.write('\n'.join(deploy_list))
f.write('\n'.join(map(str, deploy_list)))
4 changes: 2 additions & 2 deletions maintainer/CI/dox_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import re
import os
import pathlib

# collect list of Doxygen warnings
with open('doc/doxygen/warnings.log') as f:
Expand All @@ -38,7 +38,7 @@
for line in content.strip().split('\n'):
m = re.search(r'^(.+):(\d+):[\s\*]*([@\\]t?param).*\s(\S+)\s*$', line)
filepath, lineno, paramtype, varname = m.groups()
ext = os.path.splitext(filepath)[1]
ext = pathlib.Path(filepath).suffix
if ext.lower() not in source_code_ext:
continue
warning = (f'argument \'{varname}\' of {paramtype} has no description,'
Expand Down
Loading