From 946bdf18af06a92d2c976a7cc50c509b2d4d3c08 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Wed, 24 Jul 2024 16:18:12 +0100 Subject: [PATCH 1/2] Try `codeflash` --- .github/workflows/codeflash-optimize.yaml | 52 +++++++++++++++++++++++ paper/paper.md | 6 +-- pyproject.toml | 7 +++ 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/codeflash-optimize.yaml diff --git a/.github/workflows/codeflash-optimize.yaml b/.github/workflows/codeflash-optimize.yaml new file mode 100644 index 00000000..9956059c --- /dev/null +++ b/.github/workflows/codeflash-optimize.yaml @@ -0,0 +1,52 @@ +name: Codeflash + +on: + push: + branches: + - main + - renovate/** + pull_request: + +jobs: + optimize: + name: Optimize new code in this PR + runs-on: ubuntu-latest + env: + CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }} + CODEFLASH_PR_NUMBER: ${{ github.event.number }} + steps: + - name: Check if PR is from Codeflash bot + id: bot_check + run: |- + echo "Checking if this PR is created by Codeflash bot..." + if [ "${{ github.event.pull_request.user.login }}" == "codeflash-ai[bot]" ]; then + echo "PR created by Codeflash bot. Skipping optimization." + echo "skip_remaining_steps=yes" >> $GITHUB_OUTPUT + else + echo "skip_remaining_steps=no" >> $GITHUB_OUTPUT + echo "It's not. Proceeding with the optimization." + fi + + - uses: actions/checkout@v4 + if: steps.bot_check.outputs.skip_remaining_steps == 'no' + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + if: steps.bot_check.outputs.skip_remaining_steps == 'no' + uses: actions/setup-python@v5 + with: + cache-dependency-path: pyproject.toml + cache: pip + python-version: 3.12 + + - name: Install Project Dependencies + if: steps.bot_check.outputs.skip_remaining_steps == 'no' + run: >- + python -m pip install -e .; python -m pip install codeflash + + - name: Run Codeflash to optimize code + if: steps.bot_check.outputs.skip_remaining_steps == 'no' + id: optimize_code + run: codeflash diff --git a/paper/paper.md b/paper/paper.md index d56b5838..42475544 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -48,9 +48,9 @@ wavelets are built upon the eigenfunctions of the Slepian concentration problem of the manifold [@Slepian1961; @Landau1961; @Landau1962]: a set of bandlimited functions that are maximally concentrated within a given region. Wavelets are constructed through a tiling of the Slepian harmonic line by leveraging the -existing scale-discretised framework [@Wiaux2008; @Leistedt2013]. Whilst these wavelets -were inspired by spherical datasets, like in cosmology, the wavelet construction -may be utilised for manifold or graph data. +existing scale-discretised framework [@Wiaux2008; @Leistedt2013]. Whilst these +wavelets were inspired by spherical datasets, like in cosmology, the wavelet +construction may be utilised for manifold or graph data. To the author's knowledge, there is no public software that allows one to compute Slepian wavelets (or a similar approach) on the sphere or general diff --git a/pyproject.toml b/pyproject.toml index 78a008d0..149b376d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,6 +98,13 @@ ignore = [ "src/sleplet/_version.py", ] +[tool.codeflash] +ignore-paths = [] +# All paths are relative to this pyproject.toml's directory. +module-root = "src" +test-framework = "pytest" +tests-root = "tests" + [tool.coverage] report = {skip_covered = true, sort = "cover"} run = {branch = true, parallel = true, source = [ From 6d0e579354e563420ff463bcc4f5f0e07a9ad229 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Wed, 24 Jul 2024 16:18:35 +0100 Subject: [PATCH 2/2] Add `workflow_dispatch` --- .github/workflows/codeflash-optimize.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeflash-optimize.yaml b/.github/workflows/codeflash-optimize.yaml index 9956059c..0734a25a 100644 --- a/.github/workflows/codeflash-optimize.yaml +++ b/.github/workflows/codeflash-optimize.yaml @@ -6,6 +6,7 @@ on: - main - renovate/** pull_request: + workflow_dispatch: jobs: optimize: