diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index a44f260e59a587768f969fb3cce0b14d5af6bad6..0000000000000000000000000000000000000000 --- a/.coveragerc +++ /dev/null @@ -1,17 +0,0 @@ -# {# pkglts, coverage -[html] -title = bvpy's coverage -directory = build/htmlcov - -[run] -source = bvpy - -[report] -show_missing = True -exclude_lines = - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplemented - raise NotImplementedError - __main__ -# #} diff --git a/README.rst b/README.rst index f8a4b83650b2f1a39fa5a3867154d1dac2068e22..40f2f672db46f573a402a41a58688abaf990210c 100644 --- a/README.rst +++ b/README.rst @@ -45,9 +45,9 @@ Some tutorials explaining basic manipulations are gathered `here <https://mosaic Requirements ------------ -* Python 3.7+ -* FEniCS -* GMSH +* Python 3.9 +* FEniCS 2019.1.0 +* GMSH 4.11 Installation @@ -61,19 +61,15 @@ You will need conda in order to install ``bvpy``, you can download it `here <ht git clone https://gitlab.inria.fr/mosaic/bvpy.git cd bvpy - conda env create -f conda/env_OS.yaml -n bvpy-dev + conda create -n bvpy-dev -c conda-forge "python=3.9" "fenics=2019.1.0" conda activate bvpy-dev - python setup.py develop --prefix=$CONDA_PREFIX - -**Note:** depending on your operating system (linux or macOs) you will need to use the dedicated environment file (`env_OS.yaml`) on the third line in the code block above: -* For linux use `env_linux.yaml` -* For macOs use `env_osx.yaml` + python -m pip install -e . - From anaconda: .. code-block:: bash - conda install -c conda-forge bvpy + conda install -c mosaic bvpy **Important Note:** Bvpy is currently running on *FEniCS legacy* and not *FEniCSx*. If you are using an ARM-based computer (mac M1s, M2s), there is currently no ARM-Friendly conda package of *FEniCS legacy*. But you can still run x86-based packages. to do so type the following: @@ -107,17 +103,17 @@ And use the URL on the terminal to open the tutorials. Test ---- -If you install ``bvpy`` from anaconda install ``pytest`` and ``pytest-cov`` inside your environment: +If you install ``bvpy`` from sources install ``pytest`` and ``pytest-cov`` inside your environment: .. code-block:: bash - conda install -c conda-forge pytest pytest-cov + python -m pip install -e ".[test]" And then run at the root of the project: .. code-block:: bash - pytest -v + pytest -v --cov=bvpy test/ Support ------- diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml index 08ce6cfaf133e821f46287ab83844a6d13690711..40d9784da3c647dacace249147fe49c2ea0343ad 100644 --- a/conda/conda_build_config.yaml +++ b/conda/conda_build_config.yaml @@ -1,4 +1,4 @@ python: - - 3.7 + # - 3.7 # - 3.8 - # - 3.9 + - 3.9 diff --git a/conda/meta.yaml b/conda/meta.yaml index 84b636a2fc13bd716cc768a1e9dd0784f1bb382f..2751f62298930337a3716d9a765f06dbd6827ab1 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -17,16 +17,7 @@ requirements: - python {{ python }} run: - python {{ python }} - - ipython - - numpy - - python-gmsh >=4.5.6 - - meshio - - fenics =2019.1.0=py37h89c1867_30 # [linux] - - fenics =2019.1.0=py37hf985489_30 # [osx] - - importlib_metadata - - notebook - - plotly - - ipywidgets + - fenics =2019.1.0 # [linux, osx] # test: # source_files: @@ -40,7 +31,7 @@ requirements: # - coverage report about: - license: Cecill-C + license: LGPL-3.0 license_file: LICENSE summary: Package providing tools to solve BVP (Boundary Value Problem) and IBVP (Initial Boundary Value Problem). dev_url: https://gitlab.inria.fr/mosaic/bvpy diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..5f4093439f58cae87b425e5105d64d9eb60d3283 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,60 @@ +[project] +name = "bvpy" +version = "1.1.0" +description = "A package implementing Boundary Value Problem." +authors = [ + {name="Florian Gacon", email="florian.gacon@inria.fr"}, + {name="Olivier Ali", email="olivier.ali@inria.fr"} +] +maintainers= [ + {name="Manuel Petit", email="manuel.petit@inria.fr"}, +] +readme = "README.rst" +requires-python = ">=3.9, <4" +dependencies = [ + "numpy<2", + "gmsh==4.11", + "meshio", + "fenics==2019.1", + "importlib_metadata", + "plotly", + "pyvista[all]", + "typing_extensions", + "h5py", + "nbformat>=4.2.0", +] +license = {file = "LICENSE"} + +[project.optional-dependencies] +doc = [ + "matplotlib", + "sphinx", + "sphinx_rtd_theme", + "nbsphinx", + "notebook", + "chardet", + "recommonmark", +] +test = [ + "pytest", + "pytest-cov", +] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.coverage.run] +source = ["src"] +omit = ["*__init__.py", "test/*", "version.py"] + +[tool.coverage.report] +omit = ["*__init__.py", "test/*"] +show_missing = true + +[tool.pytest.ini_options] +minversion = "6.0" +addopts = "-v --cov=bvpy" +testpaths = [ + "test", +] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e528e57cc1c3f44143b31054b9f02a16389c99f5..0000000000000000000000000000000000000000 --- a/setup.cfg +++ /dev/null @@ -1,14 +0,0 @@ -[global] -# verbose=0 - -# {# pkglts, wheel -[bdist_wheel] - -# #} -# {# pkglts, sphinx -[build_sphinx] -build-dir=build/sphinx -# #} -# {# pkglts, test.nose - -# #} diff --git a/setup.py b/setup.py deleted file mode 100644 index e7c15882eadea509ead39edb53438e3f8cef1997..0000000000000000000000000000000000000000 --- a/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -# {# pkglts, pysetup.kwds -# format setup arguments - -from setuptools import setup, find_packages - - -short_descr = "A package implementing Boundary Value Problem." -readme = open('README.rst').read() -history = open('HISTORY.rst').read() - -# find packages -pkgs = find_packages('src') - - -setup_kwds = dict( - name='bvpy', - version="1.0.1", - description=short_descr, - long_description=readme + '\n\n' + history, - author="Florian Gacon", - author_email="florian.gacon@inria.fr", - url='', - license='cecill-c', - zip_safe=False, - - packages=pkgs, - - package_dir={'': 'src'}, - setup_requires=[], - install_requires=[ - ], - tests_require=[], - entry_points={}, - keywords='', - ) -# #} -# change setup_kwds below before the next pkglts tag - -# do not change things below -# {# pkglts, pysetup.call -setup(**setup_kwds) -# #} diff --git a/src/bvpy/__init__.py b/src/bvpy/__init__.py index d2bfa5f2cf73c5ef9b9c3c6c75c186ee9a1f84c2..d6d4d31a625bc1d69999d1b512c204045b5f1b30 100644 --- a/src/bvpy/__init__.py +++ b/src/bvpy/__init__.py @@ -1,15 +1,5 @@ -""" -belle petite description -""" -# {# pkglts, src -# FYEO -# #} -# {# pkglts, version, after src -from . import version - -__version__ = version.__version__ -# #} - +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- import logging from fenics import MPI as _MPI diff --git a/src/bvpy/boundary_conditions/boundary.py b/src/bvpy/boundary_conditions/boundary.py index 17666cb4182b3cad5c75483e8fb76ff19dbfbb1f..b35ff5bedadf9f07eb9537ae8b3e898e7ea41755 100644 --- a/src/bvpy/boundary_conditions/boundary.py +++ b/src/bvpy/boundary_conditions/boundary.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.boundary_conditions.boundary diff --git a/src/bvpy/boundary_conditions/dirichlet.py b/src/bvpy/boundary_conditions/dirichlet.py index 7d5d90f4f631d209495a023b0c93c5a14c887516..7255301d6c23f571b5e24183ac6ed39252af2cd7 100644 --- a/src/bvpy/boundary_conditions/dirichlet.py +++ b/src/bvpy/boundary_conditions/dirichlet.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.boundary_conditions.dirichlet diff --git a/src/bvpy/boundary_conditions/neumann.py b/src/bvpy/boundary_conditions/neumann.py index 0d46e5efbc183c31df3b00b231e0e7599f55b8da..a6b4c3c7e9e887e0f05161ee007baeb3addd45a5 100644 --- a/src/bvpy/boundary_conditions/neumann.py +++ b/src/bvpy/boundary_conditions/neumann.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # femtk.boundary_conditions.neumann diff --git a/src/bvpy/boundary_conditions/periodic.py b/src/bvpy/boundary_conditions/periodic.py index 8d59d977be436233b5999ab3946989b634d96bb5..8291265ca9819b4c773065df473ac23357e3b959 100644 --- a/src/bvpy/boundary_conditions/periodic.py +++ b/src/bvpy/boundary_conditions/periodic.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.boundary_conditions.periodic diff --git a/src/bvpy/bvp.py b/src/bvpy/bvp.py index 0a9210e44c8c0d7db921df2a1aaa389ad5c6cc3e..4cc6fcf4e37ee7e2552f9dc607a2a51c8135d953 100644 --- a/src/bvpy/bvp.py +++ b/src/bvpy/bvp.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.bvp diff --git a/src/bvpy/domains/abstract.py b/src/bvpy/domains/abstract.py index 56c1c57d652e966f323331cb207695285c3e0a05..d4d16c994f7d7e3ab7ece16cfa7231705b3a44da 100644 --- a/src/bvpy/domains/abstract.py +++ b/src/bvpy/domains/abstract.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.domains.abstract diff --git a/src/bvpy/domains/custom_domain.py b/src/bvpy/domains/custom_domain.py index 82e2906bb9eb9f859428f594ce2e591d108a401b..d4726f64b7d9e523475b78d156ced987602f34ab 100644 --- a/src/bvpy/domains/custom_domain.py +++ b/src/bvpy/domains/custom_domain.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.templates.custom_polygonal diff --git a/src/bvpy/domains/custom_polygonal.py b/src/bvpy/domains/custom_polygonal.py index e8b18bc2deefa5b0da0a7f1c8f881a4b1c446577..dba0dcecef88a9876c8db94c7bec275c22bbc797 100644 --- a/src/bvpy/domains/custom_polygonal.py +++ b/src/bvpy/domains/custom_polygonal.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.templates.custom_polygonal diff --git a/src/bvpy/domains/geometry.py b/src/bvpy/domains/geometry.py index 98bc8719bfeafd4a14fdd25a57a58adfec9d9d33..2b21b35e3b0b333e9e708546355c0f5fef8462d7 100644 --- a/src/bvpy/domains/geometry.py +++ b/src/bvpy/domains/geometry.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # femtk.utils.geometry diff --git a/src/bvpy/domains/primitives.py b/src/bvpy/domains/primitives.py index 7b8e18d959d19fd976a7a9e26716ac5403731a06..6a9698c151cd37d160ea225977db7ecfe61d223f 100644 --- a/src/bvpy/domains/primitives.py +++ b/src/bvpy/domains/primitives.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.domains.primitives diff --git a/src/bvpy/ibvp.py b/src/bvpy/ibvp.py index bc5d58f584cf99a19700d8b819ffe34c2e0f6fdd..81ef308f88ffebadd62584448192d71079fb02e1 100644 --- a/src/bvpy/ibvp.py +++ b/src/bvpy/ibvp.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.ibvp diff --git a/src/bvpy/solvers/linear.py b/src/bvpy/solvers/linear.py index 7a4b6dee90af601f87df4f1ab4dbf82d029efcc8..e3ac7b0641c95f3351694c682c9c2cd718a68b57 100644 --- a/src/bvpy/solvers/linear.py +++ b/src/bvpy/solvers/linear.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.solvers.linear diff --git a/src/bvpy/solvers/nonlinear.py b/src/bvpy/solvers/nonlinear.py index ed01e3f911b1aba629c90d94bb5ff59a02a6ee6b..b136475409c446211c4080961cb21d9253413389 100644 --- a/src/bvpy/solvers/nonlinear.py +++ b/src/bvpy/solvers/nonlinear.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.solvers.nonlinear diff --git a/src/bvpy/solvers/parameter.py b/src/bvpy/solvers/parameter.py index 8f6af29060131250c615d9ae59236cc64c168609..8607b9b9dfcc50711817eed18ec1550a7517797f 100644 --- a/src/bvpy/solvers/parameter.py +++ b/src/bvpy/solvers/parameter.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.solvers.parameter diff --git a/src/bvpy/solvers/time_integration.py b/src/bvpy/solvers/time_integration.py index 0bbb8aaa7f6a2aa2c456a487933a592bb598b5fa..864aabcaf07e7d847d38c7bc3a61bb47cd0cf5ba 100644 --- a/src/bvpy/solvers/time_integration.py +++ b/src/bvpy/solvers/time_integration.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.solvers.time_integration diff --git a/src/bvpy/utils/io.py b/src/bvpy/utils/io.py index 791b76575f95d4cf2e1b9f318d7619bbff8cbed5..6a30e947cb37c28521c6996f676521387edc3a75 100644 --- a/src/bvpy/utils/io.py +++ b/src/bvpy/utils/io.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.utils.interface diff --git a/src/bvpy/utils/post_processing.py b/src/bvpy/utils/post_processing.py index d8d24ff4e3f2ce91c59d0d0934dad593024f7613..0c041449f86d6d0cb5e1fb85d9283f5a2c39a8dc 100644 --- a/src/bvpy/utils/post_processing.py +++ b/src/bvpy/utils/post_processing.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.utils.interface diff --git a/src/bvpy/utils/pre_processing.py b/src/bvpy/utils/pre_processing.py index fb574bc107f997c4f46cad8b81d31e7da5829db7..0185b9cdf0599dfbd735821d1e52ce8006cbba64 100644 --- a/src/bvpy/utils/pre_processing.py +++ b/src/bvpy/utils/pre_processing.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.utils.interface diff --git a/src/bvpy/utils/progress_bar.py b/src/bvpy/utils/progress_bar.py index e165d35b52c217cbc1bb5b7c682db508d5610efa..fa9cf770c96a3ff71b53d8d4299c89a791a4b207 100644 --- a/src/bvpy/utils/progress_bar.py +++ b/src/bvpy/utils/progress_bar.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.utils.interface diff --git a/src/bvpy/utils/tensor.py b/src/bvpy/utils/tensor.py index 6beb7bd28669d672cd6d5af9b2b712fcc67a2254..9c75581383c00730966cc75686718c059fffc602 100644 --- a/src/bvpy/utils/tensor.py +++ b/src/bvpy/utils/tensor.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.utils.interface diff --git a/src/bvpy/utils/visu.py b/src/bvpy/utils/visu.py index 7fd7c0f796fdc70ae5c9e776c61a99ffa874a465..fed1357b06a14154e5a207929aefef70f4b3a4d1 100644 --- a/src/bvpy/utils/visu.py +++ b/src/bvpy/utils/visu.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.utils.interface diff --git a/src/bvpy/utils/visu_pyvista.py b/src/bvpy/utils/visu_pyvista.py index 3a21cc752e1f7c066d5a72ea266b4763c94dc309..4b76200bee36929d12dd9d3726044ec096318197 100644 --- a/src/bvpy/utils/visu_pyvista.py +++ b/src/bvpy/utils/visu_pyvista.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.utils.interface diff --git a/src/bvpy/version.py b/src/bvpy/version.py deleted file mode 100644 index a4a549a23a2f42613729527d1252f80f455df8d0..0000000000000000000000000000000000000000 --- a/src/bvpy/version.py +++ /dev/null @@ -1,18 +0,0 @@ -""" -Maintain version for this package. -Do not edit this file, use 'version' section of config. -""" -# {# pkglts, version -# -*- coding: utf-8 -*- - -MAJOR = 1 -"""(int) Version major component.""" - -MINOR = 0 -"""(int) Version minor component.""" - -POST = 0 -"""(int) Version post or bugfix component.""" - -__version__ = f"{MAJOR:d}.{MINOR:d}.{POST:d}" -# #} diff --git a/src/bvpy/vforms/abstract.py b/src/bvpy/vforms/abstract.py index d2a07f42f8b901f9c15f31f85447b676be6f758f..47318ae59fdc44d792edce2313f38ce5aa9ee92c 100644 --- a/src/bvpy/vforms/abstract.py +++ b/src/bvpy/vforms/abstract.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.utils.interface diff --git a/src/bvpy/vforms/elasticity.py b/src/bvpy/vforms/elasticity.py index d611b43b5c527bccdaa626346f1e167cc45150c7..c1e95312abece7d36f9e9a9254639944b0d72ee7 100644 --- a/src/bvpy/vforms/elasticity.py +++ b/src/bvpy/vforms/elasticity.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.templates.vforms.linear_elasticity diff --git a/src/bvpy/vforms/helmholtz.py b/src/bvpy/vforms/helmholtz.py index 7a431768b8a0ffa08fe4455788adbb22223bbde9..67f295459e8939eca1af8f80077e08001081057e 100644 --- a/src/bvpy/vforms/helmholtz.py +++ b/src/bvpy/vforms/helmholtz.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.templates.vforms.helmholtz diff --git a/src/bvpy/vforms/plasticity.py b/src/bvpy/vforms/plasticity.py index a2c2ca9e3c049b1c4bac25b621666156bdfbea9a..794bb25ed02b0419395cf3965a4a485b972c1ce3 100644 --- a/src/bvpy/vforms/plasticity.py +++ b/src/bvpy/vforms/plasticity.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.bvp diff --git a/src/bvpy/vforms/poisson.py b/src/bvpy/vforms/poisson.py index e13ff0baa651ae2c7ce878b7c3f9cacbbf3bde42..245faa4f853a41d85ed5a7218e2f0e5ed8662762 100644 --- a/src/bvpy/vforms/poisson.py +++ b/src/bvpy/vforms/poisson.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.templates.vforms.poisson diff --git a/src/bvpy/vforms/transport.py b/src/bvpy/vforms/transport.py index 926099fa0551d8bdecaefdd42fe77681459084e9..7245d20a922071c3c50e050902aed399e71ce383 100644 --- a/src/bvpy/vforms/transport.py +++ b/src/bvpy/vforms/transport.py @@ -1,4 +1,4 @@ -# -*- python -*- +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # bvpy.bvp