Skip to content

Commit

Permalink
Bump versions (#118)
Browse files Browse the repository at this point in the history
* Bump versions

* Update CI

* Flake8
  • Loading branch information
jorgensd authored Aug 12, 2022
1 parent 83e1200 commit ed71478
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 30 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cpp-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
if: "!(contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]'))"
runs-on: ubuntu-20.04
container: dolfinx/dev-env
container: dolfinx/dev-env:v0.5.0
strategy:
matrix:
petsc_mode: [real, complex]
Expand Down Expand Up @@ -47,22 +47,22 @@ jobs:
with:
path: ./basix
repository: FEniCS/basix
ref: main
ref: v0.5.0

- name: Install FEniCS Python components (dolfinx)
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B build-basix -S ./basix/cpp
cmake --build build-basix
cmake --install build-basix
python3 -m pip install ./basix/python
python3 -m pip install git+https://github.com/FEniCS/ufl.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
python3 -m pip install git+https://github.com/FEniCS/ufl.git@2022.2.0
python3 -m pip install git+https://github.com/FEniCS/ffcx.git@v0.5.0
- name: Install dolfinx
uses: actions/checkout@v2
with:
path: ./dolfinx
repository: FEniCS/dolfinx
ref: main
ref: v0.5.0
- name: Configure and install C++ (dolfinx)
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build-dolfinx -S ./dolfinx/cpp/
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: "!(contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]'))"
runs-on: ubuntu-20.04

container: dolfinx/dev-env
container: dolfinx/dev-env:v0.5.0

strategy:
matrix:
Expand Down Expand Up @@ -53,22 +53,22 @@ jobs:
with:
path: ./basix
repository: FEniCS/basix
ref: main
ref: v0.5.0

- name: Install FEniCS Python components (dolfinx)
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B build-basix -S ./basix/cpp
cmake --build build-basix
cmake --install build-basix
python3 -m pip install ./basix/python
python3 -m pip install git+https://github.com/FEniCS/ufl.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
python3 -m pip install git+https://github.com/FEniCS/ufl.git@2022.2.0
python3 -m pip install git+https://github.com/FEniCS/ffcx.git@v0.5.0
- name: Install dolfinx
uses: actions/checkout@v2
with:
path: ./dolfinx
repository: FEniCS/dolfinx
ref: main
ref: v0.5.0

- name: Configure C++ (dolfinx)
run: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B build-dolfinx -S ./dolfinx/cpp/
Expand All @@ -89,7 +89,10 @@ jobs:
run: BUILD_TYPE=Debug CXXFLAGS=${CXX_FLAGS} python3 -m pip -v install python/

- name: Flake8 code
run: flake8 python/
run: |
cd python
flake8 . --exclude=build
cd ..
- name: Run tests
run: |
Expand Down
8 changes: 4 additions & 4 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.10)

# Set project name and version number
project(DOLFINX_CUAS VERSION 0.4.1)
project(DOLFINX_CUAS VERSION 0.5.0)

#------------------------------------------------------------------------------
# Set CMake options, see `cmake --help-policy CMP00xx`
Expand Down Expand Up @@ -41,8 +41,8 @@ option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "Add paths to linker search and install
add_feature_info(CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_INSTALL_RPATH_USE_LINK_PATH "Add paths to linker search and installed rpath.")

# Find packages
find_package(DOLFINX 0.4.2.0 REQUIRED)
find_package(Basix 0.4.2.0 REQUIRED)
find_package(DOLFINX 0.5.0.0 REQUIRED)
find_package(Basix 0.5.0.0 REQUIRED)
find_package(xtensor REQUIRED)

feature_summary(WHAT ALL)
Expand All @@ -64,7 +64,7 @@ ${CMAKE_BINARY_DIR}/dolfinx_cuas/DOLFINX_CUASConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dolfinx_cuas)

write_basic_package_version_file(${CMAKE_BINARY_DIR}/dolfinx_cuas/DOLFINX_CUASConfigVersion.cmake
VERSION 0.4.1.0 COMPATIBILITY SameMajorVersion)
VERSION 0.5.0.0 COMPATIBILITY SameMajorVersion)

