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
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ From Source Code

Currently supports Python 3.10 under Ubuntu 20.04 (see Github Actions).

IMPORTANT: For support in other Python versions and/or OS, users are invited to work on the case and submmit a PR. Help making the project more generic!
IMPORTANT: For support in other Python versions and/or OS, users are invited to work on the case and submit a PR. Help making the project more generic!

.. code-block:: bash

$ git clone https://github.com/rilma/pyHWM14.git
$ cd pyHWM14
$ make install
$ pip install .

---------
From PyPi
Expand Down
44 changes: 44 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
project('pyhwm14', 'c',
version : '0.1',
license: 'BSD-3',
meson_version: '>=0.64.0',
default_options : ['warning_level=2'],
)

add_languages('fortran')

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

incdir_numpy = run_command(py,
['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'],
check : true
).stdout().strip()

incdir_f2py = run_command(py,
['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'],
check : true
).stdout().strip()

inc_np = include_directories(incdir_numpy, incdir_f2py)

source_dir = 'source/'

hwm14_source = custom_target('hwm14module.c',
input : [source_dir / 'hwm14.f90'],
output : ['hwm14module.c', 'hwm14-f2pywrappers.f', 'hwm14-f2pywrappers2.f90'], # mind the .f90 wrapper!
command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'hwm14']
)

py.extension_module('hwm14',
[source_dir / 'hwm14.f90', hwm14_source],
incdir_f2py / 'fortranobject.c',
include_directories: inc_np,
dependencies : py_dep,
install : true
)

py_dir = 'pyhwm2014'

subdir(py_dir)
2 changes: 1 addition & 1 deletion pyhwm2014/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
except (ImportError,AttributeError): # Python < 3.5
from pathlib2 import Path
#
from . import hwm14
import hwm14
import logging
from numpy import append, arange, ceil, floor, meshgrid, ones,reshape
try:
Expand Down
23 changes: 23 additions & 0 deletions pyhwm2014/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Install python sources

python_sources = ['__init__.py']

py.install_sources(
python_sources,
subdir: 'pyhwm2014'
)

# Install additional data sources

data_dir = 'data/'
install_dir = py.get_install_dir() / 'pyhwm2014'

data_sources = files(
data_dir / 'dwm07b104i.dat',
data_dir / 'gd2qd.dat',
data_dir / 'hwm123114.bin')

install_data(
data_sources,
install_dir: install_dir / 'data'
)
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build-system]
requires = ["meson", "meson-python", "numpy"]
build-backend = "mesonpy"

[project]
name = "pyhwm2014"
version = "0.1.0"
description = "Python wrapper for HWM14."
readme = "README.rst"
requires-python = ">=3.12"
dependencies = ["numpy", "seaborn"]
46 changes: 0 additions & 46 deletions setup.py

This file was deleted.

Loading