Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors some functions, more unit tests, more quivr #100

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 44 additions & 13 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,20 @@ jobs:
uses: actions/checkout@v3
- name: Get git tags
run: git fetch --prune --unshallow --tags
- uses: actions/setup-python@v4

# Use pip to install dependencies
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
# Use pip to install dependencies
cache: true
cache-dependency-path: ./pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
# Run linter
pdm install -G test
- name: Run linter
run: |
pdm run check
# Get JPL ephemeris files
- name: Get JPL ephemeris files
run: |
python scripts/set_up_assist.py
- name: Set JPL ephemeris environment variable
run: |
export ASSIST_DATA_DIR=~/.adam_assist_data
# Run tests
- name: Run tests
run: |
Expand All @@ -47,3 +41,40 @@ jobs:
uses: coverallsapp/[email protected]
with:
path-to-lcov: coverage.xml

# Run benchmarks
- name: Run benchmarks
run: |
pdm run benchmark --benchmark-json bench.json

# If on main branch, upload benchmark results
- name: Store main benchmark result
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: main-benchmark
path: bench.json
retention-days: 30

# If PR, download main benchmark data
- name: Download main benchmark data
if: github.event_name == 'pull_request'
id: download-main-benchmark
uses: actions/download-artifact@v3
with:
name: main-benchmark
path: main-bench
continue-on-error: true

- name: Compare benchmarks
if: github.event_name == 'pull_request' && steps.download-main-benchmark.outcome == 'success'
uses: benchmark-action/github-action-benchmark@v1
with:
name: Python Benchmark
tool: 'pytest'
output-file-path: bench.json
external-data-json-path: main-bench/bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-always: true
fail-threshold: '150%'
auto-push: false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,7 @@ out/
database/
.docker_bash_history.txt
*.DS_Store

pdm.lock
.pdm-python
precovery/_version.py
1,448 changes: 0 additions & 1,448 deletions pdm.lock

This file was deleted.

1 change: 0 additions & 1 deletion precovery/_version.py

This file was deleted.

5 changes: 4 additions & 1 deletion precovery/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import json

from ._version import __version__
try:
from ._version import __version__
except ImportError:
__version__ = "unknown"


class Config:
Expand Down
Loading
Loading