Skip to content

Commit ae05863

Browse files
author
Sarah Wagner
committed
major structural upgrade
1 parent 004d3ef commit ae05863

File tree

18 files changed

+290
-0
lines changed

18 files changed

+290
-0
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
groups:
9+
actions:
10+
patterns:
11+
- "*"
12+

.github/workflows/cd.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CD
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types:
11+
- published
12+
13+
jobs:
14+
dist:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: hynek/build-and-inspect-python-package@v2
22+
23+
publish:
24+
needs: [dist]
25+
environment: pypi
26+
permissions:
27+
id-token: write
28+
attestations: write
29+
contents: read
30+
runs-on: ubuntu-latest
31+
if: github.event_name == 'release' && github.event.action == 'published'
32+
33+
steps:
34+
- uses: actions/download-artifact@v4
35+
with:
36+
name: Packages
37+
path: dist
38+
39+
- name: Generate artifact attestation for sdist and wheel
40+
uses: actions/attest-build-provenance@v2
41+
with:
42+
subject-path: "dist/*"
43+
44+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
push:
2+
branches:
3+
- main
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
11+
tests:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version:
17+
- "3.9"
18+
- "3.13"
19+
name: Check Python ${{ matrix.python-version }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0 # Only needed if using setuptools-scm
24+
25+
- name: Setup Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
allow-prereleases: true
30+
31+
- name: Download uv
32+
uses: astral-sh/setup-uv@v6
33+
34+
- name: Test package
35+
run: uv run pytest
36+
37+
38+

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: "v5.0.0"
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-symlinks
9+
- id: check-yaml
10+
- id: debug-statements
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
- id: name-tests-test
14+
args: ["--pytest-test-first"]
15+
- id: requirements-txt-fixer
16+
- id: trailing-whitespace
17+
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: "v0.11.13"
20+
hooks:
21+
# id: ruff-check would go here if using both
22+
- id: ruff-format
23+
- id: ruff-check
24+
args: ["--fix", "--show-fixes"]
25+

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Sarah M Wagner
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

environment.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: lcs_dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.12
6+
- astropy
7+
- matplotlib
8+
- numpy
9+
- tqdm
10+
- scipy

pyproject.toml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "lightcurves"
7+
dynamic = ["version"]
8+
description = "A package to analyze any kind of light curve/time series, e.g. with Bayesian Blocks, flare fitting (HOP), and a stochastic processe"
9+
readme = "README.md"
10+
authors = [
11+
{ name = "Sarah Wagner", email = "[email protected]" },
12+
]
13+
maintainers = [
14+
{ name = "Sarah Wagner", email = "[email protected]" },
15+
]
16+
license = { text = "MIT" }
17+
classifiers = [
18+
"Intended Audience :: Science/Research",
19+
"License :: OSI Approved :: MIT License",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Topic :: Scientific/Engineering :: Astronomy",
24+
"Topic :: Scientific/Engineering :: Physics",
25+
"Development Status :: 4 - Beta",
26+
]
27+
28+
requires-python = ">=3.10"
29+
30+
#list of dependencies.
31+
#do not list imports from standard library like logging or pickle
32+
dependencies = [
33+
"astropy",
34+
"numpy",
35+
"pandas",
36+
"scipy",
37+
"tqdm",
38+
"matplotlib",
39+
"lmfit"
40+
]
41+
42+
[tool.hatch.version]
43+
source = "vcs"
44+
45+
[tool.hatch.build.hooks.vcs]
46+
version-file = "src/lightcurves/_version.py"
47+
48+
[tool.hatch.build.targets.wheel]
49+
includes = ["src/lightcurves"]
50+
51+
[tool.ruff.lint]
52+
extend-select = [
53+
"ARG", # flake8-unused-arguments
54+
"B", # flake8-bugbear
55+
"C4", # flake8-comprehensions
56+
"EM", # flake8-errmsg
57+
"EXE", # flake8-executable
58+
"FURB", # refurb
59+
"G", # flake8-logging-format
60+
"I", # isort
61+
"ICN", # flake8-import-conventions
62+
"NPY", # NumPy specific rules
63+
"PD", # pandas-vet
64+
"PGH", # pygrep-hooks
65+
"PIE", # flake8-pie
66+
"PL", # pylint
67+
"PT", # flake8-pytest-style
68+
"PTH", # flake8-use-pathlib
69+
"PYI", # flake8-pyi
70+
"RET", # flake8-return
71+
"RUF", # Ruff-specific
72+
"SIM", # flake8-simplify
73+
"T20", # flake8-print
74+
"UP", # pyupgrade
75+
"YTT", # flake8-2020
76+
]
77+
ignore = [
78+
"PLR09", # Too many <...>
79+
"PLR2004", # Magic value used in comparison
80+
]
81+
typing-modules = ["mypackage._compat.typing"]
82+
isort.required-imports = ["from __future__ import annotations"]
83+
84+
[tool.ruff.lint.per-file-ignores]
85+
"tests/**" = ["T20"]
86+
87+
88+
89+
90+
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)