Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 13 additions & 70 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,34 @@
# See: https://circleci.com/docs/2.0/language-python/
version: 2.1

version: 2
jobs:

jobs:
build-docs:
working_directory: ~/repo
docker:
- image: cimg/python:3.13

- image: cimg/python:3.13-node
steps:
- checkout

- run:
name: Install Python dependencies
command: |
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install -r site/requirements.txt -r requirements.txt

- restore_cache:
keys:
- cache-data
python -m pip install --upgrade pip tox

- run:
name: Build site
no_output_timeout: 30m
name: Build documentation
no_output_timeout: 60m
environment:
# Ensure this is same as store_artifacts path below
DOCS_PATH: _build/html
command: |
# NOTE: blas multithreading behaves badly on circleci
export BASE_URL="/output/job/$CIRCLE_WORKFLOW_JOB_ID/artifacts/0/$DOCS_PATH"
export OMP_NUM_THREADS=1
source venv/bin/activate
# n = nitpicky (broken links), W = warnings as errors,
# T = full tracebacks, keep-going = run to completion even with errors
make -C site/ SPHINXOPTS="-nWT --keep-going" html

- save_cache:
key: cache-data
paths:
- _data
python -m tox -e py313-buildhtml

- store_artifacts:
path: site/_build/html

- persist_to_workspace:
root: site/_build
paths: html

deploy-docs:
working_directory: ~/repo
docker:
- image: cimg/python:3.13
steps:
- checkout

- attach_workspace:
at: site/_build

- run:
name: install deploy deps
command : |
python3 -m pip install --user ghp-import

- run:
name: configure git
command: |
git config --global user.name "ci-doc-deploy-bot"
git config --global user.email "ci-doc-deploy-bot@nomail"
git config --global push.default simple

- add_ssh_keys:
fingerprints:
5c:54:62:37:75:7f:4d:14:f4:07:82:1c:50:0d:ee:9b

- run:
name: deploy to gh-pages
command: |
ghp-import -n -f -p -m "[skip ci] docs build of $CIRCLE_SHA1" site/_build/html

path: _build/html

workflows:
version: 2
build:
build-and-docs:
jobs:
- build-docs
- deploy-docs:
requires:
- build-docs
filters:
branches:
only: main
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ jobs:
api-token: ${{ secrets.CIRCLE_TOKEN }}
artifact-path: 0/site/_build/html/index.html
circleci-jobs: build-docs
domain: circle.scientific-python.dev
job-title: "--> Rendering Preview <--"
10 changes: 5 additions & 5 deletions content/mooreslaw-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ $B_M=-675.4$

Since the function represents Moore's law, define it as a Python
function using
[`lambda`](https://docs.python.org/3/library/ast.html?highlight=lambda#ast.Lambda)
[`lambda`](https://docs.python.org/3/library/ast.html?highlight=lambda#ast.Lambda):

```{code-cell}
A_M = np.log(2) / 2
Expand Down Expand Up @@ -156,7 +156,7 @@ The extra options below will put the data in the desired format:

* `delimiter = ','`: specify delimeter as a comma ',' (this is the default behavior)
* `usecols = [1,2]`: import the second and third columns from the csv
* `skiprows = 1`: do not use the first row, because its a header row
* `skiprows = 1`: do not use the first row, because it's a header row

```{code-cell}
data = np.loadtxt("transistor_data.csv", delimiter=",", usecols=[1, 2], skiprows=1)
Expand Down Expand Up @@ -282,7 +282,7 @@ In the next plot, use the
[`fivethirtyeight`](https://matplotlib.org/3.1.1/gallery/style_sheets/fivethirtyeight.html)
style sheet.
The style sheet replicates
https://fivethirtyeight.com elements. Change the matplotlib style with
<https://fivethirtyeight.com> elements. Change the matplotlib style with
[`plt.style.use`](https://matplotlib.org/3.3.2/api/style_api.html#matplotlib.style.use).

```{code-cell}
Expand Down Expand Up @@ -334,7 +334,7 @@ option,
to increase the transparency of the data. The more opaque the points
appear, the more reported values lie on that measurement. The green $+$
is the average reported transistor count for 2017. Plot your predictions
for $\pm\frac{1}{2}~years.
for $\pm\frac{1}{2}$ years.

```{code-cell}
transistor_count2017 = transistor_count[year == 2017]
Expand Down Expand Up @@ -386,7 +386,7 @@ array using `np.loadtxt`, to save your model use two approaches
### Zipping the arrays into a file
Using `np.savez`, you can save thousands of arrays and give them names. The
function `np.load` will load the arrays back into the workspace as a
dictionary. You'll save a five arrays so the next user will have the year,
dictionary. You'll save five arrays so the next user will have the year,
transistor count, predicted transistor count, Gordon Moore's
predicted count, and fitting constants. Add one more variable that other users can use to
understand the model, `notes`.
Expand Down
2 changes: 1 addition & 1 deletion content/tutorial-deep-learning-on-mnist.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ layer.)](_static/tutorial-deep-learning-on-mnist.png)

In the beginning of model training, your network randomly initializes the weights and feeds the input data forward through the hidden and output layers. This process is the forward pass or forward propagation.

Then, the network propagates the "signal" from the loss function back through the hidden layer and adjusts the weights values with the help of the learning rate parameter (more on that later).
Then, the network propagates the "signal" from the loss function back through the hidden layer and adjusts the weights with the help of the learning rate parameter (more on that later).

> **Note:** In more technical terms, you:
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ while episode_number < max_episodes:

A few notes:

- If you have previously run an experiment and want to repeat it, your `Monitor` instance may still be running, which may throw an error the next time you try to traini the agent. Therefore, you should first shut down `Monitor` by calling `env.close()` by uncommenting and running the cell below:
- If you have previously run an experiment and want to repeat it, your `Monitor` instance may still be running, which may throw an error the next time you try to train the agent. Therefore, you should first shut down `Monitor` by calling `env.close()` by uncommenting and running the cell below:

```python
# env.close()
Expand Down
Loading
Loading