# Install CMake helper files
install(
Expand Down
2 changes: 1 addition & 1 deletion python/demos/stiffness_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@
Aref_sp = scipy.sparse.csr_matrix((av, aj, ai))
matrix_error = scipy.sparse.linalg.norm(Aref_sp - A)
print(f"Norm of matrix error {matrix_error}")
assert(matrix_error < 1e-10)
assert matrix_error < 1e-10
2 changes: 1 addition & 1 deletion python/demos/surface_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@
ai, aj, av = Aref.getValuesCSR()
Aref_sp = scipy.sparse.csr_matrix((av, aj, ai))
matrix_error = scipy.sparse.linalg.norm(Aref_sp - A)
assert(matrix_error < 1e-10)
assert matrix_error < 1e-10
print(f"Norm of matrix error {matrix_error}")
6 changes: 3 additions & 3 deletions python/dolfinx_cuas/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def mass_kernel(data: np.ndarray, ct: str, num_cells: int, is_affine: bool, bloc
elif ct == "hexahedron":
apply_dof_trans = apply_dof_transformation_hexahedron
else:
assert(False)
assert False
J_q = np.zeros((num_q_points, gdim, tdim), dtype=np.float64)
detJ_q = np.zeros((num_q_points, 1), dtype=np.float64)
dphi_c = c_tab[1:gdim + 1, 0, :, 0].copy()
Expand Down Expand Up @@ -190,7 +190,7 @@ def stiffness_kernel(data: np.ndarray, ct: str, num_cells: int, is_affine: bool,
elif ct == "hexahedron":
apply_dof_trans = apply_dof_transformation_hexahedron
else:
assert(False)
assert False

J_q = np.zeros((q_w.size, gdim, tdim), dtype=np.float64)
invJ = np.zeros((tdim, gdim), dtype=np.float64)
Expand Down Expand Up @@ -321,7 +321,7 @@ def surface_kernel(data: np.array, ct: str, is_affine: bool, block_size: int, nu
elif ct == "hexahedron":
apply_dof_trans = apply_dof_transformation_hexahedron
else:
assert(False)
assert False
J_q = np.zeros((num_q_points, gdim, tdim - 1), dtype=np.float64)
detJ_q = np.zeros((num_q_points, 1), dtype=np.float64)
dphi_c = np.zeros(c_tab[1:gdim + 1, 0, :, 0].shape, dtype=np.float64)
Expand Down
12 changes: 6 additions & 6 deletions python/dolfinx_cuas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def pack_facet_info(mesh: _mesh.Mesh, mt: _mesh.MeshTagsMetaClass, index: int):
c_to_f = mesh.topology.connectivity(tdim, fdim)
f_to_c = mesh.topology.connectivity(fdim, tdim)

assert(mt.dim == fdim)
assert mt.dim == fdim
active_facets = mt.indices[mt.values == index]
facet_info = pack_facet_info_numba(active_facets,
(c_to_f.array, c_to_f.offsets),
Expand All @@ -71,7 +71,7 @@ def pack_facet_info_numba(active_facets, c_to_f, f_to_c):

for j, facet in enumerate(active_facets):
cells = f_to_c_pos[f_to_c_offs[facet]:f_to_c_offs[facet + 1]]
assert(len(cells) == 1)
assert len(cells) == 1
local_facets = c_to_f_pos[c_to_f_offs[cells[0]]: c_to_f_offs[cells[0] + 1]]
# Should be wrapped in convenience numba function
local_index = np.flatnonzero(facet == local_facets)[0]
Expand Down Expand Up @@ -118,7 +118,7 @@ def compute_determinant(A: np.ndarray, detJ: np.ndarray):
- A[2, 1] * A[1, 2] * A[0, 0] - A[2, 2] * A[1, 0] * A[0, 1]
else:
# print(f"Matrix has invalid size {num_rows}x{num_cols}")
assert(False)
assert False
else:
# det(A^T A) = det(A) det(A)
ATA = A.T @ A
Expand All @@ -134,7 +134,7 @@ def compute_determinant(A: np.ndarray, detJ: np.ndarray):
- ATA[2, 1] * ATA[1, 2] * ATA[0, 0] - ATA[2, 2] * ATA[1, 0] * ATA[0, 1]
else:
# print(f"Matrix has invalid size {num_rows}x{num_cols}")
assert(False)
assert False
detJ[0] = np.sqrt(detJ[0])


Expand Down Expand Up @@ -170,10 +170,10 @@ def square_inv(A: np.ndarray, Ainv: np.ndarray, detJ: np.ndarray):
Ainv[2, 2] = (A[0, 0] * A[1, 1] - A[0, 1] * A[1, 0]) / detJ[0]
else:
# print(f"Matrix has invalid size {num_rows}x{num_cols}")
assert(False)
assert False
else:
# print(f"Matrix has invalid size {num_rows}x{num_cols}")
assert(False)
assert False


@numba.njit(cache=True)
Expand Down
4 changes: 2 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from setuptools.command.build_ext import build_ext


VERSION = "0.4.1"
VERSION = "0.5.0"

REQUIREMENTS = []

Expand Down Expand Up @@ -72,7 +72,7 @@ def build_extension(self, ext):
author='Jørgen S. Dokken',

author_email='dokken92@gmail.com',
python_requires='>3.6.0',
python_requires='>3.7.0',
packages=['dolfinx_cuas'],
ext_modules=[CMakeExtension('dolfinx_cuas.cpp')],
cmdclass=dict(build_ext=CMakeBuild),
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_coeffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ def test_entity_packing(integral_type):
entities = np.flatnonzero(facets == 0)
new_entities = dolfinx_cuas.compute_active_entities(mesh, np.asarray(entities, dtype=np.int32),
integral_type)
assert(np.allclose(active_entities, new_entities))
assert np.allclose(active_entities, new_entities)
2 changes: 1 addition & 1 deletion python/tests/test_numba_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ def test_cell_kernels(element, ct, degree, integral_type):
Aref_sp = scipy.sparse.csr_matrix((av, aj, ai))
matrix_error = scipy.sparse.linalg.norm(Aref_sp - A)
print(f"Matrix error {matrix_error}")
assert(matrix_error < 1e-13)
assert matrix_error < 1e-13

0 comments on commit ed71478

Please sign in to comment.