Skip to content

Commit

Permalink
Merge pull request #159 from stefanradev93/streamlined-backend
Browse files Browse the repository at this point in the history
Keras 3: Streamlined Backend
  • Loading branch information
stefanradev93 authored Sep 17, 2024
2 parents bbbbc95 + fbda19c commit 5fc0085
Show file tree
Hide file tree
Showing 238 changed files with 11,104 additions and 16,423 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs.yml → .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# From https://github.com/eeholmes/readthedoc-test/blob/main/.github/workflows/docs_pages.yml
name: docs

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: Publish to PyPI.org
on:
release:
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

name: Tests

on:
pull_request:
push:
branches:
- master
- dev
- streamlined-backend


jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yaml
python-version: "3.10"

- name: Show Environment Info
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Run Linter
run: |
ruff check --config pyproject.toml
- name: Run Formatter
run: |
ruff format --check --config pyproject.toml
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11"]
backend: ["jax", "tensorflow", "torch"]
defaults:
run:
shell: bash -el {0}
env:
KERAS_BACKEND: ${{ matrix.backend }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yaml
python-version: ${{ matrix.python-version }}

- name: Install JAX
if: ${{ matrix.backend == 'jax' }}
run: |
pip install -U "jax[cpu]"
- name: Install NumPy
if: ${{ matrix.backend == 'numpy' }}
run: |
conda install numpy
- name: Install Tensorflow
if: ${{ matrix.backend == 'tensorflow' }}
run: |
pip install -U tensorflow
- name: Install PyTorch
if: ${{ matrix.backend == 'torch' }}
run: |
conda install pytorch torchvision torchaudio cpuonly -c pytorch
- name: Show Environment Info
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Run Tests
run: |
pytest
- name: Create Coverage Report
run: |
coverage xml
- name: Upload Coverage Reports to CodeCov
uses: codecov/codecov-action@v4
with:
# do not use the files attribute here, otherwise the reports are not merged correctly
token: ${{ secrets.CODECOV_TOKEN }}
31 changes: 0 additions & 31 deletions .github/workflows/tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ docs/
.tox

# MacOS
.DS_Store
.DS_Store
37 changes: 15 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,25 @@
# Automatically run before every commit via once running `pre-commit install`

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.9
hooks:
- id: black
description: The uncompromising code formatter
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.3
hooks:
- id: nbqa-black
- id: nbqa-pyupgrade
args: [--py36-plus]
- id: nbqa-isort
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
#- repo: https://github.com/nbQA-dev/nbQA
# rev: 1.6.3
# hooks:
# # Run ruff for jupyter notebooks.
# - id: nbqa-ruff
# args: [--ignore=E402] # E402: module level import not at top of file
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
# A bunch of other pre-defined hooks.
- id: check-yaml
description: Check yaml files for parseable syntax
- id: check-added-large-files
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ preferred-citation:
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.05702"
volume: 8
title: "BayesFlow: Amortized Bayesian Workflows With Neural Networks"
title: "BayesFlow: Amortized Bayesian Workflows With Neural Networks"
90 changes: 0 additions & 90 deletions CONTRIBUTING

This file was deleted.

Loading

0 comments on commit 5fc0085

Please sign in to comment.