Skip to content

MAINT: upgrade anaconda=2025.06 and python=3.13 #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
auto-update-conda: true
auto-activate-base: true
miniconda-version: 'latest'
python-version: "3.12"
python-version: "3.13"
environment-file: environment.yml
activate-environment: quantecon
- name: Install latex dependencies
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
auto-update-conda: true
auto-activate-base: true
miniconda-version: 'latest'
python-version: "3.12"
python-version: "3.13"
environment-file: environment.yml
activate-environment: quantecon
- name: Install latex dependencies
Expand All @@ -36,13 +36,13 @@ jobs:
- name: Display Pip Versions
shell: bash -l {0}
run: pip list
- name: Download "build" folder (cache)
uses: dawidd6/action-download-artifact@v11
with:
workflow: cache.yml
branch: main
name: build-cache
path: _build
# - name: Download "build" folder (cache)
# uses: dawidd6/action-download-artifact@v11
# with:
# workflow: cache.yml
# branch: main
# name: build-cache
# path: _build
# Build Assets (Download Notebooks and PDF via LaTeX)
- name: Build PDF from LaTeX
shell: bash -l {0}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/execution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
fail-fast: false
matrix:
os: ["macos-latest"]
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
# fail-fast: false
# matrix:
# os: ["windows-latest"]
# python-version: ["3.11"]
# python-version: ["3.13"]
# steps:
# - name: Checkout
# uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
auto-update-conda: true
auto-activate-base: true
miniconda-version: 'latest'
python-version: "3.12"
python-version: "3.13"
environment-file: environment.yml
activate-environment: quantecon
- name: Install latex dependencies
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
_build/
.DS_Store
.DS_Store
.ipynb_checkpoints/
.virtual_documents/
20 changes: 9 additions & 11 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@ name: quantecon
channels:
- default
dependencies:
- python=3.12
- anaconda=2024.10
- python=3.13
- anaconda=2025.06
- pip
- pip:
- jupyter-book==1.0.3
- quantecon-book-theme==0.7.6
- sphinx-tojupyter==0.3.0
- jupyter-book==1.0.4post1
- quantecon-book-theme==0.8.3
- sphinx-tojupyter==0.3.1
- sphinxext-rediraffe==0.2.7
- sphinx-reredirects==0.1.4
- sphinx-exercise==1.0.1
- sphinx-proof==0.2.0
- ghp-import==1.1.0
- sphinxcontrib-youtube==1.3.0 #Version 1.3.0 is required as quantecon-book-theme is only compatible with sphinx<=5
- sphinx-proof==0.2.1
- sphinxcontrib-youtube==1.4.1
- sphinx-togglebutton==0.3.2
# Docker Requirements
- pytz
- sphinx-reredirects==0.1.4


Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def objf(z):
def objf_prime(x):

epsilon = 1e-7
x0 = np.asfarray(x)
x0 = np.asarray(x, dtype=float)
f0 = np.atleast_1d(objf(x0))
jac = np.zeros([len(x0), len(f0)])
dx = np.zeros(len(x0))
Expand Down
50 changes: 23 additions & 27 deletions lectures/match_transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.16.4
jupytext_version: 1.17.2
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand All @@ -13,13 +13,11 @@ kernelspec:

# Composite Sorting

+++

## Overview

Optimal transport theory studies how a marginal probabilty measure can be related to another marginal probability measure in an ideal way.

* here ideal means to minimize some cost criterion.
* here ideal means to minimize some cost criterion.

The output of such a theory is a **coupling** of the two probability measures, i.e., a joint probabilty
measure having those two marginal probability measures.
Expand Down Expand Up @@ -575,9 +573,9 @@ def plot_H_z(self, figsize=(15, 8), range_x_axis=None, scatter=True):
plt.axhline(0, color='black', linewidth=1)

# determine the step points for horizontal lines
step = np.concatenate(([self.support_z.min() - .05 * self.support_z.ptp()],
step = np.concatenate(([self.support_z.min() - .05 * np.ptp(self.support_z)],
self.support_z,
[self.support_z.max() + .05 * self.support_z.ptp()]))
[self.support_z.max() + .05 * np.ptp(self.support_z)]))
height = np.concatenate(([0], H_z, [0]))

# plot the horizontal lines of the step function
Expand Down Expand Up @@ -699,9 +697,9 @@ def plot_layers(self, figsize=(15, 8)):
plt.figure(figsize=figsize)

# Plot H(z)
step = np.concatenate(([self.support_z.min() - .05 * self.support_z.ptp()],
step = np.concatenate(([self.support_z.min() - .05 * np.ptp(self.support_z)],
self.support_z,
[self.support_z.max() + .05 * self.support_z.ptp()]))
[self.support_z.max() + .05 * np.ptp(self.support_z)]))
height = np.concatenate((H_z, [0]))
plt.step(step, height, where='post', color='black', label='CDF', zorder=1)

