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
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish to PyPI

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history so hatch-vcs reads the tag

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Build package
run: uv build

- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

publish:
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # required for OIDC trusted publishing
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
dev/
__pycache__/
src/pygenray/__about__.py
.DS_Store
docs/_build/
dist/
.vscode/
uv.lock
uv.lock
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v6.0.0"
hooks:
- id: check-added-large-files
args: ["--maxkb=5120"]
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.11"
hooks:
- id: ruff-check
args: ["--fix", "--show-fixes"]
- id: ruff-format
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ python:
path: .
extra_requirements:
- docs

1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Environment Specification
```{eval-rst}
.. automodule:: pygenray.environment
:members:
```

## Launch Rays
Expand Down
2 changes: 1 addition & 1 deletion docs/building_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ actually... scipy might be worth it. Because I can have the ray code done in jus
- use launched ray and previous bracketing rays and repeat until convergence


**where I left off**: I have built out `shoot_rays` and `shoot_ray`, and created a single method that can be called from within the functions that take an environment as input, and when accessing shared memory. But I haven't tested all of that functionality yet.
**where I left off**: I have built out `shoot_rays` and `shoot_ray`, and created a single method that can be called from within the functions that take an environment as input, and when accessing shared memory. But I haven't tested all of that functionality yet.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

# Add the source directory to the path so Sphinx can import the modules
sys.path.insert(0, os.path.abspath('../src'))
sys.path.insert(0, os.path.abspath("../src"))

project = "pygenray"
copyright = "2025, John Ragland"
Expand Down
1 change: 0 additions & 1 deletion docs/quick_start.md
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

2 changes: 1 addition & 1 deletion docs/ray_physics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
- Environment depth and source / receiver depths are specified with positive z, defined by distance from surface of ocean in meters.
- The ray state, $y$, defined by $y = \left[\mathrm{T, z, p_z} \right]^T$, uses sign convention where z is negative and increases in z correspond to moving towards the surface.
- Subsequently, a positive ray angle corresponds to a ray moving towards the surface.
- A positive ray ID corresponds to a positive launch angle (towards the surface)
- A positive ray ID corresponds to a positive launch angle (towards the surface)
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
Expand Down Expand Up @@ -47,7 +47,10 @@ Issues = "https://github.com/John Ragland/pygenray/issues"
Source = "https://github.com/John Ragland/pygenray"

[tool.hatch.version]
path = "src/pygenray/__about__.py"
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/pygenray/__about__.py"

[tool.hatch.envs.types]
extra-dependencies = [
Expand Down Expand Up @@ -75,6 +78,9 @@ exclude_lines = [
"if TYPE_CHECKING:",
]

[tool.ruff.lint.per-file-ignores]
"src/pygenray/__init__.py" = ["F403"]

[dependency-groups]
dev = [
"pytest>=8.3.5",
Expand Down
4 changes: 0 additions & 4 deletions src/pygenray/__about__.py

This file was deleted.

Loading
Loading