Skip to content

Commit

Permalink
Merge pull request #102 from ContactEngineering/24_v0.92.0
Browse files Browse the repository at this point in the history
DOC: Updated ChangeLog.md and Flake8 for upcoming release
  • Loading branch information
pastewka committed Jan 14, 2024
2 parents e1de72c + 7549e71 commit b9bbb0b
Show file tree
Hide file tree
Showing 26 changed files with 282 additions and 372 deletions.
2 changes: 1 addition & 1 deletion .check_mufft_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

if mpi_required:
# Make sure that we have the parallel version running
#assert muFFT.__has_parallel4_support__
# assert muFFT.__has_parallel4_support__
assert muFFT.has_mpi
2 changes: 1 addition & 1 deletion .check_netcdf_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

if mpi_required:
# Make sure that we have the parallel version running
#assert netCDF4.__has_parallel4_support__
# assert netCDF4.__has_parallel4_support__
assert netCDF4.__has_pnetcdf_support__
34 changes: 11 additions & 23 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,17 @@ on:
- '**'

jobs:
tests:
flake8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: Set up python3 ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
sudo apt-get update -qy
sudo apt-get install -y python3-pip
- name: Build extension module
run: |
python3 -m pip install ".[test]"
- name: Flake8 via pytest
run: |
python3 -m pytest --flake8 -m flake8 --verbose --full-trace -s
- name: Check out source repository
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: flake8 Lint
uses: py-actions/flake8@v2
with:
exclude: "docs/examples/*"
134 changes: 51 additions & 83 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,95 +14,63 @@ on:

jobs:
tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 90

