We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
SNPE with NSF fails when sampling with MCMC
This occurs in a very particular setting: `SNPE` inference with `NSF` density estimator and `sample_with_mcmc=True` (no matter which type of MCMC. 

- it works with `sample_with_mcmc=False`, 
- and it works with `SNLE`! 

I tried to chase it down, but no success so far. You can reproduce it locally by running

```
pytest -s tests/linearGaussian_snpe_test.py::test_c2st_snpe_external_data_on_linearGaussian
```

and setting 
https://github.com/mackelab/sbi/blob/6b5ed7be1d7522546b06c39aec1f206a354cc2ef/tests/linearGaussian_snpe_test.py#L286

to `True`. 

This is the error trace:
```python

>       samples = posterior.sample((num_samples,))

tests/linearGaussian_snpe_test.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
sbi/inference/posteriors/direct_posterior.py:336: in sample
    samples = self._sample_posterior_mcmc(
sbi/inference/posteriors/base_posterior.py:333: in _sample_posterior_mcmc
    samples = self._slice_np_mcmc(
sbi/inference/posteriors/base_posterior.py:397: in _slice_np_mcmc
    posterior_sampler.gen(int(warmup_steps))
sbi/mcmc/slice_numpy.py:93: in gen
    self._tune_bracket_width(rng)
sbi/mcmc/slice_numpy.py:145: in _tune_bracket_width
    x[i], wi = self._sample_from_conditional(i, x[i], rng)
sbi/mcmc/slice_numpy.py:173: in _sample_from_conditional
    while Li(lx) >= logu and cxi - lx < self.max_width:
sbi/mcmc/slice_numpy.py:162: in <lambda>
    Li = lambda t: self.lp_f(np.concatenate([self.x[:i], [t], self.x[i + 1 :]]))
sbi/inference/posteriors/direct_posterior.py:477: in np_potential
    target_log_prob = self.posterior_nn.log_prob(
.sbi_env/lib/python3.8/site-packages/nflows/distributions/base.py:40: in log_prob
    return self._log_prob(inputs, context)
.sbi_env/lib/python3.8/site-packages/nflows/flows/base.py:39: in _log_prob
    noise, logabsdet = self._transform(inputs, context=embedded_context)
.sbi_env/lib/python3.8/site-packages/torch/nn/modules/module.py:722: in _call_impl
    result = self.forward(*input, **kwargs)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:56: in forward
    return self._cascade(inputs, funcs, context)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:50: in _cascade
    outputs, logabsdet = func(outputs, context)
.sbi_env/lib/python3.8/site-packages/torch/nn/modules/module.py:722: in _call_impl
    result = self.forward(*input, **kwargs)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:56: in forward
    return self._cascade(inputs, funcs, context)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:50: in _cascade
    outputs, logabsdet = func(outputs, context)
.sbi_env/lib/python3.8/site-packages/torch/nn/modules/module.py:722: in _call_impl
    result = self.forward(*input, **kwargs)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:56: in forward
    return self._cascade(inputs, funcs, context)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:50: in _cascade
    outputs, logabsdet = func(outputs, context)
.sbi_env/lib/python3.8/site-packages/torch/nn/modules/module.py:722: in _call_impl
    result = self.forward(*input, **kwargs)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/coupling.py:84: in forward
    transform_split, logabsdet = self._coupling_transform_forward(
.sbi_env/lib/python3.8/site-packages/nflows/transforms/coupling.py:194: in _coupling_transform_forward
    return self._coupling_transform(inputs, transform_params, inverse=False)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/coupling.py:211: in _coupling_transform
    outputs, logabsdet = self._piecewise_cdf(inputs, transform_params, inverse)
.sbi_env/lib/python3.8/site-packages/nflows/transforms/coupling.py:492: in _piecewise_cdf
    return spline_fn(
.sbi_env/lib/python3.8/site-packages/nflows/transforms/splines/rational_quadratic.py:45: in unconstrained_rational_quadratic_spline
    ) = rational_quadratic_spline(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

inputs = tensor([]), unnormalized_widths = tensor([], size=(0, 10)), unnormalized_heights = tensor([], size=(0, 10)), unnormalized_derivatives = tensor([], size=(0, 11))
inverse = False, left = -3.0, right = 3.0, bottom = -3.0, top = 3.0, min_bin_width = 0.001, min_bin_height = 0.001, min_derivative = 0.001

    def rational_quadratic_spline(
        inputs,
        unnormalized_widths,
        unnormalized_heights,
        unnormalized_derivatives,
        inverse=False,
        left=0.0,
        right=1.0,
        bottom=0.0,
        top=1.0,
        min_bin_width=DEFAULT_MIN_BIN_WIDTH,
        min_bin_height=DEFAULT_MIN_BIN_HEIGHT,
        min_derivative=DEFAULT_MIN_DERIVATIVE,
    ):
>       if torch.min(inputs) < left or torch.max(inputs) > right:
E       RuntimeError: operation does not have an identity.

.sbi_env/lib/python3.8/site-packages/nflows/transforms/splines/rational_quadratic.py:77: RuntimeError
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
5 # under the Affero General Public License v3, see <https://www.gnu.org/licenses/>.
6 #
7 # Note: To use the 'upload' functionality of this file, you must:
8 #   $ pipenv install twine --dev
9 
10 import io
11 import os
12 import sys
13 from shutil import rmtree
14 
15 from setuptools import find_packages, setup, Command
16 
17 # Package meta-data.
18 NAME = "sbi"
19 DESCRIPTION = "Simulation-based inference."
20 KEYWORDS = "bayesian parameter inference system_identification simulator PyTorch"
21 URL = "https://github.com/mackelab/sbi"
22 EMAIL = "sbi@mackelab.org"
23 AUTHOR = "Álvaro Tejero-Cantero, Jakob H. Macke, Jan-Matthis Lückmann, Conor M. Durkan, Michael Deistler, Jan Bölts"
24 REQUIRES_PYTHON = ">=3.6.0"
25 
26 REQUIRED = [
27     "joblib",
28     "matplotlib",
29     "numpy",
30     "pillow",
31     "pyknos>=0.12",
32     "pyro-ppl>=1.3.1",
33     "scipy",
34     "tensorboard",
35     "torch>=1.5.1",
36     "tqdm",
37 ]
38 
39 EXTRAS = {
40     "dev": [
41         "autoflake",
42         "black",
43         "deepdiff",
44         "flake8",
45         "isort",
46         "jupyter",
47         "mkdocs",
48         "mkdocs-material",
49         "markdown-include",
50         "mkdocs-redirects",
51         "mkdocstrings",
52         "nbconvert",
53         "pep517",
54         "pytest",
55         "pyyaml",
56         "scikit-learn",
57         "torchtestcase",
58         "twine",
59     ],
60 }
61 
62 here = os.path.abspath(os.path.dirname(__file__))
63 
64 # Import the README and use it as the long-description.
65 try:
66     with io.open(os.path.join(here, "README.md"), encoding="utf-8") as f:
67         long_description = "\n" + f.read()
68 except FileNotFoundError:
69     long_description = DESCRIPTION
70 
71 # Load the package's __version__.py module as a dictionary.
72 about = {}
73 project_slug = NAME.lower().replace("-", "_").replace(" ", "_")
74 with open(os.path.join(here, project_slug, "__version__.py")) as f:
75     exec(f.read(), about)
76 
77 
78 class UploadCommand(Command):
79     """Support setup.py upload."""
80 
81     description = "Build and publish the package."
82     user_options = []
83 
84     @staticmethod
85     def status(s):
86         """Prints things in bold."""
87         print("\033[1m{0}\033[0m".format(s))
88 
89     def initialize_options(self):
90         pass
91 
92     def finalize_options(self):
93         pass
94 
95     def run(self):
96         try:
97             self.status("Removing previous builds…")
98             rmtree(os.path.join(here, "dist"))
99         except OSError:
100             pass
101 
102         self.status("Building Source and Wheel (universal) distribution…")
103         os.system("{0} setup.py sdist bdist_wheel --universal".format(sys.executable))
104 
105         self.status("Uploading the package to PyPI via Twine…")
106         os.system("twine upload dist/*")
107 
108         self.status("Pushing git tags…")
109         os.system("git tag v{0}".format(about["__version__"]))
110         os.system("git push --tags")
111 
112         sys.exit()
113 
114 
115 setup(
116     name=NAME,
117     version=about["__version__"],
118     description=DESCRIPTION,
119     keywords=KEYWORDS,
120     long_description=long_description,
121     long_description_content_type="text/markdown",
122     author=AUTHOR,
123     author_email=EMAIL,
124     python_requires=REQUIRES_PYTHON,
125     url=URL,
126     packages=find_packages(exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
127     install_requires=REQUIRED,
128     extras_require=EXTRAS,
129     include_package_data=True,
130     license="AGPLv3",
131     classifiers=[
132         # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
133         "Development Status :: 3 - Alpha",
134         "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
135         "Intended Audience :: Developers",
136         "Intended Audience :: Education",
137         "Intended Audience :: Science/Research",
138         "Topic :: Adaptive Technologies",
139         "Topic :: Scientific/Engineering",
140         "Topic :: Scientific/Engineering :: Artificial Intelligence",
141         "Topic :: Scientific/Engineering :: Mathematics",
142         "Programming Language :: Python",
143         "Programming Language :: Python :: 3",
144         "Programming Language :: Python :: 3.6",
145         "Programming Language :: Python :: 3.7",
146         "Programming Language :: Python :: 3.8",
147     ],
148     # $ setup.py publish support.
149     cmdclass=dict(upload=UploadCommand),
150 )
151
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@
     "matplotlib",
     "numpy",
     "pillow",
-    "pyknos>=0.12",
+    "pyknos>=0.14",
     "pyro-ppl>=1.3.1",
     "scipy",
     "tensorboard",

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -28,7 +28,7 @@\n     \"matplotlib\",\n     \"numpy\",\n     \"pillow\",\n-    \"pyknos>=0.12\",\n+    \"pyknos>=0.14\",\n     \"pyro-ppl>=1.3.1\",\n     \"scipy\",\n     \"tensorboard\",\n", "issue": "SNPE with NSF fails when sampling with MCMC\nThis occurs in a very particular setting: `SNPE` inference with `NSF` density estimator and `sample_with_mcmc=True` (no matter which type of MCMC. \r\n\r\n- it works with `sample_with_mcmc=False`, \r\n- and it works with `SNLE`! \r\n\r\nI tried to chase it down, but no success so far. You can reproduce it locally by running\r\n\r\n```\r\npytest -s tests/linearGaussian_snpe_test.py::test_c2st_snpe_external_data_on_linearGaussian\r\n```\r\n\r\nand setting \r\nhttps://github.com/mackelab/sbi/blob/6b5ed7be1d7522546b06c39aec1f206a354cc2ef/tests/linearGaussian_snpe_test.py#L286\r\n\r\nto `True`. \r\n\r\nThis is the error trace:\r\n```python\r\n\r\n>       samples = posterior.sample((num_samples,))\r\n\r\ntests/linearGaussian_snpe_test.py:289:\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\nsbi/inference/posteriors/direct_posterior.py:336: in sample\r\n    samples = self._sample_posterior_mcmc(\r\nsbi/inference/posteriors/base_posterior.py:333: in _sample_posterior_mcmc\r\n    samples = self._slice_np_mcmc(\r\nsbi/inference/posteriors/base_posterior.py:397: in _slice_np_mcmc\r\n    posterior_sampler.gen(int(warmup_steps))\r\nsbi/mcmc/slice_numpy.py:93: in gen\r\n    self._tune_bracket_width(rng)\r\nsbi/mcmc/slice_numpy.py:145: in _tune_bracket_width\r\n    x[i], wi = self._sample_from_conditional(i, x[i], rng)\r\nsbi/mcmc/slice_numpy.py:173: in _sample_from_conditional\r\n    while Li(lx) >= logu and cxi - lx < self.max_width:\r\nsbi/mcmc/slice_numpy.py:162: in <lambda>\r\n    Li = lambda t: self.lp_f(np.concatenate([self.x[:i], [t], self.x[i + 1 :]]))\r\nsbi/inference/posteriors/direct_posterior.py:477: in np_potential\r\n    target_log_prob = self.posterior_nn.log_prob(\r\n.sbi_env/lib/python3.8/site-packages/nflows/distributions/base.py:40: in log_prob\r\n    return self._log_prob(inputs, context)\r\n.sbi_env/lib/python3.8/site-packages/nflows/flows/base.py:39: in _log_prob\r\n    noise, logabsdet = self._transform(inputs, context=embedded_context)\r\n.sbi_env/lib/python3.8/site-packages/torch/nn/modules/module.py:722: in _call_impl\r\n    result = self.forward(*input, **kwargs)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:56: in forward\r\n    return self._cascade(inputs, funcs, context)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:50: in _cascade\r\n    outputs, logabsdet = func(outputs, context)\r\n.sbi_env/lib/python3.8/site-packages/torch/nn/modules/module.py:722: in _call_impl\r\n    result = self.forward(*input, **kwargs)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:56: in forward\r\n    return self._cascade(inputs, funcs, context)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:50: in _cascade\r\n    outputs, logabsdet = func(outputs, context)\r\n.sbi_env/lib/python3.8/site-packages/torch/nn/modules/module.py:722: in _call_impl\r\n    result = self.forward(*input, **kwargs)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:56: in forward\r\n    return self._cascade(inputs, funcs, context)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/base.py:50: in _cascade\r\n    outputs, logabsdet = func(outputs, context)\r\n.sbi_env/lib/python3.8/site-packages/torch/nn/modules/module.py:722: in _call_impl\r\n    result = self.forward(*input, **kwargs)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/coupling.py:84: in forward\r\n    transform_split, logabsdet = self._coupling_transform_forward(\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/coupling.py:194: in _coupling_transform_forward\r\n    return self._coupling_transform(inputs, transform_params, inverse=False)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/coupling.py:211: in _coupling_transform\r\n    outputs, logabsdet = self._piecewise_cdf(inputs, transform_params, inverse)\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/coupling.py:492: in _piecewise_cdf\r\n    return spline_fn(\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/splines/rational_quadratic.py:45: in unconstrained_rational_quadratic_spline\r\n    ) = rational_quadratic_spline(\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n\r\ninputs = tensor([]), unnormalized_widths = tensor([], size=(0, 10)), unnormalized_heights = tensor([], size=(0, 10)), unnormalized_derivatives = tensor([], size=(0, 11))\r\ninverse = False, left = -3.0, right = 3.0, bottom = -3.0, top = 3.0, min_bin_width = 0.001, min_bin_height = 0.001, min_derivative = 0.001\r\n\r\n    def rational_quadratic_spline(\r\n        inputs,\r\n        unnormalized_widths,\r\n        unnormalized_heights,\r\n        unnormalized_derivatives,\r\n        inverse=False,\r\n        left=0.0,\r\n        right=1.0,\r\n        bottom=0.0,\r\n        top=1.0,\r\n        min_bin_width=DEFAULT_MIN_BIN_WIDTH,\r\n        min_bin_height=DEFAULT_MIN_BIN_HEIGHT,\r\n        min_derivative=DEFAULT_MIN_DERIVATIVE,\r\n    ):\r\n>       if torch.min(inputs) < left or torch.max(inputs) > right:\r\nE       RuntimeError: operation does not have an identity.\r\n\r\n.sbi_env/lib/python3.8/site-packages/nflows/transforms/splines/rational_quadratic.py:77: RuntimeError\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed\n# under the Affero General Public License v3, see <https://www.gnu.org/licenses/>.\n#\n# Note: To use the 'upload' functionality of this file, you must:\n#   $ pipenv install twine --dev\n\nimport io\nimport os\nimport sys\nfrom shutil import rmtree\n\nfrom setuptools import find_packages, setup, Command\n\n# Package meta-data.\nNAME = \"sbi\"\nDESCRIPTION = \"Simulation-based inference.\"\nKEYWORDS = \"bayesian parameter inference system_identification simulator PyTorch\"\nURL = \"https://github.com/mackelab/sbi\"\nEMAIL = \"sbi@mackelab.org\"\nAUTHOR = \"\u00c1lvaro Tejero-Cantero, Jakob H. Macke, Jan-Matthis L\u00fcckmann, Conor M. Durkan, Michael Deistler, Jan B\u00f6lts\"\nREQUIRES_PYTHON = \">=3.6.0\"\n\nREQUIRED = [\n    \"joblib\",\n    \"matplotlib\",\n    \"numpy\",\n    \"pillow\",\n    \"pyknos>=0.12\",\n    \"pyro-ppl>=1.3.1\",\n    \"scipy\",\n    \"tensorboard\",\n    \"torch>=1.5.1\",\n    \"tqdm\",\n]\n\nEXTRAS = {\n    \"dev\": [\n        \"autoflake\",\n        \"black\",\n        \"deepdiff\",\n        \"flake8\",\n        \"isort\",\n        \"jupyter\",\n        \"mkdocs\",\n        \"mkdocs-material\",\n        \"markdown-include\",\n        \"mkdocs-redirects\",\n        \"mkdocstrings\",\n        \"nbconvert\",\n        \"pep517\",\n        \"pytest\",\n        \"pyyaml\",\n        \"scikit-learn\",\n        \"torchtestcase\",\n        \"twine\",\n    ],\n}\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\n# Import the README and use it as the long-description.\ntry:\n    with io.open(os.path.join(here, \"README.md\"), encoding=\"utf-8\") as f:\n        long_description = \"\\n\" + f.read()\nexcept FileNotFoundError:\n    long_description = DESCRIPTION\n\n# Load the package's __version__.py module as a dictionary.\nabout = {}\nproject_slug = NAME.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\nwith open(os.path.join(here, project_slug, \"__version__.py\")) as f:\n    exec(f.read(), about)\n\n\nclass UploadCommand(Command):\n    \"\"\"Support setup.py upload.\"\"\"\n\n    description = \"Build and publish the package.\"\n    user_options = []\n\n    @staticmethod\n    def status(s):\n        \"\"\"Prints things in bold.\"\"\"\n        print(\"\\033[1m{0}\\033[0m\".format(s))\n\n    def initialize_options(self):\n        pass\n\n    def finalize_options(self):\n        pass\n\n    def run(self):\n        try:\n            self.status(\"Removing previous builds\u2026\")\n            rmtree(os.path.join(here, \"dist\"))\n        except OSError:\n            pass\n\n        self.status(\"Building Source and Wheel (universal) distribution\u2026\")\n        os.system(\"{0} setup.py sdist bdist_wheel --universal\".format(sys.executable))\n\n        self.status(\"Uploading the package to PyPI via Twine\u2026\")\n        os.system(\"twine upload dist/*\")\n\n        self.status(\"Pushing git tags\u2026\")\n        os.system(\"git tag v{0}\".format(about[\"__version__\"]))\n        os.system(\"git push --tags\")\n\n        sys.exit()\n\n\nsetup(\n    name=NAME,\n    version=about[\"__version__\"],\n    description=DESCRIPTION,\n    keywords=KEYWORDS,\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    author=AUTHOR,\n    author_email=EMAIL,\n    python_requires=REQUIRES_PYTHON,\n    url=URL,\n    packages=find_packages(exclude=[\"tests\", \"*.tests\", \"*.tests.*\", \"tests.*\"]),\n    install_requires=REQUIRED,\n    extras_require=EXTRAS,\n    include_package_data=True,\n    license=\"AGPLv3\",\n    classifiers=[\n        # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers\n        \"Development Status :: 3 - Alpha\",\n        \"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Science/Research\",\n        \"Topic :: Adaptive Technologies\",\n        \"Topic :: Scientific/Engineering\",\n        \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n        \"Topic :: Scientific/Engineering :: Mathematics\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n    ],\n    # $ setup.py publish support.\n    cmdclass=dict(upload=UploadCommand),\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed\n# under the Affero General Public License v3, see <https://www.gnu.org/licenses/>.\n#\n# Note: To use the 'upload' functionality of this file, you must:\n#   $ pipenv install twine --dev\n\nimport io\nimport os\nimport sys\nfrom shutil import rmtree\n\nfrom setuptools import find_packages, setup, Command\n\n# Package meta-data.\nNAME = \"sbi\"\nDESCRIPTION = \"Simulation-based inference.\"\nKEYWORDS = \"bayesian parameter inference system_identification simulator PyTorch\"\nURL = \"https://github.com/mackelab/sbi\"\nEMAIL = \"sbi@mackelab.org\"\nAUTHOR = \"\u00c1lvaro Tejero-Cantero, Jakob H. Macke, Jan-Matthis L\u00fcckmann, Conor M. Durkan, Michael Deistler, Jan B\u00f6lts\"\nREQUIRES_PYTHON = \">=3.6.0\"\n\nREQUIRED = [\n    \"joblib\",\n    \"matplotlib\",\n    \"numpy\",\n    \"pillow\",\n    \"pyknos>=0.14\",\n    \"pyro-ppl>=1.3.1\",\n    \"scipy\",\n    \"tensorboard\",\n    \"torch>=1.5.1\",\n    \"tqdm\",\n]\n\nEXTRAS = {\n    \"dev\": [\n        \"autoflake\",\n        \"black\",\n        \"deepdiff\",\n        \"flake8\",\n        \"isort\",\n        \"jupyter\",\n        \"mkdocs\",\n        \"mkdocs-material\",\n        \"markdown-include\",\n        \"mkdocs-redirects\",\n        \"mkdocstrings\",\n        \"nbconvert\",\n        \"pep517\",\n        \"pytest\",\n        \"pyyaml\",\n        \"scikit-learn\",\n        \"torchtestcase\",\n        \"twine\",\n    ],\n}\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\n# Import the README and use it as the long-description.\ntry:\n    with io.open(os.path.join(here, \"README.md\"), encoding=\"utf-8\") as f:\n        long_description = \"\\n\" + f.read()\nexcept FileNotFoundError:\n    long_description = DESCRIPTION\n\n# Load the package's __version__.py module as a dictionary.\nabout = {}\nproject_slug = NAME.lower().replace(\"-\", \"_\").replace(\" \", \"_\")\nwith open(os.path.join(here, project_slug, \"__version__.py\")) as f:\n    exec(f.read(), about)\n\n\nclass UploadCommand(Command):\n    \"\"\"Support setup.py upload.\"\"\"\n\n    description = \"Build and publish the package.\"\n    user_options = []\n\n    @staticmethod\n    def status(s):\n        \"\"\"Prints things in bold.\"\"\"\n        print(\"\\033[1m{0}\\033[0m\".format(s))\n\n    def initialize_options(self):\n        pass\n\n    def finalize_options(self):\n        pass\n\n    def run(self):\n        try:\n            self.status(\"Removing previous builds\u2026\")\n            rmtree(os.path.join(here, \"dist\"))\n        except OSError:\n            pass\n\n        self.status(\"Building Source and Wheel (universal) distribution\u2026\")\n        os.system(\"{0} setup.py sdist bdist_wheel --universal\".format(sys.executable))\n\n        self.status(\"Uploading the package to PyPI via Twine\u2026\")\n        os.system(\"twine upload dist/*\")\n\n        self.status(\"Pushing git tags\u2026\")\n        os.system(\"git tag v{0}\".format(about[\"__version__\"]))\n        os.system(\"git push --tags\")\n\n        sys.exit()\n\n\nsetup(\n    name=NAME,\n    version=about[\"__version__\"],\n    description=DESCRIPTION,\n    keywords=KEYWORDS,\n    long_description=long_description,\n    long_description_content_type=\"text/markdown\",\n    author=AUTHOR,\n    author_email=EMAIL,\n    python_requires=REQUIRES_PYTHON,\n    url=URL,\n    packages=find_packages(exclude=[\"tests\", \"*.tests\", \"*.tests.*\", \"tests.*\"]),\n    install_requires=REQUIRED,\n    extras_require=EXTRAS,\n    include_package_data=True,\n    license=\"AGPLv3\",\n    classifiers=[\n        # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers\n        \"Development Status :: 3 - Alpha\",\n        \"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Science/Research\",\n        \"Topic :: Adaptive Technologies\",\n        \"Topic :: Scientific/Engineering\",\n        \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n        \"Topic :: Scientific/Engineering :: Mathematics\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Programming Language :: Python :: 3.8\",\n    ],\n    # $ setup.py publish support.\n    cmdclass=dict(upload=UploadCommand),\n)\n", "path": "setup.py"}]}