@@ -284,17 +284,16 @@ if(!require(cmdstanr)){
284284}
285285```
286286The following cells download the precompiled CmdStan binaries
287- and register the path to the CmdStan installation:
287+ and registers the path to the CmdStan installation:
288288```
289289# Install CmdStan binaries
290- if (!file.exists("cmdstan-2-22-1 .tgz")) {
291- system("wget https://storage.googleapis. com/cmdstan-2-22-tgz /cmdstan-2-22-1.tgz ", intern=T)
292- system("tar zxf cmdstan-2-22-1.tgz ", intern=T)
290+ if (!file.exists("cmdstan-2.23.0 .tgz")) {
291+ system("wget https://github. com/stan-dev /cmdstan/releases/download/v2.23.0/colab-cmdstan-2.23.0.tar.gz ", intern=T)
292+ system("tar zxf colab- cmdstan-2.23.0.tar.gz ", intern=T)
293293}
294- list.files("cmdstan-2.22.1")
295294
296295# Set cmdstan_path to CmdStan installation
297- set_cmdstan_path("cmdstan-2.22.1 ")
296+ set_cmdstan_path("cmdstan-2.23.0 ")
298297```
299298
300299#### Spinning up a CmdStanPy Notebook
@@ -308,28 +307,20 @@ CmdStanPy is a pure-Python package which can be installed from PyPI:
308307```
309308We can use Python to download and unpack the precompiled CmdStan binaries:
310309```
311- # Download, unpack CmdStan binaries
312- import os
313- import urllib.request
314- import shutil
315- tgz_file = 'cmdstan-2-22-1.tgz'
316- tgz_url = 'https://storage.googleapis.com/cmdstan-2-22-tgz/cmdstan-2-22-1.tgz'
317-
310+ # Install pre-built CmdStan binary
311+ # (faster than compiling from source via install_cmdstan() function)
312+ tgz_file = 'colab-cmdstan-2.23.0.tar.gz'
313+ tgz_url = 'https://github.com/stan-dev/cmdstan/releases/download/v2.23.0/colab-cmdstan-2.23.0.tar.gz'
318314if not os.path.exists(tgz_file):
319- try:
320315 urllib.request.urlretrieve(tgz_url, tgz_file)
321316 shutil.unpack_archive(tgz_file)
322- except Exception:
323- raise KeyboardInterrupt
324317```
325318The following cells check the CmdStan installation and register its location:
326319```
327320# Specify CmdStan location via environment variable
328- import os
329- os.environ['CMDSTAN'] = './cmdstan-2.22.1'
330-
321+ os.environ['CMDSTAN'] = './cmdstan-2.23.0'
331322# Check CmdStan path
332- from cmdstanpy import cmdstan_path
323+ from cmdstanpy import CmdStanModel, cmdstan_path
333324cmdstan_path()
334325```
335326
@@ -457,12 +448,6 @@ An extremely interesting Stan notebook would expand the above to the full Bayesi
457448
458449
459450
460-
461-
462-
463-
464-
465-
466451
467452
468453
0 commit comments