Skip to content

Commit

Permalink
Merge pull request #437 from OpenCOMPES/v1_feature_branch
Browse files Browse the repository at this point in the history
Upgrade to V1
  • Loading branch information
rettigl authored Feb 5, 2025
2 parents 9a35cab + cf9f594 commit 47b979b
Show file tree
Hide file tree
Showing 120 changed files with 6,484 additions and 9,232 deletions.
14 changes: 14 additions & 0 deletions .cspell/custom-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ caldir
calib
calibdict
caplog
capsys
cdeform
cdeformfield
cdisp
Expand Down Expand Up @@ -77,6 +78,8 @@ datastreams
datestring
ddir
delaxes
delayeds
delenv
Desy
Deutsches
dfield
Expand All @@ -85,12 +88,14 @@ dfpart
dfpid
dictionarized
dictmerge
DLDAUX
DOOCS
dpkg
dropna
dset
dsets
dtype
dtypes
easimon
ecalibdict
electronanalyser
Expand Down Expand Up @@ -125,6 +130,7 @@ ftype
fwhm
genindex
getgid
getgrgid
getmtime
gpfs
griddata
Expand Down Expand Up @@ -290,6 +296,7 @@ ptargs
pullrequest
pval
pyarrow
pydantic
pydata
pyenv
pygments
Expand Down Expand Up @@ -330,6 +337,7 @@ scipy
SDIAG
sdir
segs
setp
sfile
shutil
Sixten
Expand All @@ -340,6 +348,8 @@ splinewarp
stackax
stackaxis
stepsize
subchannel
subchannels
subdir
subdirs
subfolders
Expand Down Expand Up @@ -401,6 +411,8 @@ xpos
xratio
xrng
xscale
xticklabels
xticks
xtrans
Xuser
xval
Expand All @@ -411,6 +423,8 @@ ylabel
ypos
yratio
yscale
yticklabels
yticks
ytrans
zain
Zenodo
Expand Down
33 changes: 20 additions & 13 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ name: benchmark
on:
workflow_dispatch:
push:
branches: [ main, create-pull-request/patch ]
paths-ignore:
pyproject.toml
branches: [ main]
pull_request:
branches: [ main ]

env:
UV_SYSTEM_PYTHON: true

jobs:
benchmark:
Expand All @@ -16,28 +19,32 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0

- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
# Setup python
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.8
poetry-version: 1.2.2
python-version: "3.10"

- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install project dependencies
run: poetry install
- name: Install package
run: |
uv pip install ".[dev]"
# Run benchmarks
- name: Run benchmarks on python 3.8
- name: Run benchmarks on python 3.10
run: |
poetry run pytest --full-trace --show-capture=no -sv benchmarks/benchmark_*.py
pytest --full-trace --show-capture=no -sv benchmarks/benchmark_*.py
- name: Obtain git status
id: status
Expand Down
85 changes: 34 additions & 51 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
branches: [ main ]
tags: [ v* ]
paths:
- sed/**/*
- src/sed/**/*
- tutorial/**
- .github/workflows/documentation.yml
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
UV_SYSTEM_PYTHON: true

jobs:
build:
Expand All @@ -26,69 +28,50 @@ jobs:
remove-android: 'true'
remove-docker-images: 'true'

# Check out repo and set up Python
- name: Check out the repository
uses: actions/checkout@v4
# Check out repo and set up Python
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0

# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
# Setup python
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.9
poetry-version: 1.8.3
python-version: "3.10"

- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install notebook dependencies
run: poetry install -E notebook --with docs
- name: Install package
run: |
uv pip install ".[docs,notebook]"
- name: Install pandoc
run: |
sudo wget https://github.com/jgm/pandoc/releases/download/3.1.8/pandoc-3.1.8-1-amd64.deb
sudo dpkg -i pandoc-3.1.8-1-amd64.deb
# rm because hextof_workflow notebook can not run outside maxwell
- name: copy tutorial files to docs
run: |
cp -r $GITHUB_WORKSPACE/tutorial $GITHUB_WORKSPACE/docs/
cp -r $GITHUB_WORKSPACE/sed/config $GITHUB_WORKSPACE/docs/sed
mkdir -p $GITHUB_WORKSPACE/docs/src/sed
cp -r $GITHUB_WORKSPACE/src/sed/config $GITHUB_WORKSPACE/docs/src/sed/
- name: download RAW data
# if: steps.cache-primes.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/docs
poetry run python scripts/download_data.py
python scripts/download_data.py
- name: build parquet files
run: |
cd $GITHUB_WORKSPACE/docs
poetry run python scripts/build_flash_parquets.py
poetry run python scripts/build_sxp_parquets.py
# to be removed later. This theme doesn't support <3.9 python and our lock file contains 3.8
- name: install pydata-sphinx-theme
run: |
poetry run pip install pydata-sphinx-theme
- name: Change version for develop build
if: startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/main'
run: |
VERSION=`sed -n 's/^version = "\(.*\)".*/\1/p' $GITHUB_WORKSPACE/pyproject.toml`
MOD_VERSION=$VERSION".dev0"
echo $MOD_VERSION
sed -i "s/^version = \"$VERSION\"/version = \"$MOD_VERSION\"/" $GITHUB_WORKSPACE/pyproject.toml
- name: Change version for release build
if: startsWith(github.ref, 'refs/tags/')
run: |
OLD_VERSION=`sed -n 's/^version = "\(.*\)".*/\1/p' $GITHUB_WORKSPACE/pyproject.toml`
NEW_VERSION=`echo ${GITHUB_REF#refs/tags/} | sed -n 's/^v\(.*\)/\1/p'`
echo $NEW_VERSION
sed -i "s/^version = \"$OLD_VERSION\"/version = \"$NEW_VERSION\"/" $GITHUB_WORKSPACE/pyproject.toml
python scripts/build_flash_parquets.py
python scripts/build_sxp_parquets.py
- name: build Sphinx docs
run: poetry run sphinx-build -b html $GITHUB_WORKSPACE/docs $GITHUB_WORKSPACE/_build
run: sphinx-build -b html $GITHUB_WORKSPACE/docs $GITHUB_WORKSPACE/_build

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand All @@ -102,17 +85,12 @@ jobs:
needs: build
steps:
- name: Checkout docs repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/docs
token: ${{ secrets.GITHUB_TOKEN }}
path: 'docs-repo'

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Setup SSH
uses: webfactory/[email protected]
with:
Expand All @@ -129,11 +107,16 @@ jobs:
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
echo "folder=sed/$VERSION" >> $GITHUB_OUTPUT
rm docs-repo/sed/stable
rm -rf docs-repo/sed/latest
ln -s -r docs-repo/sed/$VERSION docs-repo/sed/stable
ln -s -r docs-repo/sed/$VERSION docs-repo/sed/latest
echo "folder=sed/$VERSION" >> $GITHUB_OUTPUT
if [[ $VERSION == *a* ]]; then
rm -rf docs-repo/sed/latest
ln -s -r docs-repo/sed/$VERSION docs-repo/sed/latest
else
rm -rf docs-repo/sed/stable
rm -rf docs-repo/sed/latest
ln -s -r docs-repo/sed/$VERSION docs-repo/sed/stable
ln -s -r docs-repo/sed/$VERSION docs-repo/sed/latest
fi
elif [[ $GITHUB_REF == refs/heads/main ]]; then
rm -rf docs-repo/sed/latest
echo "folder=sed/latest" >> $GITHUB_OUTPUT
Expand Down
30 changes: 19 additions & 11 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: linting
# Triggers the workflow on push for all branches
on:
push:
paths-ignore:
pyproject.toml

env:
UV_SYSTEM_PYTHON: true

jobs:
lint:
Expand All @@ -13,27 +14,34 @@ jobs:
# Check out repo and set up Python
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0

# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
# Setup python
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.8
poetry-version: 1.2.2
python-version: "3.10"

- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install package
run: |
uv pip install ".[dev]"
# Linting steps, execute all linters even if one fails
- name: ruff
run:
poetry run ruff sed tests
ruff src/sed tests
- name: ruff formatting
if: ${{ always() }}
run:
poetry run ruff format --check sed tests
ruff format --check src/sed tests
- name: mypy
if: ${{ always() }}
run:
poetry run mypy sed tests
mypy src/sed tests
- name: spellcheck
if: ${{ always() }}
uses: streetsidesoftware/cspell-action@v6
Expand Down
Loading

0 comments on commit 47b979b

Please sign in to comment.