Skip to content

Commit

Permalink
add metadata and project tools
Browse files Browse the repository at this point in the history
  • Loading branch information
vpratz committed May 22, 2024
1 parent 8121c56 commit 216d08d
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
**/__pycache__
*.pdf
*.egg-info
**/.ipynb_checkpoints
*.sif
54 changes: 54 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
############################
# Pre-commit configuration #
############################

# Install via `pip install pre-commit`

# This is run as a precondition to commits, run manually via `pre-commit run`

# When adding new hooks, it may make sense to once run
# `pre-commit run --all-files` as by default only changed files are checked

# Automatically run before every commit via once running `pre-commit install`

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
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
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
description: Check yaml files for parseable syntax
- id: check-added-large-files
description: Prevent large files from being committed
- id: check-merge-conflict
description: Check for files that contain merge conflict strings
- id: check-symlinks
description: Check for symlinks which do not point to anything
- id: trailing-whitespace
description: Trim trailing whitespaces
- id: end-of-file-fixer
description: Fix empty lines at ends of files
- id: detect-private-key
description: Detects the presence of private keys
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,21 @@ The code builds on https://github.com/vislearn/inn_toy_data/.
The benchmark was proposed first in the following paper:

Kruse, J., Ardizzone, L., Rother, C., & Köthe, U. (2021). Benchmarking Invertible Architectures on Inverse Problems (arXiv:2101.10763). arXiv. https://doi.org/10.48550/arXiv.2101.10763

## Development

We manage dependencies in `pyproject.toml` and lock them in `requirements.txt` using `pip-compile` from the [pip-tools suite](https://github.com/jazzband/pip-tools). Automated formatting and checks are achieved using `pre-commit`.

TODO: Insert all installation steps with corresponding commands.

For development:

1. Set up a new Python environment
2. Install dependencies using `pip install -r requirements.txt`
3. Activate pre-commit hooks using `pre-commit install`

For adding a dependency:

1. Add it to `pyproject.toml`
2. Run `pip-compile`
3. Install the updated `requirements.txt` using `pip install -r requirements.txt`
18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[project]
name = "inverse-kinematics-sbi"
version = "0.0.1"
dependencies = [
"numpy",
"scipy",
"matplotlib",
]
description = "Inverse kinematics benchmarks for simulation-based inference"

[tool.black]
line-length = 120
target-version = ["py39", "py310"]

[tool.isort]
profile = "black"
line_length = 120
multi_line_output = 3
34 changes: 34 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile
#
contourpy==1.2.1
# via matplotlib
cycler==0.12.1
# via matplotlib
fonttools==4.51.0
# via matplotlib
kiwisolver==1.4.5
# via matplotlib
matplotlib==3.9.0
# via inverse-kinematics-sbi (pyproject.toml)
numpy==1.26.4
# via
# contourpy
# inverse-kinematics-sbi (pyproject.toml)
# matplotlib
# scipy
packaging==24.0
# via matplotlib
pillow==10.3.0
# via matplotlib
pyparsing==3.1.2
# via matplotlib
python-dateutil==2.9.0.post0
# via matplotlib
scipy==1.13.0
# via inverse-kinematics-sbi (pyproject.toml)
six==1.16.0
# via python-dateutil

0 comments on commit 216d08d

Please sign in to comment.