diff --git a/.flake8 b/.flake8 index 6998ab8fd6845016bf85a380d1e10f4493d93f61..b63109475dcbf82c5b2b8be1ecfb2ca8e7f85cf2 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] max-line-length=120 -exclude = src/sfg_walberla/_version.py +exclude = src/walberla/codegen/_version.py diff --git a/.gitattributes b/.gitattributes index 745cc9c275f9207dac6f84baf0c6789847116ddc..7897bc3713e5e0ea605a357ee67dd54a56cc5a69 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -src/sfg_walberla/_version.py export-subst +src/walberla/codegen/_version.py export-subst diff --git a/cmake/CodegenConfig.template.py b/cmake/CodegenConfig.template.py index 07f29998fd188b7f4f95a2bd5409cb02f77f6c8d..61533d216b90d574bfd904def544425d8f5d2fa4 100644 --- a/cmake/CodegenConfig.template.py +++ b/cmake/CodegenConfig.template.py @@ -1,5 +1,5 @@ from pystencilssfg import SfgConfig -from sfg_walberla import WalberlaBuildConfig +from walberla.codegen import WalberlaBuildConfig def configure_sfg(cfg: SfgConfig): @@ -8,7 +8,7 @@ def configure_sfg(cfg: SfgConfig): def project_info() -> WalberlaBuildConfig: - from sfg_walberla.build_config import cmake_parse_bool + from walberla.codegen.build_config import cmake_parse_bool return WalberlaBuildConfig( c_compiler_id="${CMAKE_C_COMPILER_ID}", diff --git a/cmake/check_python_env.py b/cmake/check_python_env.py index 7d00009b56992b3b16fb1dc07f2854e30e9d49b3..7901b56db2041cabfd3458857e06f95b3cc4aba3 100644 --- a/cmake/check_python_env.py +++ b/cmake/check_python_env.py @@ -20,9 +20,9 @@ except ImportError: error("pystencils-sfg is not installed in the current Python environment.") try: - import sfg_walberla + import walberla.codegen except ImportError: - error("sfg_walberla is not installed in the current Python environment.") + error("walberla-codegen is not installed in the current Python environment.") print("found required packages pystencils, pystencils-sfg, sfg-walberla", end="") diff --git a/pyproject.toml b/pyproject.toml index 10b9a0f28a9825243990a85f357f480221e846ce..ecf2f4ddf06eedecff97707f13a269bc1096a580 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "sfg_walberla" +name = "walberla-codegen" description = "Code Generation Utilities for walBerla" authors = [ {name = "Frederik Hennig", email = "frederik.hennig@fau.de"}, @@ -20,10 +20,14 @@ requires = [ ] build-backend = "setuptools.build_meta" +[tool.setuptools.packages.find] +where = ["src/"] +include = ["walberla.codegen", "walberla.codegen.*"] + [tool.versioneer] VCS = "git" style = "pep440" -versionfile_source = "src/sfg_walberla/_version.py" -versionfile_build = "sfg_walberla/_version.py" +versionfile_source = "src/walberla/codegen/_version.py" +versionfile_build = "walberla/codegen/_version.py" tag_prefix = "v" -parentdir_prefix = "sfg_walberla-" +parentdir_prefix = "walberla-codegen-" diff --git a/src/sfg_walberla/__init__.py b/src/walberla/codegen/__init__.py similarity index 100% rename from src/sfg_walberla/__init__.py rename to src/walberla/codegen/__init__.py diff --git a/src/sfg_walberla/_version.py b/src/walberla/codegen/_version.py similarity index 99% rename from src/sfg_walberla/_version.py rename to src/walberla/codegen/_version.py index b1d29248b519116f7f6ab4aac65ea978f4d2f874..c6263f517ea306095d7fa3c7975ec53f4a19ec39 100644 --- a/src/sfg_walberla/_version.py +++ b/src/walberla/codegen/_version.py @@ -52,8 +52,8 @@ def get_config() -> VersioneerConfig: cfg.VCS = "git" cfg.style = "pep440" cfg.tag_prefix = "v" - cfg.parentdir_prefix = "sfg_walberla-" - cfg.versionfile_source = "src/sfg_walberla/_version.py" + cfg.parentdir_prefix = "walberla-codegen-" + cfg.versionfile_source = "src/walberla/codegen/_version.py" cfg.verbose = False return cfg diff --git a/src/sfg_walberla/api.py b/src/walberla/codegen/api.py similarity index 100% rename from src/sfg_walberla/api.py rename to src/walberla/codegen/api.py diff --git a/src/sfg_walberla/boundaries/__init__.py b/src/walberla/codegen/boundaries/__init__.py similarity index 100% rename from src/sfg_walberla/boundaries/__init__.py rename to src/walberla/codegen/boundaries/__init__.py diff --git a/src/sfg_walberla/boundaries/boundary_utils.py b/src/walberla/codegen/boundaries/boundary_utils.py similarity index 100% rename from src/sfg_walberla/boundaries/boundary_utils.py rename to src/walberla/codegen/boundaries/boundary_utils.py diff --git a/src/sfg_walberla/boundaries/freeslip.py b/src/walberla/codegen/boundaries/freeslip.py similarity index 100% rename from src/sfg_walberla/boundaries/freeslip.py rename to src/walberla/codegen/boundaries/freeslip.py diff --git a/src/sfg_walberla/boundaries/hbb.py b/src/walberla/codegen/boundaries/hbb.py similarity index 100% rename from src/sfg_walberla/boundaries/hbb.py rename to src/walberla/codegen/boundaries/hbb.py diff --git a/src/sfg_walberla/build_config.py b/src/walberla/codegen/build_config.py similarity index 100% rename from src/sfg_walberla/build_config.py rename to src/walberla/codegen/build_config.py diff --git a/src/sfg_walberla/postprocessing.py b/src/walberla/codegen/postprocessing.py similarity index 100% rename from src/sfg_walberla/postprocessing.py rename to src/walberla/codegen/postprocessing.py diff --git a/src/sfg_walberla/reflection.py b/src/walberla/codegen/reflection.py similarity index 100% rename from src/sfg_walberla/reflection.py rename to src/walberla/codegen/reflection.py diff --git a/src/sfg_walberla/sweep.py b/src/walberla/codegen/sweep.py similarity index 100% rename from src/sfg_walberla/sweep.py rename to src/walberla/codegen/sweep.py diff --git a/src/sfg_walberla/symbolic.py b/src/walberla/codegen/symbolic.py similarity index 100% rename from src/sfg_walberla/symbolic.py rename to src/walberla/codegen/symbolic.py diff --git a/tests/BlockforestGeometry.py b/tests/BlockforestGeometry.py index 09445e9e8be29f59556150ff6f9b0754ff040d21..ad29fc411f7b3276b6639c9eaf3e37fef85476cd 100644 --- a/tests/BlockforestGeometry.py +++ b/tests/BlockforestGeometry.py @@ -1,7 +1,7 @@ from pystencils.session import * from pystencilssfg import SourceFileGenerator, SfgConfiguration -from sfg_walberla import Sweep -from sfg_walberla.symbolic import cell +from walberla.codegen import Sweep +from walberla.codegen.symbolic import cell cfg = SfgConfiguration( output_directory="out" diff --git a/tests/FreeSlip/IrregularFreeSlip.py b/tests/FreeSlip/IrregularFreeSlip.py index 3fa69cf2042e054618db15ec1779945b9198214a..b197a32229659ce9a398851300bcac20fa02efcb 100644 --- a/tests/FreeSlip/IrregularFreeSlip.py +++ b/tests/FreeSlip/IrregularFreeSlip.py @@ -6,8 +6,8 @@ from lbmpy import LBStencil, Stencil, LBMConfig, LBMOptimisation, create_lb_upda from lbmpy.macroscopic_value_kernels import macroscopic_values_setter -from sfg_walberla import Sweep -from sfg_walberla.boundaries import FreeSlip +from walberla.codegen import Sweep +from walberla.codegen.boundaries import FreeSlip with SourceFileGenerator() as sfg: sfg.namespace("TestIrregularFreeSlip::gen") diff --git a/tests/Jacobi.py b/tests/Jacobi.py index 0a07ca80fb133b5b6bd38a6bf4d0486d33f33bce..c7f1fbe569d8c788bc3bb71ccf868082bac78572 100644 --- a/tests/Jacobi.py +++ b/tests/Jacobi.py @@ -3,7 +3,7 @@ import sympy as sp from pystencils import fields, kernel from pystencilssfg import SourceFileGenerator, SfgConfiguration -from sfg_walberla import Sweep +from walberla.codegen import Sweep cfg = SfgConfiguration(output_directory="out") with SourceFileGenerator(cfg) as sfg: diff --git a/user_manual/examples/ForceDrivenChannel/LbmAlgorithms.py b/user_manual/examples/ForceDrivenChannel/LbmAlgorithms.py index c468a8da68a1f2152afb2e5773e881b1d34cbe2c..af4285acf81e2a7104d50813908c2f611223cdf0 100644 --- a/user_manual/examples/ForceDrivenChannel/LbmAlgorithms.py +++ b/user_manual/examples/ForceDrivenChannel/LbmAlgorithms.py @@ -2,8 +2,8 @@ import sympy as sp import pystencils as ps from pystencilssfg import SourceFileGenerator -from sfg_walberla import Sweep -from sfg_walberla.boundaries import SimpleHbbBoundary +from walberla.codegen import Sweep +from walberla.codegen.boundaries import SimpleHbbBoundary from lbmpy import ( LBStencil, diff --git a/user_manual/examples/FreeSlipBubble/LbmAlgorithms.py b/user_manual/examples/FreeSlipBubble/LbmAlgorithms.py index a2975f2617a73d9b129dc7bd55b1a308e9a37b2a..dddace06a9f0e447924b00da023f52958a7a2bfc 100644 --- a/user_manual/examples/FreeSlipBubble/LbmAlgorithms.py +++ b/user_manual/examples/FreeSlipBubble/LbmAlgorithms.py @@ -6,7 +6,7 @@ from lbmpy import LBStencil, Stencil, LBMConfig, LBMOptimisation, create_lb_upda from lbmpy.macroscopic_value_kernels import macroscopic_values_setter -from sfg_walberla import Sweep +from walberla.codegen import Sweep with SourceFileGenerator() as sfg: sfg.namespace("FreeSlipBubble::gen") @@ -46,7 +46,7 @@ with SourceFileGenerator() as sfg: sfg.generate(lb_init_sweep) # begin irregular-freeslip - from sfg_walberla.boundaries import FreeSlip + from walberla.codegen.boundaries import FreeSlip freeslip = FreeSlip( "FreeSlip", diff --git a/user_manual/examples/SparseSpiral/SpiralSweep.py b/user_manual/examples/SparseSpiral/SpiralSweep.py index e573c812b9499d58abdc5a28557bdef0a394c2a1..41747b4207ca98ed59d99bb704e3b55bf2ce5575 100644 --- a/user_manual/examples/SparseSpiral/SpiralSweep.py +++ b/user_manual/examples/SparseSpiral/SpiralSweep.py @@ -1,6 +1,6 @@ from pystencilssfg import SourceFileGenerator -from sfg_walberla import Sweep -from sfg_walberla.symbolic import cell +from walberla.codegen import Sweep +from walberla.codegen.symbolic import cell from pystencils import fields, Assignment with SourceFileGenerator() as sfg: