diff --git a/README.md b/README.md index 912c327..6e79471 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ size.** ![Above shows the mesh in ParaView that results from running the code below.](https://user-images.githubusercontent.com/18619644/103445790-52cd8b00-4c57-11eb-8bd4-4af8f24d4c88.jpg) - + ```python from mpi4py import MPI import zipfile @@ -819,13 +819,16 @@ Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## Unrelease +- None +## [3.6.1]-2021-05-22 ### Added - Smoothed sets (e.g., intersections, differences, and unions) - Conversion of velocity data from feet-second to meters-second - Support for fixed points in iterative Laplacian mesh smoother. ### Improved - Simplified pybind11 build system. +- Now using pytest-codeblocks instead of exdown ## [3.5.0]-2021-03-09 ### Added diff --git a/SeismicMesh/generation/mesh_generator.py b/SeismicMesh/generation/mesh_generator.py index 5c1840b..7db0a6a 100644 --- a/SeismicMesh/generation/mesh_generator.py +++ b/SeismicMesh/generation/mesh_generator.py @@ -899,7 +899,7 @@ def _select_cgal_dim(dim): def _get_topology(dt): - """ Get points and entities from :clas:`CGAL:DelaunayTriangulation2/3` object""" + """Get points and entities from :clas:`CGAL:DelaunayTriangulation2/3` object""" p = dt.get_finite_vertices() t = dt.get_finite_cells() return p, t diff --git a/SeismicMesh/migration/migration.py b/SeismicMesh/migration/migration.py index 8480481..8987a72 100644 --- a/SeismicMesh/migration/migration.py +++ b/SeismicMesh/migration/migration.py @@ -53,7 +53,7 @@ def localize_sizing_function(fh, h0, bbox, dim, axis, comm): def localize_points(blocks, extents, comm, dim): - """ Distribute points to local subdomains """ + """Distribute points to local subdomains""" rank = comm.Get_rank() size = comm.Get_size() for local in range(1, size): diff --git a/SeismicMesh/sizing/mesh_size_function.py b/SeismicMesh/sizing/mesh_size_function.py index 39325f9..91ab096 100644 --- a/SeismicMesh/sizing/mesh_size_function.py +++ b/SeismicMesh/sizing/mesh_size_function.py @@ -435,7 +435,7 @@ def _enforce_courant_sizing(vp, cell_size, cr_max, dt, space_order): def _enforce_gradation_sizing(cell_size, grade, elen): - """Call-back to the cpp gradient limiter code """ + """Call-back to the cpp gradient limiter code""" if grade == 0.0: warnings.warn( "Mesh size gradient is deactiavted. This may compromise mesh quality" diff --git a/setup.cfg b/setup.cfg index 40f1331..d8181b0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = SeismicMesh -version = 3.6.0 +version = 3.6.1 url = https://github.com/krober10nd/SeismicMesh author = Keith Roberts email = keithrbt0@gmail.com @@ -36,6 +36,7 @@ install_requires = mpi4py pybind11 >= 2.6 pyamg == 4.0.0 + pytest_codeblocks python_requires = >=3.0 [options.extras_require] diff --git a/tests/test_README.py b/tests/test_README.py index 7726a5d..fdc567e 100644 --- a/tests/test_README.py +++ b/tests/test_README.py @@ -1,8 +1,8 @@ +import os import gzip import pathlib import shutil -import exdown import pytest import requests @@ -10,13 +10,7 @@ @pytest.mark.serial -@pytest.mark.parametrize( - "string,lineno", - exdown.extract( - this_dir.parent / "README.md", syntax_filter="python", max_num_lines=100000 - ), -) -def test_readme(string, lineno): +def test_readme(): # download url = "http://s3.amazonaws.com/open.source.geoscience/open_data/bpvelanal2004/vel_z6.25m_x12.5m_exact.segy.gz" @@ -31,9 +25,4 @@ def test_readme(string, lineno): ) as f_out: shutil.copyfileobj(f_in, f_out) - try: - # https://stackoverflow.com/a/62851176/353337 - exec(string, {"__MODULE__": "__main__"}) - except Exception: - print(f"README.md (line {lineno}):\n```\n{string}```") - raise + os.system(f"pytest --codeblocks {this_dir.parent}/README.md") diff --git a/tox.ini b/tox.ini index 1cb0ad4..2139ab4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,21 +1,21 @@ -[tox] -envlist = py36, py37, py38, py39 -isolated_build = True - -[mpi] -mpiexec = {env:MPIEXEC:mpiexec} - -[testenv] -setenv = - MPLBACKEND = agg -deps = - exdown - requests - pytest - pytest-cov - mpi4py -whitelist_externals = {[mpi]mpiexec} -commands = - {[mpi]mpiexec} -n 2 -mca btl ^openib pytest --cov {envsitepackagesdir}/SeismicMesh --cov-report xml --cov-report term --ignore=pybind11 -m "parallel2" - {[mpi]mpiexec} -n 2 -mca btl ^openib pytest --cov {envsitepackagesdir}/SeismicMesh --cov-report xml --cov-report term --ignore=pybind11 --cov-append -m "parallel3" - pytest --cov {envsitepackagesdir}/SeismicMesh --cov-report xml --cov-report term --ignore=pybind11 --cov-append -m "serial" +[tox] +envlist = py36, py37, py38, py39 +isolated_build = True + +[mpi] +mpiexec = {env:MPIEXEC:mpiexec} + +[testenv] +setenv = + MPLBACKEND = agg +deps = + pytest-codeblocks + requests + pytest + pytest-cov + mpi4py +whitelist_externals = {[mpi]mpiexec} +commands = + {[mpi]mpiexec} -n 2 -mca btl ^openib pytest --cov {envsitepackagesdir}/SeismicMesh --cov-report xml --cov-report term --ignore=pybind11 -m "parallel2" + {[mpi]mpiexec} -n 2 -mca btl ^openib pytest --cov {envsitepackagesdir}/SeismicMesh --cov-report xml --cov-report term --ignore=pybind11 --cov-append -m "parallel3" + pytest --cov {envsitepackagesdir}/SeismicMesh --cov-report xml --cov-report term --ignore=pybind11 --cov-append -m "serial"