From e41a71ce6f2b6432beba8152cadc4165eaef8347 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 20 Nov 2022 19:38:21 -0800 Subject: [PATCH] move to hatch-based build --- opencl_fdfd/LICENSE.md | 1 + opencl_fdfd/README.md | 1 + opencl_fdfd/VERSION.py | 4 ---- opencl_fdfd/__init__.py | 3 +-- opencl_fdfd/main.py | 2 +- opencl_fdfd/py.typed | 0 pyproject.toml | 48 +++++++++++++++++++++++++++++++++++++++++ setup.py | 32 --------------------------- 8 files changed, 52 insertions(+), 39 deletions(-) create mode 120000 opencl_fdfd/LICENSE.md create mode 120000 opencl_fdfd/README.md delete mode 100644 opencl_fdfd/VERSION.py create mode 100644 opencl_fdfd/py.typed create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/opencl_fdfd/LICENSE.md b/opencl_fdfd/LICENSE.md new file mode 120000 index 0000000..7eabdb1 --- /dev/null +++ b/opencl_fdfd/LICENSE.md @@ -0,0 +1 @@ +../LICENSE.md \ No newline at end of file diff --git a/opencl_fdfd/README.md b/opencl_fdfd/README.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/opencl_fdfd/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/opencl_fdfd/VERSION.py b/opencl_fdfd/VERSION.py deleted file mode 100644 index 9fa1853..0000000 --- a/opencl_fdfd/VERSION.py +++ /dev/null @@ -1,4 +0,0 @@ -""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """ -__version__ = ''' -0.3 -'''.strip() diff --git a/opencl_fdfd/__init__.py b/opencl_fdfd/__init__.py index 311bdd0..f5a639b 100644 --- a/opencl_fdfd/__init__.py +++ b/opencl_fdfd/__init__.py @@ -40,6 +40,5 @@ from .main import cg_solver __author__ = 'Jan Petykiewicz' - -from .VERSION import __version__ +__version__ = '0.3' version = __version__ diff --git a/opencl_fdfd/main.py b/opencl_fdfd/main.py index 95cd37a..3de469b 100644 --- a/opencl_fdfd/main.py +++ b/opencl_fdfd/main.py @@ -43,7 +43,7 @@ def cg_solver(omega: complex, OpenCL. All ndarray arguments should be 1D arrays. To linearize a list of 3 3D ndarrays, - either use meanas.vec() or numpy: + either use meanas.fdmath.vec() or numpy: f_1D = numpy.hstack(tuple((fi.flatten(order='F') for fi in [f_x, f_y, f_z]))) :param omega: Complex frequency to solve at. diff --git a/opencl_fdfd/py.typed b/opencl_fdfd/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a9430f5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,48 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opencl_fdfd" +description = "OpenCL FDFD solver" +readme = "README.md" +license = { file = "LICENSE.md" } +authors = [ + { name="Jan Petykiewicz", email="jan@mpxd.net" }, + ] +homepage = "https://mpxd.net/code/jan/opencl_fdfd" +repository = "https://mpxd.net/code/jan/opencl_fdfd" +keywords = [ + "FDFD", + "finite", + "difference", + "frequency", + "domain", + "simulation", + "optics", + "electromagnetic", + "dielectric", + "PML", + "solver", + "FDTD", + ] +classifiers = [ + "Programming Language :: Python :: 3", + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Manufacturing", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU Affero General Public License v3", + "Topic :: Scientific/Engineering", + ] +requires-python = ">=3.8" +dynamic = ["version"] +dependencies = [ + "numpy~=1.21", + "pyopencl", + "jinja2", + "meanas>=0.5", + ] + +[tool.hatch.version] +path = "opencl_fdfd/__init__.py" diff --git a/setup.py b/setup.py deleted file mode 100644 index e758aa2..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 - -from setuptools import setup, find_packages - -with open('README.md', 'r') as f: - long_description = f.read() - -with open('opencl_fdfd/VERSION.py', 'rt') as f: - version = f.readlines()[2].strip() - -setup(name='opencl_fdfd', - version=version, - description='OpenCL FDFD solver', - long_description=long_description, - long_description_content_type='text/markdown', - author='Jan Petykiewicz', - author_email='jan@mpxd.net', - url='https://mpxd.net/code/jan/opencl_fdfd', - packages=find_packages(), - package_data={ - 'opencl_fdfd': ['kernels/*'] - }, - install_requires=[ - 'numpy', - 'pyopencl', - 'jinja2', - 'meanas>=0.5', - ], - extras_require={ - }, - ) -