Skip to content
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
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "lib/pybind11"]
path = lib/pybind11
url = https://github.com/pybind/pybind11
35 changes: 16 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files
- id: debug-statements
- repo: https://github.com/psf/black
rev: 22.6.0
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
exclude: "^(versioneer.py|src/pymor_dealii/version.py)"
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v14.0.6'
hooks:
- id: clang-format
exclude: "^lib/pybind11"
- id: ruff
args:
- --fix
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v14.0.6'
hooks:
- id: clang-format
exclude: "^lib/pybind11"
20 changes: 5 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.15)
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)

# this should only be necessary while the deal setup macro is copied
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")

project(pymor_dealii)
set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 CONFIG REQUIRED)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/lib)

FIND_PACKAGE(deal.II 9.2
FIND_PACKAGE(deal.II
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)
IF(NOT ${deal.II_FOUND})
Expand All @@ -18,13 +16,5 @@ IF(NOT ${deal.II_FOUND})
)
ENDIF()

# Set a default build configuration if none is specified. 'MinSizeRel' produces the smallest binaries
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
endif()
# Add a CMake parameter for choosing a desired Python version
set(PYBIND11_PYTHON_VERSION "3" CACHE STRING "Python version to use for compiling the example library")

add_subdirectory(lib)
add_subdirectory(src)
4 changes: 1 addition & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright (c) 2013, 2014, 2015, Rene Milk, Stephan Rave, Felix Schindler
All rights reserved.
Copyright pyMOR developers and contributors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
Expand All @@ -16,4 +15,3 @@ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PRO
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

3 changes: 2 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
add_subdirectory(pybind11)

INCLUDE(dealii_macro)
DEAL_II_INITIALIZE_CACHED_VARIABLES()
Expand All @@ -10,11 +9,13 @@ pybind11_add_module(pymor_dealii_bindings bindings.cc)
# set_target_properties(pymor_dealii_bindings PROPERTIES PREFIX "")

PYMOR_DEAL_II_SETUP_TARGET(pymor_dealii_bindings)
install(TARGETS pymor_dealii_bindings LIBRARY DESTINATION .)

# Create the example library
pybind11_add_module(dealii_elasticity py_elasticity.cc elasticity.cc)
# set_target_properties(dealii_elasticity PROPERTIES PREFIX "")
PYMOR_DEAL_II_SETUP_TARGET(dealii_elasticity)
install(TARGETS dealii_elasticity LIBRARY DESTINATION .)

add_executable(eoc eoc.cc elasticity.cc)
target_compile_options(eoc PUBLIC ${PYBIND11_CPP_STANDARD})
Expand Down
1 change: 0 additions & 1 deletion lib/pybind11
Submodule pybind11 deleted from a2e59f
148 changes: 145 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,146 @@
# This file is autogenerated. Edit dependencies.py instead
[project]
name = "pymor_dealii"
dynamic = ["version"]
description = "pyMOR bindings for deal.II"
readme = "README.md"
authors = [
{name = "pyMOR developers", email = "main.developers@pymor.org"}
]
maintainers = [
{name = "Stephan Rave", email = "stephan.rave@uni-muenster.de"},
]
requires-python = ">=3.9"
dependencies = [
"pymor==2024.2.*"
]

[project.urls]
homepage = "https://pymor.org"
source = "https://github.com/pymor/pymor-deal.II"
tracker = "https://github.com/pymor/pymor-deal.II/issues"

[project.optional-dependencies]
test = [
"pytest",
"pytest-regressions"
]

[build-system]
requires = ['setuptools>=49.1', 'wheel', 'packaging']
build-backend = "setuptools.build_meta"
requires = ["scikit-build-core>=0.10", "pybind11"]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
minimum-version = "build-system.requires"
build-dir = "build/{wheel_tag}"

[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "src/pymor_dealii/__init__.py"

[tool.coverage.run]
source = [
"src/pymor_dealii",
"src/test"
]
omit = [
"src/pymor_dealii/version.py"
]
relative_files = true

[tool.pytest.ini_options]
testpaths = "test"
# python_files = "src/test/*.py"
junit_family = "xunit2"
python_classes = "Test"

[tool.ruff]
src = ["src"] # this makes isort behave nicely
line-length = 120

[tool.ruff.lint]
select = [
"F", # Pyflakes
"W", # pycodestyle warning
"E", # pycodestyle error
"I", # isort
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"YTT", # flake8-2020
"ASYNC", # flake8-async
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"EXE", # flake8-executable
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"SIM", # flake8-simplify
"TD", # flake8-todos
"PGH", # pygrep-hooks
"RUF", # Ruff-specific rules
"NPY", # NumPy-specific rules
]
ignore = [
"B006", # do not use mutable data structures for argument defaults
"B007", # loop control variable not used within loop body
"B008", # do not perform function call in argument defaults
"B011", # do not `assert False`
"B017", # pytest.raises(Exception) should be considered evil
"B028", # no explicit `stacklevel` keyword argument found
"C408", # unnecessary collection (dict, list, tuple) call
"D100", # missing docstring in public module
"D101", # missing docstring in public class
"D102", # missing docstring in public method
"D103", # missing docstring in public function
"D104", # missing docstring in public package
"D105", # missing docstring in magic method
"D106", # missing docstring in public nested class
"D203", # 1 blank line required before class docstring
"D212", # multi-line docstring summary should start at the first line
"D401", # first line of docstring should be in imperative mood
"D404", # first word of the docstring should not be "This"
"D405", # the linter thinks the argument name 'parameters' is a docstring section
"D407", # same as above
"D410", # same as above
"D411", # same as above
"D414", # same as above
"E402", # module level import not at top of file (due to config.require("PKG") syntax)
"E731", # do not assign a lambda expression, use a def
"E741", # do not use variables named 'l', 'O', or 'I'
"N802", # function name should be lowercase
"N803", # argument name should be lowercase (we use single capital letters everywhere for vectorarrays)
"N806", # same for variables in function
"PT011", # pytest.raises(Exception) is too broad
"PT012", # pytest.raises() block should contain a single simple statement
"PT015", # assertion always fails, replace with `pytest.fail()`
"RUF005", # consider unpacking instead of concatenation
"RUF021", # parenthesize a and b expressions when chaining and and or together, to make the precedence clear
"RUF023", # __slots__ is not sorted
"SIM102", # use a single if statement instead of nested if statements
"SIM103", # return the condition directly
"SIM105", # use contextlib.suppress instead of try-except-pass
"SIM108", # use ternary operator instead of if-else-block
"SIM114", # combine if branches using logical or operator
"SIM116", # use a dictionary instead of consecutive `if` statements
"SIM300", # Yoda conditions
"TD002", # missing author in TODO
"TD003", # missing issue link on the line following this TODO
]

[tool.ruff.lint.flake8-import-conventions]
banned-from = ["numpy.linalg"] # avoids importing similar routines from numpy.linalg and scipy.linalg

[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"scipy.linalg" = "spla"

[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"

[tool.ruff.lint.pycodestyle]
max-doc-length = 100

[tool.ruff.lint.pydocstyle]
convention = "numpy"
72 changes: 0 additions & 72 deletions setup.cfg

This file was deleted.

Loading
Loading