From a7b270c6ddf3659c3d1253d2ff67ee9dd149961a Mon Sep 17 00:00:00 2001 From: Pascal Audet Date: Tue, 6 May 2025 17:20:54 +1200 Subject: [PATCH 1/5] initializing v020 --- rfpy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfpy/__init__.py b/rfpy/__init__.py index ccb57c1..93019d7 100644 --- a/rfpy/__init__.py +++ b/rfpy/__init__.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -__version__ = '0.1.4' +__version__ = '0.2.0' __author__ = 'Pascal Audet' From 1e0ae4b8e05a2512f90139a6ee63c1c2f5c36a57 Mon Sep 17 00:00:00 2001 From: Pascal Audet Date: Tue, 6 May 2025 17:37:41 +1200 Subject: [PATCH 2/5] toward meson build --- meson.build | 23 +++++++++++++++++++++++ pyproject.toml | 31 +++++++++++++++++++++++++++++++ setup.py | 45 --------------------------------------------- 3 files changed, 54 insertions(+), 45 deletions(-) create mode 100644 meson.build create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..cab3689 --- /dev/null +++ b/meson.build @@ -0,0 +1,23 @@ +project('rfpy', 'c', + version : '0.2.0', + license: 'MIT', + meson_version: '>=0.64.0', +) + +py_mod = import('python') +py = py_mod.find_installation() +py_dep = py.dependency() + +py.install_sources( + 'rfpy/rfdata.py', + 'rfpy/plotting.py', + 'rfpy/hk.py', + 'rfpy/harmonics.py', + 'rfpy/binning.py', + 'rfpy/utils.py', + 'rfpy/__init__.py', + 'rfpy/examples/data/*', + 'rfpy/scripts/*', + pure: false, + subdir: 'rfpy' + ) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..dca45ee --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +build-backend = "mesonpy" +requires = ["meson-python>0.15.0", "numpy >= 1.25.0"] + + +[project] +name = "rfpy" +version = "0.2.0" +description = "Python package for calculating and post-processing +receiver functions" +authors = [ + { name = "Pascal Audet", email = "pascal.audet@uottawa.ca" } +] +maintainers = [ + { name = "Pascal Audet", email = "pascal.audet@uottawa.ca" } +] +requires-python = ">=3.9" +readme = "README.md" +dependencies = ["numpy>=1.25", "obspy", "spectrum"] +classifiers = [ + "Development Status :: 5 - Stable", + "Environment :: Console", + "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering :: Physics", +] + +[project.urls] +Homepage = "https://github.com/paudetseis/RfPy" +Documentation = "https://paudetseis.github.io/RfPy" +"Bug Tracker" = "https://github.com/paudetseis/RfPy/issues" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index be10bb2..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -import setuptools -import os.path -from os import listdir -import re -from setuptools import setup -from pathlib import Path - - -def find_version(*paths): - fname = os.path.join(os.path.dirname(__file__), *paths) - with open(fname) as fp: - code = fp.read() - match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", code, re.M) - if match: - return match.group(1) - raise RuntimeError("Unable to find version string.") - - -setup( - name='rfpy', - version=find_version('rfpy', '__init__.py'), - description='Python Module for Teleseismic Receiver Functions', - author='Pascal Audet', - author_email='pascal.audet@uottawa.ca', - maintainer='Pascal Audet', - maintainer_email='pascal.audet@uottawa.ca', - url='https://github.com/paudetseis/RfPy', - classifiers=[ - 'Development Status :: 3 - Alpha', - 'License :: OSI Approved :: MIT License', - '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'], - install_requires=['numpy', 'obspy', 'stdb>=0.2.0'], - python_requires='>=3.7', - packages=setuptools.find_packages(), - entry_points={'console_scripts': [ - 'rfpy_calc=rfpy.scripts.rfpy_calc:main', - 'rfpy_recalc=rfpy.scripts.rfpy_recalc:main', - 'rfpy_plot=rfpy.scripts.rfpy_plot:main', - 'rfpy_harmonics=rfpy.scripts.rfpy_harmonics:main', - 'rfpy_hk=rfpy.scripts.rfpy_hk:main', - 'rfpy_ccp=rfpy.scripts.rfpy_ccp:main']}) From 2998a7ed7c7f77628dcd8b7cc99b38e526688025 Mon Sep 17 00:00:00 2001 From: Pascal Audet Date: Wed, 7 May 2025 17:03:20 +1200 Subject: [PATCH 3/5] update conda env --- docs/rfpy.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/rfpy.rst b/docs/rfpy.rst index 53a34d4..da3095e 100644 --- a/docs/rfpy.rst +++ b/docs/rfpy.rst @@ -31,15 +31,13 @@ Installation Dependencies ------------ -The current version has been tested using **Python > 3.6** \ +The current version has been tested using **Python > 3.9** \ Also, the following packages are required: - `stdb `_ +- `obspy `_ - `spectrum `_ -Other required packages (e.g., ``obspy``) -will be automatically installed by ``stdb``. - Conda environment ----------------- @@ -48,7 +46,7 @@ where ``RfPy`` can be installed along with some of its dependencies. .. sourcecode:: bash - conda create -n rfpy "python=3.10" "setuptools=60" obspy spectrum -c conda-forge + conda create -n rfpy -c conda-forge python=3.12 obspy spectrum Activate the newly created environment: @@ -56,7 +54,7 @@ Activate the newly created environment: conda activate rfpy -Install remaining dependencies using ``pip`` inside the ``rfpy`` environment: +Install the `StDb` dependency using ``pip`` inside the ``rfpy`` environment: .. sourcecode:: bash From b69a590aafbffeaad02926f8f9ea4898727561a6 Mon Sep 17 00:00:00 2001 From: Pascal Audet Date: Wed, 7 May 2025 17:03:50 +1200 Subject: [PATCH 4/5] building with meson and pyproject.toml --- meson.build | 13 ++++++++++--- pyproject.toml | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index cab3689..00981a9 100644 --- a/meson.build +++ b/meson.build @@ -15,9 +15,16 @@ py.install_sources( 'rfpy/harmonics.py', 'rfpy/binning.py', 'rfpy/utils.py', + 'rfpy/ccp.py', 'rfpy/__init__.py', - 'rfpy/examples/data/*', - 'rfpy/scripts/*', + 'rfpy/scripts/rfpy_calc.py', + 'rfpy/scripts/rfpy_recalc.py', + 'rfpy/scripts/rfpy_plot.py', + 'rfpy/scripts/rfpy_hk.py', + 'rfpy/scripts/rfpy_harmonics.py', + 'rfpy/scripts/rfpy_ccp.py', + 'rfpy/scripts/__init__.py', pure: false, - subdir: 'rfpy' + preserve_path: true, ) + \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index dca45ee..dec229e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,8 +6,7 @@ requires = ["meson-python>0.15.0", "numpy >= 1.25.0"] [project] name = "rfpy" version = "0.2.0" -description = "Python package for calculating and post-processing -receiver functions" +description = "Python package for calculating and post-processing receiver functions" authors = [ { name = "Pascal Audet", email = "pascal.audet@uottawa.ca" } ] @@ -28,4 +27,12 @@ classifiers = [ [project.urls] Homepage = "https://github.com/paudetseis/RfPy" Documentation = "https://paudetseis.github.io/RfPy" -"Bug Tracker" = "https://github.com/paudetseis/RfPy/issues" \ No newline at end of file +"Bug Tracker" = "https://github.com/paudetseis/RfPy/issues" + +[project.scripts] +rfpy_calc = "rfpy.scripts.rfpy_calc:main" +rfpy_recalc = "rfpy.scripts.rfpy_recalc:main" +rfpy_plot = "rfpy.scripts.rfpy_plot:main" +rfpy_hk = "rfpy.scripts.rfpy_hk:main" +rfpy_harmonics = "rfpy.scripts.rfpy_harmonics:main" +rfpy_ccp = "rfpy.scripts.rfpy_ccp:main" From d3949ee55fcb0ef6a46f93905340bcb0a6a0b7d6 Mon Sep 17 00:00:00 2001 From: Pascal Audet Date: Wed, 7 May 2025 17:05:18 +1200 Subject: [PATCH 5/5] updated deploy workflow --- .github/workflows/deploy.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b0f3ecb..3c5096c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest"] - python-version: ["3.10"] + python-version: ["3.12"] steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -39,10 +39,9 @@ jobs: run: | conda info conda config --add channels conda-forge - conda install obspy cartopy libstdcxx-ng + conda install obspy spectrum pip install stdb - pip install spectrum - pip install -e . + pip install . # - name: Tests # shell: bash -l {0} @@ -54,7 +53,7 @@ jobs: # bash <(curl -s https://codecov.io/bash) - name: Make docs - if: matrix.python-version == '3.10' + if: matrix.python-version == '3.12' shell: bash -l {0} run: | cd docs @@ -65,7 +64,7 @@ jobs: cd .. - name: Deploy 🚀 - if: matrix.python-version == '3.10' + if: matrix.python-version == '3.12' uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}