Skip to content

Commit a4a7f21

Browse files
committed
Reformat with black.
1 parent 34163f9 commit a4a7f21

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

cmdstanpy/model.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,12 @@ def optimize(
727727
)
728728
dummy_chain_id = 0
729729
runset = RunSet(args=args, chains=1, time_fmt=time_fmt)
730-
self._run_cmdstan(runset, dummy_chain_id, show_console=show_console,
731-
timeout=timeout)
730+
self._run_cmdstan(
731+
runset,
732+
dummy_chain_id,
733+
show_console=show_console,
734+
timeout=timeout,
735+
)
732736

733737
if not runset._check_retcodes():
734738
msg = 'Error during optimization: {}'.format(runset.get_err_msgs())
@@ -1508,8 +1512,12 @@ def variational(
15081512

15091513
dummy_chain_id = 0
15101514
runset = RunSet(args=args, chains=1, time_fmt=time_fmt)
1511-
self._run_cmdstan(runset, dummy_chain_id, show_console=show_console,
1512-
timeout=timeout)
1515+
self._run_cmdstan(
1516+
runset,
1517+
dummy_chain_id,
1518+
show_console=show_console,
1519+
timeout=timeout,
1520+
)
15131521

15141522
# treat failure to converge as failure
15151523
transcript_file = runset.stdout_files[dummy_chain_id]
@@ -1546,7 +1554,8 @@ def variational(
15461554
)
15471555
else:
15481556
msg = 'Error during variational inference: {}'.format(
1549-
runset.get_err_msgs())
1557+
runset.get_err_msgs()
1558+
)
15501559
raise RuntimeError(msg)
15511560
# pylint: disable=invalid-name
15521561
vb = CmdStanVB(runset)

test/test_generate_quantities.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,9 @@ def test_timeout(self):
481481
timeout_model = CmdStanModel(stan_file=stan)
482482
fit = timeout_model.sample(data={'loop': 0}, chains=1, iter_sampling=10)
483483
with self.assertRaisesRegex(RuntimeError, 'processing timed out'):
484-
timeout_model.generate_quantities(timeout=0.1, mcmc_sample=fit,
485-
data={'loop': 1})
484+
timeout_model.generate_quantities(
485+
timeout=0.1, mcmc_sample=fit, data={'loop': 1}
486+
)
486487

487488

488489
if __name__ == '__main__':

0 commit comments

Comments
 (0)