Skip to content

Commit

Permalink
Merge branch 'master' of github.com:AllenDowney/ThinkDSP
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenDowney committed Nov 3, 2024
2 parents 4a00ddf + a2c1c8d commit b5d62fc
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/devcontainers/miniconda

# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp

# Install python 3.6
RUN conda install -y python=3.6 \
&& pip install --no-cache-dir pipx \
&& pipx reinstall-all

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/miniconda
{
"name": "Miniconda (Python 3)",
"build": {
"context": "..",
"dockerfile": "Dockerfile"
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "python --version",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
3 changes: 3 additions & 0 deletions .devcontainer/noop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file is copied into the container along with environment.yml* from the
parent folder. This is done to prevent the Dockerfile COPY instruction from
failing if no environment.yml is found.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Here's a notebook that previews what you will see in Chapter 1:

* [chap01preview.ipynb](https://colab.research.google.com/github/AllenDowney/ThinkDSP/blob/master/code/chap01preview.ipynb)

And if you want to see where were headed, here's a preview of Chapter 10:
And if you want to see where we are headed, here's a preview of Chapter 10:

* [chap10preview.ipynb](https://colab.research.google.com/github/AllenDowney/ThinkDSP/blob/master/code/chap10preview.ipynb)

Expand Down
4 changes: 2 additions & 2 deletions book/book.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3294,7 +3294,7 @@ \section{Synthesis}
ts = np.linspace(0, 1, framerate)
ys = synthesize1(amps, fs, ts)
wave = thinkdsp.Wave(ys, framerate)
wave = thinkdsp.Wave(ys, ts, framerate)
\end{verbatim}

This example makes a signal that contains a fundamental frequency at
Expand Down Expand Up @@ -5932,7 +5932,7 @@ \section{Acoustic response}
Here's the gunshot:

\begin{verbatim}
response = thinkdsp.read_wave('180961__kleeb__gunshots.wav')
response = thinkdsp.read_wave('180960__kleeb__gunshots.wav')
response = response.segment(start=0.26, duration=5.0)
response.normalize()
response.plot()
Expand Down

0 comments on commit b5d62fc

Please sign in to comment.