Expand Down Expand Up @@ -984,7 +982,7 @@ def plot_layer_matching(self, layer, matching_layer):
ax.spines['top'].set_color('none')
ax.spines['right'].set_color('none')
ax.yaxis.set_ticks([])
ax.set_ylim(bottom= -self.support_z.ptp() / 100)
ax.set_ylim(bottom= -np.ptp(self.support_z) / 100)

plt.show()

Expand Down Expand Up @@ -1319,29 +1317,29 @@ def plot_matching(self, matching_off_diag, title, figsize=(15, 15),
ax.spines['top'].set_color('none')
ax.spines['right'].set_color('none')
ax.yaxis.set_ticks([])
ax.set_ylim(- self.X_types.ptp() / 10,
(max_height / 2) + self.X_types.ptp()*.01)
ax.set_ylim(- np.ptp(self.X_types) / 10,
(max_height / 2) + np.ptp(self.X_types)*.01)

# Plot H_z on the main axis if enabled
if plot_H_z:
H_z = np.cumsum(self.q_z)

step = np.concatenate(([self.support_z.min()
- .02 * self.support_z.ptp()],
- .02 * np.ptp(self.support_z)],
self.support_z,
[self.support_z.max()
+ .02 * self.support_z.ptp()]))
+ .02 * np.ptp(self.support_z)]))

H_z = H_z/H_z.ptp() * self.support_z.ptp() /2
H_z = H_z/np.ptp(H_z) * np.ptp(self.support_z) /2
height = np.concatenate(([0], H_z, [0]))

# Plot the compressed H_z on the same main x-axis
ax.step(step, height, color='green', lw=2,
label='$H_z$', where='post')

# Set the y-limit to keep H_z and maximum circle size in the plot
ax.set_ylim(np.min(H_z) - H_z.ptp() *.01,
np.maximum(np.max(H_z), max_height / 2) + H_z.ptp() *.01)
ax.set_ylim(np.min(H_z) - np.ptp(H_z) *.01,
np.maximum(np.max(H_z), max_height / 2) + np.ptp(H_z) *.01)

# Add label and legend for H_z
ax.legend(loc="upper right")
Expand Down Expand Up @@ -1614,7 +1612,7 @@ example_2.plot_matching(matching_NAM, title = 'NAM',

+++ {"user_expressions": []}

### Example 3
### Example 3

+++ {"user_expressions": []}

Expand Down Expand Up @@ -1907,7 +1905,7 @@ def plot_hierarchies(self, subpairs, scatter=True, range_x_axis=None):

if range_x_axis is not None:
ax.set_xlim(range_x_axis)
ax.set_ylim(- self.X_types.ptp() / 10,
ax.set_ylim(- np.ptp(self.X_types) / 10,
(range_x_axis[1] - range_x_axis[0]) / 2 )

# Title and layout settings for the main plot
Expand Down Expand Up @@ -2230,12 +2228,11 @@ We plot the wage standard deviation for the sorted occupations.
---
mystnb:
figure:
caption: "Average wage for each Standard Occupational Classification (SOC) code.
The codes are sorted by average wage on the horizontal axis. In red,
a polynomial of degree 5 is fitted to the data. The size of the marker is
proportional to the number of individuals in the occupation."
caption: Average wage for each Standard Occupational Classification (SOC) code.
The codes are sorted by average wage on the horizontal axis. In red, a polynomial
of degree 5 is fitted to the data. The size of the marker is proportional to
the number of individuals in the occupation.
---

# Scatter plot wage dispersion for each occupation
plt.figure(figsize=(10, 6))

Expand Down Expand Up @@ -2273,11 +2270,10 @@ We also plot the average wages for each occupation (SOC code). Again, occupation
---
mystnb:
figure:
caption: "Average wage for each Standard Occupational Classification (SOC) code.
The codes are sorted by average wage on the horizontal axis. In red,
a polynomial of degree 5 is fitted to the data."
caption: Average wage for each Standard Occupational Classification (SOC) code.
The codes are sorted by average wage on the horizontal axis. In red, a polynomial
of degree 5 is fitted to the data.
---

# Scatter plot average wage for each occupation
plt.figure(figsize=(10, 6))

Expand Down
4 changes: 2 additions & 2 deletions lectures/stationary_densities.md
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,8 @@ In doing so, set $\theta = 0.8$ and $n = 500$.

The next figure shows the result of such a computation

```{figure} /_static/lecture_specific/stationary_densities/solution_statd_ex1.png

```{image} /_static/lecture_specific/stationary_densities/solution_statd_ex1.png
:align: center
```

The additional density (black line) is a [nonparametric kernel density estimate](https://en.wikipedia.org/wiki/Kernel_density_estimation), added to the solution for illustration.
Expand Down
Loading