Skip to content

Commit d2d0c45

Browse files
committed
Bump to v0.1.12
1 parent f92bc91 commit d2d0c45

33 files changed

+3142
-1722
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,4 @@ ENV/
106106
# Editor configs
107107
/.idea/
108108
.vscode/settings.json
109+
.claude

.isort.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

CLAUDE.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is a Python package called `py-wave-runup` that implements empirical wave runup models for coastal engineers and scientists. Wave runup refers to the final part of a wave's journey as it travels from offshore onto the beach, comprising:
8+
9+
- **setup**: time averaged superelevation of mean water level above SWL
10+
- **swash**: time varying fluctuation of instantaneous water level about setup elevation
11+
12+
## Architecture
13+
14+
The codebase is organized into several key modules:
15+
16+
- **`py_wave_runup/models.py`**: Core module containing empirical wave runup models (Stockdon2006, Power2018, Holman1986, Nielsen2009, etc.). All models inherit from abstract `RunupModel` base class with parameters Hs (significant wave height), Tp (peak wave period), beta (beach slope), and optional Lp, h, r.
17+
18+
- **`py_wave_runup/ensembles.py`**: Ensemble techniques to combine predictions from multiple models, starting with `EnsembleRaw` base class.
19+
20+
- **`py_wave_runup/datasets.py`**: Interface for loading wave runup datasets as pandas DataFrames for model evaluation and training. Uses scikit-learn preprocessing and custom Perlin noise utilities.
21+
22+
- **`py_wave_runup/utils.py`**: Utility functions including `PerlinNoise` for synthetic data generation.
23+
24+
## Development Commands
25+
26+
### Environment Setup
27+
- **uv with existing venv**: `uv sync --active` (uses C:\Users\Chris\venv\py-wave-runup)
28+
- **uv with dev dependencies**: `uv sync --active --dev` (includes development dependencies)
29+
- **Alternative**: `pip install -e ".[dev]"` (if not using uv)
30+
31+
**Note**: The preferred virtual environment location is `C:\Users\Chris\venv\py-wave-runup`. Use `--active` flag to target this environment.
32+
33+
### Testing
34+
- **Run all tests**: `uv run --active pytest`
35+
- **Run with coverage**: `uv run --active pytest --cov=py_wave_runup --cov-report term-missing`
36+
- **Run doctests**: Tests include doctests via `--doctest-modules` flag
37+
38+
### Code Quality
39+
- **Pre-commit hooks**: `uv run --active pre-commit install` then `uv run --active pre-commit run -a`
40+
- **Black formatting**: `uv run --active black .`
41+
42+
### Documentation
43+
- **Build docs**: `uv run --active sphinx-build -M html ".\docs" ".\docs\_build"`
44+
- **Documentation hosted at**: https://py-wave-runup.readthedocs.io
45+
46+
### Build and Publishing
47+
- **Build package**: `uv build`
48+
- **Build wheel only**: `uv build --wheel`
49+
- **Publish to PyPI**: `uv publish`
50+
- **Publish to Test PyPI**: `uv publish --publish-url https://test.pypi.org/legacy/`
51+
- **Check package**: `uv run --active twine check dist/*`
52+
53+
### Dependencies
54+
- **Core**: numpy>=1.24, pandas>=2.0, joblib>=1.3, scikit-learn>=1.3
55+
- **Dev**: pytest, black, sphinx, coverage, pre-commit, matplotlib
56+
- **Python**: 3.10+ (supports up to 3.14)
57+
- **Build system**: Uses hatchling backend with uv package manager
58+
59+
## Key Models Available
60+
61+
The package implements 9+ empirical wave runup models including Stockdon2006 (most widely used), Power2018 (Gene-Expression Programming), Beuzen2019 (Gaussian Process), and others. Each model accepts offshore wave conditions and returns runup predictions via properties like `R2`, `setup`, `sinc`, `sig`.

README.rst

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ Python Wave Runup
1111
.. image:: https://img.shields.io/pypi/v/py-wave-runup.svg
1212
:target: https://pypi.python.org/pypi/py-wave-runup
1313

14-
.. image:: https://img.shields.io/travis/com/chrisleaman/py-wave-runup.svg
15-
:target: https://travis-ci.com/chrisleaman/py-wave-runup
16-
1714
.. image:: https://readthedocs.org/projects/py-wave-runup/badge/?version=latest
1815
:target: https://py-wave-runup.readthedocs.io/en/latest/?badge=latest
1916
:alt: Documentation Status
@@ -41,10 +38,14 @@ Contents
4138
Installation
4239
------------
4340

44-
Installation of ``py-wave-runup`` can be done with pip:
41+
Installation of ``py-wave-runup`` can be done with uv or pip:
4542

