Skip to content

Commit 806ba1f

Browse files
authored
Merge pull request #1 from alan-turing-institute/init-and-set-up-modules-structure
Init package and set up modules structure
2 parents bf8a4c6 + d3d5a5d commit 806ba1f

17 files changed

Lines changed: 941 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
branches:
10+
- main
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
tests:
18+
if: github.event.pull_request.draft == false || github.event_name == 'push'
19+
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
25+
# only run for MSV Python 3.10 on PRs, but all versions on pushes to main
26+
python-version: ${{ github.event_name == 'push' && fromJSON('["3.10", "3.11", "3.12"]') || fromJSON('["3.10"]') }}
27+
env:
28+
TURN_OFF_MPS_IF_RUNNING_CI: 1
29+
MPLBACKEND: Agg
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Python ${{ matrix.python-version }}
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
39+
- name: Install uv
40+
uses: astral-sh/setup-uv@v7
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
enable-cache: true
44+
cache-suffix: ${{ runner.os }}-${{ matrix.python-version }}
45+
activate-environment: true
46+
47+
- name: Install dependencies
48+
run: |
49+
uv sync --extra dev
50+
51+
- name: Test with pytest
52+
run: |
53+
# stop pytest after 3 failures to save CI time
54+
uv run pytest --maxfail=3 --cov-report=xml --cov-report=html

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
notebooks/
2+
__pycache__/
3+
.pytest_cache/
4+
dist/
5+
.venv/
6+
*.egg-info/

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.14.4
5+
hooks:
6+
# Run the linter.
7+
- id: ruff-check
8+
types_or: [ python, pyi ]
9+
args: [ --fix ]
10+
# Run the formatter.
11+
- id: ruff-format
12+
types_or: [ python, pyi ]
13+
- repo: https://github.com/RobertCraigie/pyright-python
14+
rev: v1.1.405
15+
hooks:
16+
- id: pyright
17+
# - repo: https://github.com/kyanan/nbstripout
18+
# rev: 0.8.1
19+
# hooks:
20+
# - id: nbstripout
21+
# exclude: ^case_studies/

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
name = "auto-x"
3+
version = "0.1.0"
4+
description = "Spatiotemporal forecasting"
5+
readme = "README.md"
6+
authors = [
7+
{ name = "AI for Physical Systems Team at The Alan Turing Institute", email = "ai4physics@turing.ac.uk" },
8+
]
9+
requires-python = ">=3.10,<3.13"
10+
dependencies = []
11+
12+
[project.optional-dependencies]
13+
dev = [
14+
"ipykernel>=7.1.0",
15+
"pytest>=9.0.1",
16+
"pytest-cov>=7.0.0",
17+
"ruff==0.14.4",
18+
"pyright==1.1.405",
19+
"pre-commit>=4.4.0",
20+
]
21+
22+
[project.scripts]
23+
auto-x = "auto_x:main"
24+
25+
[build-system]
26+
requires = ["uv_build>=0.8.15,<0.9.0"]
27+
build-backend = "uv_build"

src/auto_x/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def main() -> None:
2+
print("Hello from auto-x!")

src/auto_x/data/__init__.py

Whitespace-only changes.

src/auto_x/dataloaders/__init__.py

Whitespace-only changes.

src/auto_x/decoders/__init__.py

Whitespace-only changes.

src/auto_x/encoders/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)