Skip to content

Commit 32e7a9c

Browse files
authored
Merge pull request #15 from X-ray-interferometry/project-structure-overhaul
Project structure overhaul
2 parents 03078a5 + 0916a0a commit 32e7a9c

9 files changed

Lines changed: 908 additions & 523 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will install Python dependencies, run tests and lint
2+
# with a variety of Python versions
3+
# For more information see:
4+
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
5+
6+
name: Curtains
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
pull_request:
13+
branches:
14+
- main
15+
workflow_dispatch:
16+
17+
18+
jobs:
19+
build:
20+
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
python-version: ["3.11", "3.12", "3.13", "3.14"]
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v3
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
python -m pip install '.[dev]'
37+
- name: Check formatting with ruff
38+
run: |
39+
ruff format --check
40+
- name: Lint with ruff
41+
run: |
42+
ruff check

.gitignore

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
__pycache__/
2-
3-
.DS_Store
4-
/.DS_Store
5-
1+
*.pyc
62
.vscode/
73

84
ignore/
@@ -13,10 +9,11 @@ random/
139
output_data/
1410
results/
1511

16-
curtains/models/*
17-
!curtains/models/arf.fits
18-
!curtains/models/rmf.fits
12+
src/curtains/models/*
13+
!src/curtains/models/arf.fits
14+
!src/curtains/models/rmf.fits
1915

2016
*.egg-info/
2117
*.pdf
22-
simulation.py
18+
simulation.py
19+
src/curtains/version.py

pyproject.toml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,47 @@
1-
[build-system]
2-
requires = ["setuptools>=61.0"]
3-
4-
build-backend = "setuptools.build_meta"
5-
61
[project]
72
name = "curtains"
8-
version = "0.0.1"
3+
dynamic = ["version"]
94
description = "Simulation of X-ray interferometric observations"
105
readme = "README.rst"
11-
requires-python = ">=3.8"
6+
authors = [
7+
{ name="Philipp Stoecker", email="p.o.stoecker@uva.nl" },
8+
]
9+
requires-python = ">=3.11"
1210
dependencies = [
13-
11+
"numpy~=2.4",
12+
"astropy~=7.2",
13+
"matplotlib~=3.10",
14+
"pandas~=3.0",
15+
"scipy~=1.17",
16+
"pillow~=12.1",
17+
]
18+
19+
[project.optional-dependencies]
20+
dev = [
21+
"ruff~=0.13.2",
1422
]
1523

24+
[build-system]
25+
requires = ["setuptools>=77.0","setuptools_scm>=9.2"]
26+
build-backend = "setuptools.build_meta"
27+
28+
[tool.setuptools_scm]
29+
fallback_version = "0.1"
30+
write_to = "src/curtains/version.py"
31+
write_to_template = """
32+
# coding: utf-8
33+
# file generated by setuptools_scm
34+
# don't change, don't track in version control
35+
__version__ = version = "{version}"
36+
__version_tuple__ = version_tuple = {version_tuple!r}
37+
__git_hash__ = "{scm_version.node}"
38+
__semantic_version__ = "{scm_version.tag}"
39+
"""
40+
1641
[tool.setuptools.packages.find]
17-
where = ["curtains"]
42+
where = ["src"]
43+
44+
[tool.ruff]
45+
# Ignore the auto-generated file
46+
include = ["src/curtains/*.py"]
47+
exclude = ["src/curtains/version.py"]

0 commit comments

Comments
 (0)