4643
.. code:: bash
4744
45+
# Using uv (recommended)
46+
uv add py-wave-runup
47+
48+
# Using pip
4849
pip install py-wave-runup
4950
5051
@@ -139,21 +140,39 @@ to create a Pull Request:
139140
1. Fork it (https://github.com/chrisleaman/py-wave-runup/fork)
140141
2. Create the development environment:
141142

142-
- For pip, run ``pip install --pre -r requirements.txt``
143-
- For `poetry`_, run ``poetry install``
144-
- For `anaconda`_, run ``conda env create --name <env_name> -f environment.yml``
143+
- Using `uv`_ (recommended): ``uv sync --dev``
144+
- For pip: ``pip install -e ".[dev]"``
145145

146146
3. Create your feature branch (``git checkout -b feature/fooBar``)
147-
4. Install pre-commit hooks for automatic formatting (``pre-commit run -a``)
147+
4. Install pre-commit hooks for automatic formatting (``uv run pre-commit install``)
148148
5. Add your code!
149-
6. Add and run tests (``pytest``)
150-
7. Update and check documentation compiles (``sphinx-build -M html ".\docs" ".\docs\_build"``)
151-
8. Commit your changes (``git commit -am 'Add some fooBar``)
149+
6. Add and run tests (``uv run pytest``)
150+
7. Update and check documentation compiles (``uv run sphinx-build -M html ".\docs" ".\docs\_build"``)
151+
8. Commit your changes (``git commit -am 'Add some fooBar'``)
152152
9. Push to the branch (``git push origin feature/fooBar``)
153153
10. Create a new Pull Request
154154

155-
.. _poetry: https://python-poetry.org/
156-
.. _anaconda: https://www.anaconda.com/distribution/#download-section
155+
.. _uv: https://docs.astral.sh/uv/
156+
157+
158+
Publishing
159+
----------
160+
161+
To build and publish the package to PyPI:
162+
163+
.. code:: bash
164+
165+
# Build the package
166+
uv build
167+
168+
# Check the package (optional)
169+
uv run --active twine check dist/*
170+
171+
# Publish to Test PyPI first (recommended)
172+
uv publish --publish-url https://test.pypi.org/legacy/
173+
174+
# Publish to PyPI
175+
uv publish
157176
158177
159178
Citation

docs/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020

2121
# -- Project information -----------------------------------------------------
2222

23+
2324
# Get project version from pyproject.toml file
24-
# https://github.com/python-poetry/poetry/issues/273#issuecomment-427647628
2525
def _get_project_meta():
2626
with open("../pyproject.toml") as pyproject:
2727
file_contents = pyproject.read()
28-
return tomlkit.parse(file_contents)["tool"]["poetry"]
28+
return tomlkit.parse(file_contents)["project"]
2929

3030

3131
project = "py-wave-runup"
@@ -115,6 +115,7 @@ def _get_project_meta():
115115

116116
# Autodoc options
117117

118+
118119
# Define what classes to skip
119120
def autodoc_skip_member(app, what, name, obj, skip, options):
120121
exclusions = ("RunupModel",)

docs/index.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ Python Wave Runup
55
.. image:: https://img.shields.io/pypi/v/py-wave-runup.svg
66
:target: https://pypi.python.org/pypi/py-wave-runup
77

8-
.. image:: https://img.shields.io/travis/com/chrisleaman/py-wave-runup.svg
9-
:target: https://travis-ci.com/chrisleaman/py-wave-runup
10-
118
.. image:: https://readthedocs.org/projects/py-wave-runup/badge/?version=latest
129
:target: https://py-wave-runup.readthedocs.io/en/latest/?badge=latest
1310
:alt: Documentation Status

docs/installation.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22
Installation
33
------------
44

5-
If you don't have Python installed, Anaconda_ is an easy way to get up and running with Python.
6-
7-
.. _Anaconda: https://docs.anaconda.com/anaconda/install/
8-
9-
10-
Installation of ``py-wave-runup`` can be done with ``pip``. Run this command in your
11-
terminal of choice to grab the latest release of this package:
5+
Installation of ``py-wave-runup`` can be done with uv or pip:
126

137
.. code:: bash
148
9+
# Using uv (recommended)
10+
uv add py-wave-runup
11+
12+
# Using pip
1513
pip install py-wave-runup
1614
17-
If you've installed an older version and want to upgrade to the latest version, run
18-
this command:
15+
If you've installed an older version and want to upgrade to the latest version:
1916

2017
.. code:: bash
2118
19+
# Using uv
20+
uv add py-wave-runup --upgrade
21+
22+
# Using pip
2223
pip install --upgrade py-wave-runup
2324
2425
After you're up and running, head on over to :doc:`usage` for some examples of what

docs/requirements.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)