diff --git a/.gitignore b/.gitignore index dafb4a21b..a0ae60f27 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /docs/docs/tutorial/* /docs/docs/examples/* /docs/site/* +/sbi/_version.py # Development files and python cache /*.pyc diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8e503289b..6c89caa02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 \ No newline at end of file + language_version: python3 \ No newline at end of file diff --git a/.vscode/.ropeproject/config.py b/.vscode/.ropeproject/config.py index 0b2a31694..c339bc796 100644 --- a/.vscode/.ropeproject/config.py +++ b/.vscode/.ropeproject/config.py @@ -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): diff --git a/pyproject.toml b/pyproject.toml index 0fe5d9940..1ff9abbd3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = ''' /( @@ -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] diff --git a/sbi/_version.py b/sbi/_version.py deleted file mode 100644 index 2d3e45228..000000000 --- a/sbi/_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# file generated by setuptools_scm -# don't change, don't track in version control -TYPE_CHECKING = False -if TYPE_CHECKING: - from typing import Tuple, Union - VERSION_TUPLE = Tuple[Union[int, str], ...] -else: - VERSION_TUPLE = object - -version: str -__version__: str -__version_tuple__: VERSION_TUPLE -version_tuple: VERSION_TUPLE - -__version__ = version = '0.22.1.dev15+gc1e9977.d20240213' -__version_tuple__ = version_tuple = (0, 22, 1, 'dev15', 'gc1e9977.d20240213') diff --git a/sbi/inference/__init__.py b/sbi/inference/__init__.py index dcece8f7c..8dc9f50d5 100644 --- a/sbi/inference/__init__.py +++ b/sbi/inference/__init__.py @@ -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 diff --git a/sbi/neural_nets/classifier.py b/sbi/neural_nets/classifier.py index 31bb7a8e8..4000f86ff 100644 --- a/sbi/neural_nets/classifier.py +++ b/sbi/neural_nets/classifier.py @@ -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.