Skip to content

Commit 93b2fec

Browse files
authored
Merge branch 'main' into renovate/ruby-3.x
2 parents 873c9ab + 5680be1 commit 93b2fec

File tree

190 files changed

+45667
-2962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+45667
-2962
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "image": "mcr.microsoft.com/devcontainers/universal:2" }

.github/copilot-instructions.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Copilot Instructions
2+
3+
This repository contains mathematical functions implemented in Python. When
4+
contributing or modifying code, please adhere to the following guidelines:
5+
6+
## Code Structure
7+
8+
- Follow the initial structure with `api.py` for interface definitions and
9+
`functions.py` for implementations
10+
- Each function should be implemented in `functions.py` and exposed through
11+
`api.py`
12+
13+
## Coding Standards
14+
15+
1. Follow
16+
[Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)
17+
2. Use type annotations (Python 3.10+):
18+
19+
```python
20+
def function_name(x: float, y: int) -> float:
21+
"""Function description.
22+
23+
Note:
24+
- Description of the function
25+
- Mathematical notation using LaTeX where applicable
26+
- Example: $f(x) = x^2 + y^2$ or
27+
28+
$$
29+
f(x) = \sum_{i=0}^{n} a_i x^i
30+
$$
31+
32+
33+
Args:
34+
x (float): Description of x
35+
y (int): Description of y
36+
37+
Returns:
38+
float: Description of return value
39+
"""
40+
pass
41+
```
42+
43+
## Documentation
44+
45+
1. Include docstrings with:
46+
- Brief description
47+
- Parameters with types
48+
- Return value with type
49+
- Mathematical notation using LaTeX where applicable
50+
51+
Example:
52+
53+
```python
54+
def calculate_polynomial(x: float, coefficients: list[float]) -> float:
55+
"""Evaluates a polynomial with given coefficients.
56+
57+
Args:
58+
x: Value to evaluate at
59+
coefficients: List of coefficients [a₀, a₁, ..., aₙ]
60+
61+
Returns:
62+
float: Result of polynomial: ∑(aᵢ * x^i)
63+
64+
Note:
65+
LaTeX: f(x) = \sum_{i=0}^{n} a_i x^i
66+
"""
67+
pass
68+
```

.github/workflows/python-package.yml

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ name: Python package
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [main]
99
pull_request:
10-
branches: [ main ]
10+
branches: [main]
1111

1212
jobs:
13-
1413
build:
1514
runs-on: ubuntu-latest
1615
strategy:
@@ -19,45 +18,45 @@ jobs:
1918
python-version: ["3.10", "3.11"]
2019

2120
steps:
22-
- uses: actions/checkout@v4
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: astral-sh/setup-uv@v5
25-
with:
26-
enable-cache: true
27-
cache-dependency-glob: uv.lock
28-
python-version: ${{ matrix.python-version }}
29-
- name: Install the project
30-
run: uv sync --all-extras --dev
31-
- name: Test SpectraFit
32-
run: uv run --group dev --all-extras pytest umf/
33-
- name: Codecov
34-
uses: codecov/codecov-action@v4.6.0
35-
with:
36-
token: ${{ secrets.CODECOV_TOKEN }}
37-
env_vars: OS,PYTHON
21+
- uses: actions/checkout@v4
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: astral-sh/setup-uv@v6
24+
with:
25+
enable-cache: true
26+
cache-dependency-glob: uv.lock
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install the project
29+
run: uv sync --all-extras --dev
30+
- name: Test SpectraFit
31+
run: uv run --group dev --all-extras pytest umf/
32+
- name: Codecov
33+
uses: codecov/codecov-action@v5.4.0
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}
36+
env_vars: OS,PYTHON
3837

3938
docs:
4039
needs: build
4140
runs-on: ubuntu-latest
4241
steps:
43-
- uses: actions/checkout@v4
44-
with:
45-
fetch-depth: 0
46-
- name: Install uv and dependencies with doc-dependencies
47-
uses: astral-sh/setup-uv@v5
48-
with:
49-
enable-cache: true
50-
cache-dependency-glob: uv.lock
51-
python-version: "3.10"
52-
- name: Install the project
53-
run: uv sync --all-extras --group docs
54-
- name: Set git config
55-
run: |
56-
git config --local user.email "[email protected]"
57-
git config --local user.name "GitHub Action"
58-
- name: Build documentation
59-
if: ${{ !contains(github.ref, 'refs/heads/main')}}
60-
run: uv run --group docs --all-extras mkdocs build --clean
61-
- name: Deploy documentation develops
62-
if: contains(github.ref, 'refs/heads/main')
63-
run: uv run --group docs --all-extras mike deploy --push --update-aliases develop
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
- name: Install uv and dependencies with doc-dependencies
46+
uses: astral-sh/setup-uv@v6
47+
with:
48+
enable-cache: true
49+
cache-dependency-glob: uv.lock
50+
python-version: "3.10"
51+
- name: Install the project
52+
run: uv sync --all-extras --group docs
53+
- name: Set git config
54+
run: |
55+
git config --local user.email "[email protected]"
56+
git config --local user.name "GitHub Action"
57+
- name: Build documentation
58+
if: ${{ !contains(github.ref, 'refs/heads/main')}}
59+
run: uv run --group docs --all-extras mkdocs build --clean
60+
- name: Deploy documentation develops
61+
if: contains(github.ref, 'refs/heads/main')
62+
run: uv run --group docs --all-extras mike deploy --push --update-aliases develop

.github/workflows/python-publish.yml

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
types: [created]
99

1010
jobs:
11-
1211
deploy:
1312
name: Publish on PyPi
1413
runs-on: ubuntu-latest
@@ -31,45 +30,45 @@ jobs:
3130
password: ${{ secrets.TWINE_TOKEN }}
3231

3332
docs:
34-
if: ${{ contains(github.event.release.prerelease, false) }}
35-
name: Build Documentation from main'
36-
needs: deploy
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v4
40-
with:
41-
fetch-depth: 0
42-
- name: Install uv and dependencies with doc-dependencies
43-
uses: astral-sh/setup-uv@v5
44-
with:
45-
enable-cache: true
46-
cache-dependency-glob: uv.lock
47-
python-version: "3.10"
48-
- name: Install library
49-
run: uv sync --all-extras --group docs
50-
- name: Set git config
51-
run: |
52-
git config --local user.email "[email protected]"
53-
git config --local user.name "GitHub Action"
54-
- name: Fetch tags
55-
run: git fetch --tags --prune
56-
- name: Determine previous release
57-
id: previous_release
58-
run: echo "::set-output name=previous_tag::$(git describe --tags $(git rev-list --tags --skip=1 --max-count=1) --abbrev=0)"
59-
- name: Determine current release
60-
id: current_release
61-
run: echo "::set-output name=current_tag::$(git describe --tags --abbrev=0)"
62-
- name: Check if minor release
63-
id: is_minor_release
64-
run: |
65-
previous_tag=$(/bin/echo ${{ steps.previous_release.outputs.previous_tag }})
66-
current_tag=$(/bin/echo ${{ steps.current_release.outputs.current_tag }})
67-
previous_version=$(echo $previous_tag | cut -d '.' -f 1,2)
68-
current_version=$(echo $current_tag | cut -d '.' -f 1,2)
69-
if [[ "$previous_version" == "$current_version" ]]; then
70-
uv run --group docs --all-extras run mike delete ${{ steps.previous_release.outputs.previous_tag }}
71-
fi
72-
- name: Deploy documentation develops
73-
run: |
74-
uv run --group docs --all-extras run mike deploy --push --update-aliases ${{ github.event.release.tag_name }} latest --message "Release ${{ github.event.release.tag_name }}"
75-
uv run --group docs --all-extras run mike set-default --push latest
33+
if: ${{ contains(github.event.release.prerelease, false) }}
34+
name: Build Documentation from main'
35+
needs: deploy
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
- name: Install uv and dependencies with doc-dependencies
42+
uses: astral-sh/setup-uv@v6
43+
with:
44+
enable-cache: true
45+
cache-dependency-glob: uv.lock
46+
python-version: "3.10"
47+
- name: Install library
48+
run: uv sync --all-extras --group docs
49+
- name: Set git config
50+
run: |
51+
git config --local user.email "[email protected]"
52+
git config --local user.name "GitHub Action"
53+
- name: Fetch tags
54+
run: git fetch --tags --prune
55+
- name: Determine previous release
56+
id: previous_release
57+
run: echo "::set-output name=previous_tag::$(git describe --tags $(git rev-list --tags --skip=1 --max-count=1) --abbrev=0)"
58+
- name: Determine current release
59+
id: current_release
60+
run: echo "::set-output name=current_tag::$(git describe --tags --abbrev=0)"
61+
- name: Check if minor release
62+
id: is_minor_release
63+
run: |
64+
previous_tag=$(/bin/echo ${{ steps.previous_release.outputs.previous_tag }})
65+
current_tag=$(/bin/echo ${{ steps.current_release.outputs.current_tag }})
66+
previous_version=$(echo $previous_tag | cut -d '.' -f 1,2)
67+
current_version=$(echo $current_tag | cut -d '.' -f 1,2)
68+
if [[ "$previous_version" == "$current_version" ]]; then
69+
uv run --group docs --all-extras run mike delete ${{ steps.previous_release.outputs.previous_tag }}
70+
fi
71+
- name: Deploy documentation develops
72+
run: |
73+
uv run --group docs --all-extras run mike deploy --push --update-aliases ${{ github.event.release.tag_name }} latest --message "Release ${{ github.event.release.tag_name }}"
74+
uv run --group docs --all-extras run mike set-default --push latest

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
name: Markdown linting
2929

3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.9.1
31+
rev: v0.11.7
3232
hooks:
3333
- id: ruff
3434
args: [--fix, --exit-non-zero-on-fix]

.trunk/trunk.yaml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
33
version: 0.1
44
cli:
5-
version: 1.22.9
5+
version: 1.22.12
66
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
77
plugins:
88
sources:
99
- id: trunk
10-
ref: v1.6.6
10+
ref: v1.6.7
1111
uri: https://github.com/trunk-io/plugins
1212
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
1313
runtimes:
@@ -16,27 +16,28 @@ runtimes:
1616
1717
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
1818
lint:
19+
disabled:
20+
- isort
1921
enabled:
20-
21-
22-
- black@24.10.0
23-
22+
23+
24+
- black@25.1.0
25+
2426
- git-diff-check
25-
26-
27-
28-
29-
30-
31-
32-
27+
28+
29+
30+
31+
32+
33+
3334
34-
35-
- yamllint@1.35.1
35+
36+
- yamllint@1.37.0
3637
actions:
3738
disabled:
3839
- trunk-announce
40+
enabled:
3941
- trunk-check-pre-push
4042
- trunk-fmt-pre-commit
41-
enabled:
4243
- trunk-upgrade-available

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@
1818
"python.analysis.importFormat": "absolute",
1919
"python.analysis.enablePytestExtra": true,
2020
"python.analysis.enableSyncServer": true,
21-
"python.analysis.extraPaths": [
22-
"umf"
23-
]
21+
"python.analysis.extraPaths": ["umf"]
2422
}

0 commit comments

Comments
 (0)