Skip to content

Commit

Permalink
fix pre-commit and apply black and isort.
Browse files Browse the repository at this point in the history
  • Loading branch information
janfb committed Feb 14, 2024
1 parent 609e0dd commit cb84bd7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 47 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/docs/docs/tutorial/*
/docs/docs/examples/*
/docs/site/*
/sbi/_version.py

# Development files and python cache
/*.pyc
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 23.3.0
rev: 24.2.0
hooks:
- id: black
language_version: python3.8
language_version: python3
6 changes: 3 additions & 3 deletions .vscode/.ropeproject/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ def set_prefs(prefs):
# listed in module rope.base.oi.type_hinting.providers.interfaces
# For example, you can add you own providers for Django Models, or disable
# the search type-hinting in a class hierarchy, etc.
prefs[
"type_hinting_factory"
] = "rope.base.oi.type_hinting.factory.default_type_hinting_factory"
prefs["type_hinting_factory"] = (
"rope.base.oi.type_hinting.factory.default_type_hinting_factory"
)


def project_opened(project):
Expand Down
21 changes: 2 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ tracker = "https://github.com/sbi-dev/sbi/issues"

[tool.black]
line-length = 88
target-version = ['py37', 'py38', 'py39', 'py310', 'py311', 'py312']
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
include = '\.pyi?$|\.ipynb$'
extend-exclude = '''
/(
Expand All @@ -92,24 +92,7 @@ include_trailing_comma = true
use_parentheses = true
skip_glob = [".ipynb_checkpoints", "docs/*"]
known_first_party=["sbi", "tests", "examples", "tutorials"]
known_third_party = [
"arviz",
"joblib",
"matplotlib",
"numpy",
"pyknos",
"pyro",
"pytest",
"scipy",
"setuptools",
"six",
"sklearn",
"tensorboard",
"torch",
"torchtestcase",
"tqdm",
"typing_extensions",
]
known_third_party = ["arviz", "joblib", "matplotlib", "numpy", "pyknos", "pyro", "pytest", "scipy", "six", "sklearn", "tensorboard", "torch", "torchtestcase", "tqdm", "typing_extensions"]
multi_line_output = 3

[tool.flake8]
Expand Down
16 changes: 0 additions & 16 deletions sbi/_version.py

This file was deleted.

8 changes: 2 additions & 6 deletions sbi/inference/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@

from sbi.inference.abc.mcabc import MCABC
from sbi.inference.abc.smcabc import SMCABC
from sbi.inference.base import ( # noqa: F401
NeuralInference,
check_if_proposal_has_default_x,
infer,
simulate_for_sbi,
)
from sbi.inference.base import NeuralInference # noqa: F401
from sbi.inference.base import check_if_proposal_has_default_x, infer, simulate_for_sbi
from sbi.inference.snle.mnle import MNLE
from sbi.inference.snle.snle_a import SNLE_A
from sbi.inference.snpe.snpe_a import SNPE_A
Expand Down
2 changes: 1 addition & 1 deletion sbi/neural_nets/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def build_linear_classifier(
z_score_y: Optional[str] = "independent",
embedding_net_x: nn.Module = nn.Identity(),
embedding_net_y: nn.Module = nn.Identity(),
**kwargs
**kwargs,
) -> nn.Module:
"""Builds linear classifier.
Expand Down

0 comments on commit cb84bd7

Please sign in to comment.