strategy:
matrix:
mpi: ['no'] # FIXME!! error when installing netCDF, not finding mpi4py see issue #95
python-version: ['3.8','3.9','3.10','3.11']
mpi4py-version: [3.1.4]
netcdf4-python-version: [1.6.3]
mpi: [ 'yes', 'no' ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
mpi4py-version: [ 3.1.5 ]
netcdf4-python-version: [ 1.6.2 ]
muspectre-version: [ 0.26.4 ]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: Set up python3 ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update -qy
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip pip-tools
if [ "${{ matrix.mpi }}" == "yes" ]; then
sudo apt-get install -y \
openmpi-bin \
libopenmpi-dev \
libfftw3-dev \
libfftw3-mpi-dev \
libhdf5-mpi-dev \
libpnetcdf-dev \
libnetcdf-pnetcdf-dev \
meson \
ninja-build
# Compute mpi4py and muSpectre versions
pip-compile pyproject.toml
NUMPY_VERSION=$(grep 'numpy==' requirements.txt)
MUSPECTRE_VERSION=$(grep 'muspectre==' requirements.txt)
# Install numpy
echo "Installing ${NUMPY_VERSION}"
pip install -v ${NUMPY_VERSION}
# Install mpi4py
echo "Installing mpi4py==${{ matrix.mpi4py-version }}"
CC=mpicc python3 -m pip install -v \
--no-binary mpi4py \
mpi4py==${{ matrix.mpi4py-version }}
# Install netCDF4 with MPI support
echo "Installing netCD4==${{ matrix.netcdf4-python-version }}"
CC=mpicc NETCDF4_DIR=/usr/lib/x86_64-linux-gnu/netcdf/pnetcdf python3 -m pip install -v \
--no-binary mpi4py --no-binary netCDF4 --no-binary muspectre \
${NUMPY_VERSION} \
mpi4py==${{ matrix.mpi4py-version }} \
netCDF4==${{ matrix.netcdf4-python-version }} \
${MUSPECTRE_VERSION}
# Manually install muSpectre with MPI enabled
echo "Installing ${MUSPECTRE_VERSION}"
pip install -v --no-binary muspectre ${MUSPECTRE_VERSION}
else
# Serial installation of muSpectre with FFTW support
sudo apt-get install -y \
libfftw3-dev \
libnetcdf-dev
# Compute muSpectre version
pip-compile pyproject.toml
MUSPECTRE_VERSION=$(grep 'muspectre==' requirements.txt)
# Manually install muSpectre with FFTW support
echo "Installing ${MUSPECTRE_VERSION}"
pip install -v --no-binary muspectre ${MUSPECTRE_VERSION}
fi
python3 -m pip install build
python3 -m pip list
# export LD_LIBRARY_PATH=$PWD/venv/lib/python${{ matrix.python-version }}/site-packages/.muspectre.mesonpy.libs/
- name: Set up python3 ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install extension module
run: |
source venv/bin/activate
python3 -m pip install .[test]
- name: Install dependencies and extension module
run: |
set -x
sudo apt-get update -qy
sudo apt-get install -y python3-dev python3-venv libfftw3-dev libopenblas-dev
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install flit numpy pip-tools setuptools wheel
if [ "${{ matrix.mpi }}" == "yes" ]; then
# We now need to recompile some modules to link with native MPI
sudo apt-get install openmpi-bin libopenmpi-dev libfftw3-mpi-dev libhdf5-mpi-dev libpnetcdf-dev libnetcdf-pnetcdf-dev
# Install mpi4py first (because netCDF4 depends on it)
export NETCDF4_DIR=/usr/lib/x86_64-linux-gnu/netcdf/pnetcdf
export CC=mpicc
python3 -m pip install -v --no-binary mpi4py mpi4py==${{ matrix.mpi4py-version }}
else
sudo apt-get install libhdf5-dev libnetcdf-dev
fi
python3 -m pip install -v cython
python3 -m pip install -v --no-build-isolation --no-binary netCDF4 netCDF4==${{ matrix.netcdf4-python-version }}
# We need to force compilation of muSpectre; otherwise it will download a binary wheel which has no FFTW
# support, but we need this for the half-complex tests
python3 -m pip install -v --no-binary muSpectre muSpectre==${{ matrix.muspectre-version }}
python3 -m pip install -v .[test]
# Check that NetCDF install was not overriden
python3 .check_netcdf_capabilities.py ${{ matrix.mpi }}
python3 .check_mufft_capabilities.py ${{ matrix.mpi }}
- name: Test with pytest
run: |
source venv/bin/activate
python3 .check_netcdf_capabilities.py ${{ matrix.mpi }}
python3 .check_mufft_capabilities.py ${{ matrix.mpi }}
python3 -m pip list
if [ "${{ matrix.mpi }}" == "yes" ]; then python3 run-tests.py --no-build --verbose --full-trace; else python3 -m pytest --verbose --full-trace -s; fi
- name: Test with pytest
run: |
source venv/bin/activate
if [ "${{ matrix.mpi }}" == "yes" ]; then
python3 run-tests.py --no-build --verbose --full-trace
else
python3 -m pytest --verbose --full-trace -s
fi
90 changes: 42 additions & 48 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,62 +14,56 @@ on:

jobs:
tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 40

strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: Set up python3 ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up python3 ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
sudo apt-get update -qy
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip pip-tools
# Serial installation of muSpectre with FFTW support
sudo apt-get install -y \
libfftw3-dev \
libnetcdf-dev
# Compute muSpectre version
pip-compile pyproject.toml
MUSPECTRE_VERSION=$(grep 'muspectre==' requirements.txt)
# Manually install muSpectre with FFTW support
echo "Installing ${MUSPECTRE_VERSION}"
pip install -v --no-binary muspectre ${MUSPECTRE_VERSION}
python3 -m pip install build
python3 -m pip list
- name: Install dependencies and extension module
run: |
set -x
sudo apt-get update -qy
sudo apt-get install -y python3-dev python3-venv libfftw3-dev libopenblas-dev
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install flit numpy pip-tools setuptools wheel
sudo apt-get install libhdf5-dev libnetcdf-dev
python3 -m pip install -v .[test]
# Check that NetCDF install was not overriden
python3 .check_netcdf_capabilities.py no
python3 .check_mufft_capabilities.py no
- name: Install extension module
run: |
source venv/bin/activate
python3 -m pip install .[test]
- name: Install extension module
run: |
source venv/bin/activate
python3 -m pip install .[test]
- name: Test example files
run: |
source venv/bin/activate
python3 -m pip install jupytext
python3 -m pip list
cd docs/examples
for f in *.ipynb
do
jupytext --check pytest --warn-only $f
done
for f in *.py
do
jupytext --check pytest --warn-only $f
done
- name: Test example files
run: |
source venv/bin/activate
python3 -m pip install jupytext
python3 -m pip list
cd docs/examples
for f in *.ipynb
do
jupytext --check pytest --warn-only $f
done
for f in *.py
do
jupytext --check pytest --warn-only $f
done
8 changes: 2 additions & 6 deletions Adhesion/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
Change log for Adhesion
=======================

v0.91.2 (27May23)
v0.92.0 (14Jan24)
-----------------
- ENH: Analytical formulas for JKR contact
- DOC: Examples are now in documentation and stored as plain-text (jupytext) python files

v0.91.1 (01Feb23)
-----------------

- BUG: Fixed discover of version when in a git repository that is not the
source directory of SurfaceTopography
- DOC: Examples are now in documentation and stored as plain-text (jupytext) python files

v0.91.0 (03Jan23)
-----------------
Expand Down
12 changes: 3 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import os
import sys
import Adhesion

sys.path.insert(0, os.path.abspath('../..'))

# -- General configuration ------------------------------------------------
Expand All @@ -39,8 +40,6 @@
"myst_nb"
]



# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -86,7 +85,6 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand All @@ -110,20 +108,19 @@
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
#html_sidebars = {
# html_sidebars = {
# '**': [
# 'relations.html', # needs 'show_related': True theme option to display
# 'searchbox.html',
# ]
#}
# }


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Adhesiondoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
Expand Down Expand Up @@ -152,7 +149,6 @@
'Pastewka', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
Expand All @@ -162,7 +158,6 @@
authors, 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand All @@ -181,5 +176,4 @@
".py": ["jupytext.reads", {"fmt": "py:percent"}],
}


nb_execution_timeout = 240

0 comments on commit b9bbb0b

Please sign in to comment.