Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a5975f3

Browse files
authored
First commit of dev container and mkdocs (#92)
* First commit of dev container and mkdocs * Referenced correct env file * Moving to SSH remote * Add pre-commit hooks * Updated gitignore * Starting the docs * Added config for black inside pyproject.toml * Update environment file * WIP working on explaining basic probability distributions * Add networkx for PGM visualization * Starting section on PGMs. * Start of day commit to save state of previous changes * Continued on to likelihoods * Continued writing about likelihoods * Progress made to spaces of models and data * Nearly at the end for introduction piece! * Almost done with simulation nb * Updated notebooks on the basics of probability and simulation * started notebook on inference * More on the fundamentals of probability * Finished probability notebook * Finished up main prose of basic inference notebook * Add starter solutions for Inference notebooks Still left todo: - Place in better prompts - Refactor solutions out into solutions library * Massive commit adding new content - Estimation notebook is done - First pass at hierarchical model is done - Updated TOC - Ice cream shop data is ready :) * Adding further prose to hierarchical notebook Probably snuck in some other changes that I can't remember. * More updates - Shrinkage section - Funnel preview * Updated hierarchical notebook prose * Ignoring auto-generated ice cream shop trace file * Moved model out of notebook into custom source * Added notebooks on reparametrization * Started notebooks on sampling * Updating reparametrization, sampling and adding diagnostics * Restored execution of notebooks * Guaranteed execution of notebooks * Added notebook on dirichlet processes (DP) - CRP (Chinese Restaurant Process) - Stick-breaking process - Generation of Gaussian Mixtures from a DP
1 parent bbf9b95 commit a5975f3

36 files changed

+9478
-54
lines changed

