Skip to content

fix LogReconstructionCallback for VariationalAutoencoder #503

fix LogReconstructionCallback for VariationalAutoencoder

fix LogReconstructionCallback for VariationalAutoencoder #503

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python --version
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
# manually if/when you want to upgrade Poetry, or if something goes wrong.
- name: Cache poetry
uses: actions/cache@v4.2.0
with:
path: ~/.local
key: poetry-2.0.1-0
- name: Install poetry
uses: snok/install-poetry@v1
with:
version: 2.0.1
virtualenvs-create: true
virtualenvs-in-project: true
- run: poetry --version
- run: poetry run python --version
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock.
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4.2.0
with:
path: .venv
key: pydeps-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
# The `if` statement ensures this only runs on a cache miss.
run: poetry install --no-interaction
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Check code formatting with black
run: poetry run black . --check
- name: Lint with flake8
run: poetry run flake8 . --count --show-source
- name: Test with pytest
run: poetry run python${{ matrix.python-version }} -m pytest