-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca36b95
commit 148d444
Showing
61 changed files
with
1,895 additions
and
585 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Test | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
coverage-perf: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: pyproject.toml | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- run: make bench | ||
|
||
- name: Upload coverage reports to Codecov | ||
run: | | ||
curl -Os https://uploader.codecov.io/latest/linux/codecov | ||
chmod +x codecov | ||
./codecov -t ${{ secrets.CODECOV_TOKEN }} | ||
- name: Continuous Benchmark | ||
uses: benchmark-action/[email protected] | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
with: | ||
name: cyeva Benchmark | ||
tool: "pytest" | ||
output-file-path: output.json | ||
github-token: ${{ secrets.OPS_ACTIONS_CI_TOKEN }} | ||
gh-repository: "github.com/caiyunapp/cyeva" | ||
auto-push: true | ||
alert-threshold: "150%" | ||
comment-on-alert: true | ||
fail-on-alert: false | ||
benchmark-data-dir-path: "performance/" | ||
alert-comment-cc-users: "@clarmy" | ||
|
||
Test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["macos-latest", "ubuntu-latest", "windows-latest"] | ||
python-version: ["3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- run: make all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.PHONY: help build fmt lint sync lock upgrade all test | ||
|
||
export PYTHONPATH := $(shell pwd) | ||
export UV_PYTHON_PREFERENCE=only-system | ||
|
||
help: | ||
@echo "Available commands:" | ||
@echo " build - Build the project using uv" | ||
@echo " fmt - Format the code using ruff" | ||
@echo " lint - Lint the code using ruff" | ||
@echo " sync - Sync and compile the project using uv" | ||
@echo " lock - Lock dependencies using uv" | ||
@echo " upgrade - Upgrade dependencies using uv" | ||
@echo " all - Run lock, sync, fmt, lint, and test" | ||
|
||
build: | ||
uv build --no-sources | ||
|
||
fmt: | ||
uv run ruff check --select I --fix . | ||
uv run ruff format . | ||
|
||
lint: | ||
uv run ruff check --fix . | ||
uv run ruff format --check . | ||
|
||
sync: | ||
uv sync --compile --frozen | ||
|
||
lock: | ||
uv lock | ||
|
||
upgrade: | ||
uv lock --upgrade | ||
|
||
all: lock sync | ||
make fmt | ||
make lint | ||
make test | ||
|
||
test: lint | ||
uv run pytest --cov=cyeva/ ./tests/functions ./tests/test_issues.py | ||
|
||
bench: sync | ||
uv run pytest --cov=cyeva/ -p no:warnings --memray --benchmark-json output.json tests/test_perf.py | ||
|
||
freeze-doc-requirements: | ||
cd docs;uv lock;uv export > requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .core import * | ||
from .core import * # noqa | ||
|
||
__version__ = "0.1.0.beta.12" | ||
__version__ = "0.2.0" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
""" | ||
This is the module to store wind directions constants. | ||
* DIRECTION8_CENTER_ANGLE: Wind 8 cardinal directions central angles. | ||
* DIRECTION16_CENTER_ANGLE: Wind 16 cardinal directions central angles. | ||
* DIRECTION8_ABBR: Wind 8 cardinal directions abbreviation. | ||
* DIRECTION16_ABBR: Wind 16 cardinal directions abbreviation. | ||
""" | ||
|
||
DIRECTION8_CENTER_ANGLE = {0: 0, 1: 45, 2: 90, 3: 135, 4: 180, 5: 225, 6: 270, 7: 315} | ||
DIRECTION16_CENTER_ANGLE = { | ||
0: 0, | ||
1: 22.5, | ||
2: 45, | ||
3: 67.5, | ||
4: 90, | ||
5: 112.5, | ||
6: 135, | ||
7: 157.5, | ||
8: 180, | ||
9: 202.5, | ||
10: 225, | ||
11: 247.5, | ||
12: 270, | ||
13: 292.5, | ||
14: 315, | ||
15: 337.5, | ||
} | ||
|
||
DIRECTION8_ABBR = {0: "N", 1: "NE", 2: "E", 3: "SE", 4: "S", 5: "SW", 6: "W", 7: "NW"} | ||
DIRECTION16_ABBR = { | ||
0: "N", | ||
1: "NNE", | ||
2: "NE", | ||
3: "ENE", | ||
4: "E", | ||
5: "ESE", | ||
6: "SE", | ||
7: "SSE", | ||
8: "S", | ||
9: "SSW", | ||
10: "SW", | ||
11: "WSW", | ||
12: "W", | ||
13: "WNW", | ||
14: "NW", | ||
15: "NNW", | ||
} |
Oops, something went wrong.