‎.devcontainer/Dockerfile‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#-------------------------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4+
#-------------------------------------------------------------------------------------------------------------
5+
6+
FROM continuumio/miniconda3
7+
8+
# Avoid warnings by switching to noninteractive
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
12+
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
13+
# will be updated to match your local UID/GID (when using the dockerFile property).
14+
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
15+
ARG USERNAME=vscode
16+
ARG USER_UID=1000
17+
ARG USER_GID=$USER_UID
18+
19+
# Copy environment.yml (if found) to a temp locaition so we update the environment. Also
20+
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
21+
COPY binder/environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
22+
23+
# Configure apt and install packages
24+
RUN apt-get update \
25+
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
26+
#
27+
# Verify git, process tools, lsb-release (common in install instructions for CLIs) installed
28+
&& apt-get -y install git openssh-client less iproute2 procps iproute2 lsb-release \
29+
#
30+
# Install pylint
31+
&& /opt/conda/bin/pip install pylint \
32+
#
33+
# Update Python environment based on environment.yml (if present)
34+
&& if [ -f "/tmp/conda-tmp/environment.yml" ]; then /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
35+
&& rm -rf /tmp/conda-tmp \
36+
#
37+
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
38+
&& groupadd --gid $USER_GID $USERNAME \
39+
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
40+
# [Optional] Add sudo support for the non-root user
41+
&& apt-get install -y sudo \
42+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
43+
&& chmod 0440 /etc/sudoers.d/$USERNAME \
44+
#
45+
# Clean up
46+
&& apt-get autoremove -y \
47+
&& apt-get clean -y \
48+
&& rm -rf /var/lib/apt/lists/*
49+
50+
# Switch back to dialog for any ad-hoc use of apt-get
51+
ENV DEBIAN_FRONTEND=dialog

‎.devcontainer/devcontainer.json‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/python-3-miniconda
3+
{
4+
"name": "Python 3 - Miniconda",
5+
"context": "..",
6+
"dockerFile": "Dockerfile",
7+
// Set *default* container specific settings.json values on container create.
8+
"settings": {
9+
"terminal.integrated.shell.linux": "/bin/bash",
10+
"python.pythonPath": "/opt/conda/bin/python",
11+
"python.linting.enabled": true,
12+
"python.linting.pylintEnabled": true,
13+
"python.linting.pylintPath": "/opt/conda/bin/pylint"
14+
},
15+
// Add the IDs of extensions you want installed when the container is created.
16+
"extensions": [
17+
"ms-python.python"
18+
],
19+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20+
"forwardPorts": [
21+
5959,
22+
8000,
23+
8888,
24+
8889,
25+
8890,
26+
8891,
27+
],
28+
// Use 'postCreateCommand' to run commands after the container is created.
29+
// "postCreateCommand": "python --version",
30+
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
31+
// "remoteUser": "vscode"
32+
}

‎.devcontainer/noop.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This file is copied into the container along with environment.yml* from the
2+
parent folder. This is done to prevent the Dockerfile COPY instruction from
3+
failing if no environment.yml is found.

‎.gitignore‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Custom
2-
docs/*
3-
41
# Byte-compiled / optimized / DLL files
52
__pycache__/
63
*.py[cod]
@@ -102,3 +99,7 @@ ENV/
10299

103100
# mypy
104101
.mypy_cache/
102+
103+
# Custom
104+
*.md.tmp
105+
.vscode/*

‎.pre-commit-config.yaml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v2.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- repo: https://github.com/kynan/nbstripout
12+
rev: master
13+
hooks:
14+
- id: nbstripout
15+
files: ".ipynb"
16+
- repo: https://github.com/psf/black
17+
rev: stable
18+
hooks:
19+
- id: black

‎README.md‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ In your terminal, use `git` to clone the repository locally.
3232
git clone https://github.com/ericmjl/bayesian-stats-modelling-tutorial
3333
```
3434

35-
Alternatively, you can download the zip file of the repository at the top of the main page of the repository.
35+
Alternatively, you can download the zip file of the repository at the top of the main page of the repository.
3636
If you prefer not to use git or don't have experience with it, this a good option.
3737

3838
## 2. Download Anaconda (if you haven't already)
3939

40-
If you do not already have the [Anaconda distribution](https://www.anaconda.com/download/) of Python 3,
41-
go get it
42-
(note: you can also set up your project environment w/out Anaconda using `pip` to install the required packages;
40+
If you do not already have the [Anaconda distribution](https://www.anaconda.com/download/) of Python 3,
41+
go get it
42+
(note: you can also set up your project environment w/out Anaconda using `pip` to install the required packages;
4343
however Anaconda is great for Data Science and we encourage you to use it).
4444

4545
## 3. Set up your environment
4646

4747
### 3a. `conda` users
4848

49-
If this is the first time you're setting up your compute environment,
50-
use the `conda` package manager
51-
to **install all the necessary packages**
49+
If this is the first time you're setting up your compute environment,
50+
use the `conda` package manager
51+
to **install all the necessary packages**
5252
from the provided `environment.yml` file.
5353

5454
```bash
@@ -75,7 +75,7 @@ conda env update -f binder/environment.yml
7575

7676
### 3b. `pip` users
7777

78-
Please install all of the packages listed in the `environment.yml` file manually.
78+
Please install all of the packages listed in the `environment.yml` file manually.
7979
An example command would be:
8080

8181
```bash
@@ -99,18 +99,18 @@ You can change the `--display-name` to anything you want, though if you leave it
9999

100100
2. In the terminal, execute `jupyter notebook`.
101101

102-
Navigate to the notebooks directory
102+
Navigate to the notebooks directory
103103
and open the notebook `01-Student-Probability_a_simulated_introduction.ipynb`.
104104

105105
### 4b. Open your Jupyter notebook in Jupyter Lab!
106106

107107

108108
In the terminal, execute `jupyter lab`.
109109

110-
Navigate to the notebooks directory
110+
Navigate to the notebooks directory
111111
and open the notebook `01-Student-Probability_a_simulated_introduction.ipynb`.
112112

113-
Now, if you're using Jupyter lab, for Notebook 2, you'll need to get ipywidgets working.
113+
Now, if you're using Jupyter lab, for Notebook 2, you'll need to get ipywidgets working.
114114
The documentation is [here](https://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension).
115115

116116
In short, you'll need node installed & you'll need to run the following in your terminal:
@@ -123,7 +123,7 @@ Launch Binder using the button at the top of this README.md. Voila!
123123

124124
### 4d. Want to view static HTML notebooks
125125

126-
If you're interested in only viewing the static HTML versions of the notebooks,
126+
If you're interested in only viewing the static HTML versions of the notebooks,
127127
the links are provided below:
128128

129129
Part 1: Bayesian Data Science by Simulation
@@ -143,19 +143,19 @@ Part 2: Bayesian Data Science by Probabilistic Programming
143143

144144
# Acknowledgements
145145

146-
Development of this type of material is almost always a result of years of discussions between members of a community.
147-
We'd like to thank the community and to mention several people who have played pivotal roles in our understanding the the material:
148-
Michael Betancourt,
149-
Justin Bois,
150-
Allen Downey,
151-
Chris Fonnesbeck,
152-
Jake VanderPlas.
146+
Development of this type of material is almost always a result of years of discussions between members of a community.
147+
We'd like to thank the community and to mention several people who have played pivotal roles in our understanding the the material:
148+
Michael Betancourt,
149+
Justin Bois,
150+
Allen Downey,
151+
Chris Fonnesbeck,
152+
Jake VanderPlas.
153153
Also, Andrew Gelman rocks!
154154

155155

156156
# Feedback
157157

158-
Please leave feedback for us [here](https://ericma1.typeform.com/to/j88n8P)!
158+
Please leave feedback for us [here](https://ericma1.typeform.com/to/j88n8P)!
159159
We'll use this information to help improve the teaching and delivery of the material.
160160

161161
# data credits

‎binder/environment.yml‎

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,41 @@ channels:
66
- ericmjl
77
dependencies:
88
- python=3.7
9-
- jupyter=1.0.0
10-
- pymc3=3.7
11-
- pip=19.2.3
12-
- seaborn=0.9.0
13-
- matplotlib=3.1.1
14-
- numpy=1.16.4
15-
- scipy=1.3.1
16-
- pandas=0.25.1
17-
- jupyterlab=1.0.9
18-
- tqdm=4.35.0
19-
- missingno=0.4.2
20-
- scikit-learn=0.21.3
21-
- cython=0.29.13
22-
- nodejs=12.8.1
23-
- pyjanitor=0.18.1
24-
- xarray=0.12.3
25-
- pandoc=2.7.3
26-
- black=19.3b0
27-
- nbstripout=0.3.6
28-
- pylint=2.3.1
29-
- arviz=0.4.1
30-
- theano=1.0.4
31-
- ipykernel=5.1.2
32-
- hvplot=0.4.0
33-
- bokeh=1.3.4
34-
- holoviews=1.12.5
35-
- mkl=2019.4
36-
- mkl-service=2.2.0
9+
- jupyter
10+
- jupyterlab
11+
- pymc3
12+
- pip
13+
- seaborn
14+
- matplotlib
15+
- numpy
16+
- scipy
17+
- pandas
18+
- tqdm
19+
- missingno
20+
- scikit-learn
21+
- nodejs
22+
- pyjanitor
23+
- xarray
24+
- pandoc
25+
- black
26+
- nbstripout
27+
- pylint
28+
- arviz
29+
- theano
30+
- ipykernel
31+
- hvplot
32+
- bokeh
33+
- holoviews
34+
- mkl
35+
- mkl-service
36+
- pre-commit
37+
- networkx
38+
- mamba
39+
- pyprojroot
40+
- faker
41+
- pip:
42+
- mkdocs
43+
- mkdocs-material
44+
- mknotebooks
45+
- daft
46+
# Need to add pip install from github for repo, so solutions can be executed.

‎data/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ice_cream_shop_hierarchical_posterior.nc

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /