Skip to content
Open
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
File renamed without changes.
43 changes: 15 additions & 28 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,35 @@
import os
import sys

try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata

# path to autogen'ed modules
sys.path.append(os.path.abspath('..'))

# mock out some extension modules
class Mock:
def __init__(self, *args, **kwargs):
pass

def __call__(self, *args, **kwargs):
return Mock()

@classmethod
def __getattr__(self, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name[0] == name[0].upper():
return type(name, (), {})
else:
return Mock()

for mod_name in [ 'sympy', 'numpy', 'pyweno.codeprinters', 'pyweno.ccoeffs', 'pyweno.cweno' ]:
sys.modules[mod_name] = Mock()
m = metadata.metadata('PyWENO')

# extentions
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.mathjax']
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
]

# general configuration
source_suffix = '.rst'
master_doc = 'index'

# html configuration
pygments_style = 'sphinx'
html_theme = 'default'
html_theme = 'sphinx_rtd_theme'

html_sidebars = {
'**': ['globaltoc.html', 'searchbox.html'],
}

# project information
project = 'PyWENO'
copyright = '2009, 2010, 2011, Matthew Emmett'

with open('../version.py') as f:
exec(f.read()) # this sets 'version'
release = version
project = m['Name']
author = m['Author-email']
copyright = f'2009, 2010, 2011 {author}'
release = m['Version']
19 changes: 14 additions & 5 deletions docs/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,32 @@ have `pip`_ installed, you can install PyWENO by::

$ pip install pyweno


From github
From GitHub
-----------

The latest source distribution is also available in either zip_ or
tar_ format. Finally, you can also obtain the source code on GitHub
through the `PyWENO project page`_.

When using the source code from GitHub, keep in mind that PyWENO uses the
`meson-python <https://meson-python.readthedocs.io>`__ build system and requires
both ``meson`` and ``ninja`` to be available locally to build the project. For
development, an editable build is recommended::

$ pip install --no-build-isolation --editable .

To create wheels or your own source distributions, you can use::

Tracking the development repo
-----------------------------
$ python -m build --wheel
$ python -m build --sdist

Tracking the development repository
-----------------------------------

You can clone the project by running::

$ git clone git://github.com/memmett/PyWENO


.. _zip: http://github.com/memmett/PyWENO/zipball/master
.. _tar: http://github.com/memmett/PyWENO/tarball/master
.. _`PyWENO project page`: http://github.com/memmett/PyWENO
Expand Down
6 changes: 0 additions & 6 deletions docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,3 @@ Non-uniform reconstructions

.. automodule:: pyweno.nonuniform
:members:


Version
-------

.. automodule:: pyweno.version
9 changes: 5 additions & 4 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ The code to generate the above is in
Version information
-------------------

Here we obtain the version of PyWENO::
PyWENO uses standard Python packaging, so its version information can be obtained
through ``importlib``. However, you can also get it from the module itself::

>>> import pyweno.version
>>> pyweno.version.version()
>>> pyweno.version.git_version()
>>> from pyweno import __version__
>>> __version__
'0.11.2'



Expand Down
163 changes: 163 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
project('PyWENO', 'c',
version: '0.11.2',
license: 'BSD-3-Clause',
meson_version: '>=1.1.0',
default_options : ['warning_level=2', 'c_std=c99'],
)

# get dependencies
py_mod = import('python')
py = py_mod.find_installation(pure: false)
py_dep = py.dependency()

# NOTE: meson does not like absolute paths, so we dance around it
incdir_numpy = run_command(py,
[
'-c',
'''import os
import numpy as np
try:
incdir = os.path.relpath(np.get_include())
except Exception:
incdir = np.get_include()
print(incdir)
'''], check: true).stdout().strip()
inc_numpy = include_directories(incdir_numpy)

# create extension modules
py.extension_module(
'ccoeffs', [
'src/ccoeffs.c',
'src/coeffs003.c',
'src/coeffs004.c',
'src/coeffs005.c',
'src/coeffs006.c',
'src/coeffs007.c',
'src/coeffs008.c',
'src/coeffs009.c',
],
include_directories: [inc_numpy],
install: true,
subdir: 'pyweno')

