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
6 changes: 3 additions & 3 deletions .github/workflows/asv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest, ubuntu-24.04-arm]

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
fetch-depth: 0

Expand All @@ -70,7 +70,7 @@ jobs:
run: git branch main origin/main

- name: Prepare previous ASV results
uses: actions/checkout@v5
uses: actions/checkout@v6
continue-on-error: true
with:
ref: gh-pages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build-wasm-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Build WASM wheel
uses: pypa/[email protected]
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: prefix-dev/[email protected]
with:
environments: static
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: prefix-dev/[email protected]
with:
environments: >-
Expand All @@ -39,8 +39,8 @@ jobs:
- name: Test with doctest
if: matrix.os == 'ubuntu-latest'
run: |
pixi run -e docs doc
pixi run -e docs doc sphinx-build doctest
pixi run -e docs doc-build
pixi run -e docs doc-build sphinx-build doctest
- name: Test nogil
run: |
pixi run -e nogil nogil-eta
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: prefix-dev/[email protected]
with:
environments: dev
Expand All @@ -31,7 +31,7 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Build wheels
uses: pypa/[email protected]
env:
Expand Down
29 changes: 27 additions & 2 deletions examples/plot_narx_msa.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# where :math:`y` is the output signal and :math:`u` is the input signal, which is
# :math:`u(t) = 2.5\cos(2\pi t)`.
#
# The phase portraits of the Duffing equation are shown below.
# The phase portraits and the vector field of the Duffing equation are shown below.

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -67,10 +67,35 @@ def auto_duffing_equation(y, t):
for i in range(n_init):
sol[i] = odeint(auto_duffing_equation, y0[i], t)

# Phase portraits
for i in range(n_init):
plt.plot(sol[i, :, 0], sol[i, :, 1], c="tab:blue")

plt.title("Phase portraits of Duffing equation")
# Vector field
y_min = np.min(sol[:, :, 0])-0.2
y_max = np.max(sol[:, :, 0])+0.2
dot_y_min = np.min(sol[:, :, 1])-0.2
dot_y_max = np.max(sol[:, :, 1])+0.2
y, dot_y = np.meshgrid(
np.linspace(y_min, y_max, 30), np.linspace(dot_y_min, dot_y_max, 30)
)
ddot_y = auto_duffing_equation([y, dot_y], 0)[1]
plt.streamplot(
y,
dot_y,
dot_y,
ddot_y,
color=(0.5, 0.5, 0.5, 0.3),
density=1.5,
minlength=0.02,
maxlength=0.1,
linewidth=0.5,
arrowsize=0.5,
)

plt.xlim(y_min, y_max)
plt.ylim(dot_y_min, dot_y_max)
plt.title("Phase portraits and vector field of Duffing equation")
plt.xlabel("y(t)")
plt.ylabel("dy/dt(t)")
plt.show()
Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ type = { cmd = "mypy . --ignore-missing-imports", cwd = "fastcan" }
spell = "codespell fastcan"

[feature.docs.tasks]
doc = { cmd = "{{ SPHINXBUILD }} -M {{ CMD }} {{ SOURCEDIR }} {{ BUILDDIR }} {{ SPHINXOPTS }} --fail-on-warning", cwd = "doc", args = [{ arg = "SPHINXBUILD", default = "sphinx-build" }, { arg = "CMD", default = "html" }, { arg = "SOURCEDIR", default = "." }, { arg = "BUILDDIR", default = "_build" }, { arg = "SPHINXOPTS", default = "" }] }
doc-build = { cmd = "{{ SPHINXBUILD }} -M {{ CMD }} {{ SOURCEDIR }} {{ BUILDDIR }} {{ SPHINXOPTS }} --fail-on-warning", cwd = "doc", args = [{ arg = "SPHINXBUILD", default = "sphinx-build" }, { arg = "CMD", default = "html" }, { arg = "SOURCEDIR", default = "." }, { arg = "BUILDDIR", default = "_build" }, { arg = "SPHINXOPTS", default = "" }] }
doc-clean = { cmd = "rm -rf {{ BUILDDIR }} generated auto_examples jupyterlite_contents .jupyterlite.doit.db _contents _output .cache", cwd = "doc", args = [{ arg = "BUILDDIR", default = "_build" }] }
doc-deploy = { cmd = "python -m http.server" , cwd = "doc/_build/html" }
doc-plantuml = { cmd = "plantuml -tsvg {{ SOURCE }} -o {{ OUTPUT }}", cwd = "doc", args = [{ arg = "SOURCE", default = "diagram.puml" }, { arg = "OUTPUT", default = "_build" }] }
Expand Down