py.extension_module(
'cweno', [
'src/cweno.c',
'src/weno_gauss_legendre003002.c',
'src/weno_gauss_legendre003003.c',
'src/weno_gauss_legendre004002.c',
'src/weno_gauss_legendre004004.c',
'src/weno_gauss_legendre005002.c',
'src/weno_gauss_legendre005003.c',
'src/weno_gauss_legendre005004.c',
'src/weno_gauss_legendre005005.c',
'src/weno_gauss_legendre006002.c',
'src/weno_gauss_legendre006004.c',
'src/weno_gauss_legendre006006.c',
'src/weno_gauss_legendre007002.c',
'src/weno_gauss_legendre007003.c',
'src/weno_gauss_legendre007004.c',
'src/weno_gauss_legendre007005.c',
'src/weno_gauss_legendre007006.c',
'src/weno_gauss_legendre007007.c',
'src/weno_gauss_legendre008002.c',
'src/weno_gauss_legendre008004.c',
'src/weno_gauss_legendre008006.c',
'src/weno_gauss_legendre008008.c',
'src/weno_gauss_lobatto003002.c',
'src/weno_gauss_lobatto003003.c',
'src/weno_gauss_lobatto004002.c',
'src/weno_gauss_lobatto004004.c',
'src/weno_gauss_lobatto005002.c',
'src/weno_gauss_lobatto005003.c',
'src/weno_gauss_lobatto005004.c',
'src/weno_gauss_lobatto005005.c',
'src/weno_gauss_lobatto006002.c',
'src/weno_gauss_lobatto006004.c',
'src/weno_gauss_lobatto006006.c',
'src/weno_gauss_lobatto007002.c',
'src/weno_gauss_lobatto007003.c',
'src/weno_gauss_lobatto007004.c',
'src/weno_gauss_lobatto007005.c',
'src/weno_gauss_lobatto007006.c',
'src/weno_gauss_lobatto007007.c',
'src/weno_gauss_lobatto008002.c',
'src/weno_gauss_lobatto008004.c',
'src/weno_gauss_lobatto008006.c',
'src/weno_gauss_lobatto008008.c',
'src/weno_gauss_radau003002.c',
'src/weno_gauss_radau003003.c',
'src/weno_gauss_radau004002.c',
'src/weno_gauss_radau004003.c',
'src/weno_gauss_radau004004.c',
'src/weno_gauss_radau005002.c',
'src/weno_gauss_radau005003.c',
'src/weno_gauss_radau005004.c',
'src/weno_gauss_radau005005.c',
'src/weno_gauss_radau006002.c',
'src/weno_gauss_radau006003.c',
'src/weno_gauss_radau006004.c',
'src/weno_gauss_radau006005.c',
'src/weno_gauss_radau006006.c',
'src/weno_gauss_radau007002.c',
'src/weno_gauss_radau007003.c',
'src/weno_gauss_radau007004.c',
'src/weno_gauss_radau007005.c',
'src/weno_gauss_radau007006.c',
'src/weno_gauss_radau007007.c',
'src/weno_gauss_radau008002.c',
'src/weno_gauss_radau008003.c',
'src/weno_gauss_radau008004.c',
'src/weno_gauss_radau008005.c',
'src/weno_gauss_radau008006.c',
'src/weno_gauss_radau008007.c',
'src/weno_gauss_radau008008.c',
'src/weno_left003001.c',
'src/weno_left004001.c',
'src/weno_left005001.c',
'src/weno_left006001.c',
'src/weno_left007001.c',
'src/weno_left008001.c',
'src/weno_middle003001.c',
'src/weno_middle005001.c',
'src/weno_middle007001.c',
'src/weno_right003001.c',
'src/weno_right004001.c',
'src/weno_right005001.c',
'src/weno_right006001.c',
'src/weno_right007001.c',
'src/weno_right008001.c',
'src/weno_smoothness003.c',
'src/weno_smoothness004.c',
'src/weno_smoothness005.c',
'src/weno_smoothness006.c',
'src/weno_smoothness007.c',
'src/weno_smoothness008.c',
'src/weno_smoothness009.c',
],
include_directories: [inc_numpy],
install: true,
subdir: 'pyweno')

py.extension_module(
'cnonuniform', [
'src/nfweno.c',
'src/poly.c',
],
include_directories: [inc_numpy],
install: true,
subdir: 'pyweno')

# add sources
py.install_sources([
'pyweno/__init__.py',
'pyweno/codeprinters.py',
'pyweno/kernels.py',
'pyweno/nonuniform.py',
'pyweno/points.py',
'pyweno/reconstruction_coeffs.py',
'pyweno/symbolic.py',
'pyweno/symbols.py',
'pyweno/weno.py',
],
subdir: 'pyweno')
48 changes: 48 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[build-system]
build-backend = "mesonpy"
requires = [
"meson-python>=0.14",
"ninja",
"numpy",
]

[project]
name = "PyWENO"
version = "0.11.2"
description = "Weighted Essentially Non-oscillatory (WENO) reconstructions"
readme = "README.md"
keywords = [
"finite volume",
"interpolation",
"weno",
]
license = { text = "BSD-3-Clause" }
maintainers = [{ name = "Matthew Emmett", email = "matthew@emmett.ca" }]
authors = [{ name = "Matthew Emmett", email = "matthew@emmett.ca" }]
requires-python = ">=3.6"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: C",
"Programming Language :: Fortran",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
]
dependencies = [
'importlib-metadata; python_version < "3.8"',
"numpy",
"sympy",
]
[project.urls]
Documentation = "https://pyweno.readthedocs.io"
Repository = "https://github.com/memmett/PyWENO"
20 changes: 19 additions & 1 deletion pyweno/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
"""The PyWENO module."""

try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata

from . import points
from . import kernels
from . import nonuniform
from . import symbolic
from . import symbols
from . import version
from . import weno
from . import cweno

__version__ = version = metadata.version('PyWENO')

__all__ = (
'points',
'kernels',
'nonuniform',
'symbolic',
'symbols',
'weno',
'cweno',
'version',
'__version__',
)
Loading