Skip to content
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
23 changes: 11 additions & 12 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Always reference these instructions first and fallback to search or bash command
### Environment Setup (REQUIRED)
- **ALWAYS use conda environment**: `conda env create -f environment.yml`
- Takes 3-5 minutes to complete. NEVER CANCEL. Set timeout to 10+ minutes.
- Creates environment named 'qe' with Python 3.13 and all dependencies
- Creates environment named 'qe' with all project dependencies. Note: environment.yml does not pin a Python version, so conda resolves one automatically. To match CI (3.12/3.13/3.14), either add `- python=3.13` to environment.yml, or run `conda create -n qe python=3.13` followed by `conda env update -n qe -f environment.yml`.
- **Activate environment**: `eval "$(conda shell.bash hook)" && conda activate qe`
- **Development install**: `flit install`
- Installs package in development mode for testing changes
- **Development install**: `flit install --symlink`
- Installs the package in editable mode so source changes are picked up immediately
- Takes < 30 seconds

### Build and Test Workflow
Expand All @@ -21,7 +21,7 @@ Always reference these instructions first and fallback to search or bash command
- Note: Repository has some existing style violations - this is expected
- **Full test suite**: `coverage run -m pytest quantecon`
- Takes 5 minutes 11 seconds. NEVER CANCEL. Set timeout to 15+ minutes.
- Runs 536 tests across all modules
- Runs the full test suite across all modules (~600 tests)
- All tests should pass with 2 warnings (expected)
- **Quick smoke test**: `python -c "import quantecon as qe; print('Version:', qe.__version__)"`
- **Package build**: `flit build`
Expand Down Expand Up @@ -54,12 +54,12 @@ print('DiscreteDP test successful, policy:', result.sigma)
- `game_theory/` - Game theory algorithms and utilities
- `optimize/` - Optimization algorithms
- `random/` - Random number generation utilities
- `tests/` - Main test suite (536 tests total)
- `tests/` - Main test suite

### Configuration Files
- `pyproject.toml` - Main project configuration using flit build system
- `environment.yml` - Conda environment specification with all dependencies
- `.github/workflows/ci.yml` - CI pipeline (tests on Python 3.11, 3.12, 3.13)
- `.github/workflows/ci.yml` - CI pipeline (tests on Python 3.12, 3.13, 3.14)
- `pytest.ini` - Test configuration including slow test markers

### Dependencies
Expand All @@ -86,10 +86,9 @@ Core runtime dependencies (auto-installed in conda env):
### Making Code Changes
1. Ensure conda environment is active: `conda activate qe`
2. Make your changes to files in `quantecon/`
3. Run development install: `flit install`
4. Test imports: `python -c "import quantecon as qe; print('Import OK')"`
5. Run relevant tests: `pytest quantecon/tests/test_[relevant_module].py`
6. Run linting: `flake8 --select F401,F405,E231 quantecon`
3. Test imports: `python -c "import quantecon as qe; print('Import OK')"`
4. Run relevant tests: `pytest quantecon/tests/test_[relevant_module].py`
5. Run linting: `flake8 --select F401,F405,E231 quantecon`

### Adding New Features
1. Add code to appropriate module in `quantecon/`
Expand All @@ -108,7 +107,7 @@ Core runtime dependencies (auto-installed in conda env):

### CI/CD Pipeline
- GitHub Actions runs tests on Windows, Ubuntu, and macOS
- Tests Python 3.11, 3.12, and 3.13
- Tests Python 3.12, 3.13, and 3.14
- Includes flake8 linting and coverage reporting
- Publishing to PyPI is automated on git tags

Expand Down Expand Up @@ -140,7 +139,7 @@ conda env create -f environment.yml
eval "$(conda shell.bash hook)" && conda activate qe

# Development workflow
flit install # Install in development mode
flit install --symlink # Editable install for development
python -c "import quantecon as qe; print(qe.__version__)" # Test import
pytest quantecon/tests/test_[module].py # Test specific module
flake8 --select F401,F405,E231 quantecon # Lint code
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,48 @@ jobs:
file: coverage.lcov
format: lcov

docs:

name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
# mirrors the Read the Docs build (see .readthedocs.yaml)
python-version: "3.14"
- name: Install dependencies
run: |
pip install -r docs/rtd-requirements.txt
pip install .
- name: Check generated sources are up to date
# Read the Docs builds the *committed* .rst files and never runs
# qe_apidoc.py, so regenerating here would pass green while RTD
# served stale pages. Fail if the committed sources have drifted.
working-directory: docs
run: python qe_apidoc.py
- name: Fail on docs/source drift
# Check for modified tracked files AND untracked new files: a
# newly added module makes qe_apidoc.py emit a new .rst, which
# `git diff` alone would miss.
run: |
git diff --exit-code -- docs/source \
|| { echo "::error::docs/source is stale -- run 'cd docs && python qe_apidoc.py' and commit the result"; exit 1; }
untracked=$(git ls-files --others --exclude-standard docs/source)
if [ -n "$untracked" ]; then
echo "::error::qe_apidoc.py generated new uncommitted pages: $untracked -- run 'cd docs && python qe_apidoc.py' and commit the result"
exit 1
fi
- name: Build HTML
working-directory: docs
run: sphinx-build -b html source build/html
- name: Upload built docs
uses: actions/upload-artifact@v4
with:
name: docs-html
path: docs/build/html

publish:

name: Publish to PyPi
Expand Down
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ See [release notes](https://github.com/QuantEcon/QuantEcon.py/releases/tag/v0.11

See [release notes](https://github.com/QuantEcon/QuantEcon.py/releases/tag/v0.11.2)

## Ver 0.11.1 (4th-March-2026)
## Ver 0.11.1 (6th-March-2026)

See [release notes](https://github.com/QuantEcon/QuantEcon.py/releases/tag/v0.11.1)

## Ver 0.11.0
## Ver 0.11.0 (23rd-February-2026)

See [release notes](https://github.com/QuantEcon/QuantEcon.py/releases/tag/v0.11.0)

Expand Down Expand Up @@ -358,5 +358,5 @@ Contributors: [oyamad](https://github.com/oyamad), [QBatista](https://github.com

### Ver. 0.3

1. Removes ``quantecon/models`` subpackage and the collection of code examples. Code has been migrated to the [QuantEcon.applications](https://github.com/QuantEcon/QuantEcon.applications) repository.
2. Adds a utility for fetching notebook dependencies from [QuantEcon.applications](https://github.com/QuantEcon/QuantEcon.applications) to support community contributed notebooks.
1. Removes ``quantecon/models`` subpackage and the collection of code examples. Code has been migrated to the QuantEcon.applications (now removed) repository.
2. Adds a utility for fetching notebook dependencies from QuantEcon.applications (now removed) to support community contributed notebooks.
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A high performance, open source Python code library for economics
results = aiyagari_ddp.solve(method='policy_iteration')
```

[![Build Status](https://github.com/QuantEcon/QuantEcon.py/actions/workflows/ci.yml/badge.svg)](https://github.com/QuantEcon/QuantEcon.py/actions?query=workflow%3Abuild)
[![Build Status](https://github.com/QuantEcon/QuantEcon.py/actions/workflows/ci.yml/badge.svg)](https://github.com/QuantEcon/QuantEcon.py/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/QuantEcon/QuantEcon.py/badge.svg)](https://coveralls.io/r/QuantEcon/QuantEcon.py)
[![Documentation (stable)](https://img.shields.io/badge/docs-stable-blue.svg)](https://quanteconpy.readthedocs.io/en/stable/)
[![Documentation (latest)](https://img.shields.io/badge/docs-latest-blue.svg)](https://quanteconpy.readthedocs.io/en/latest/)
Expand Down Expand Up @@ -42,15 +42,15 @@ You can check the version by running
print(qe.__version__)
```

If your version is below what’s available on [PyPI](https://pypi.python.org/pypi/quantecon/) then it is time to upgrade. This can be done by running
If your version is below what’s available on [PyPI](https://pypi.org/project/quantecon/) then it is time to upgrade. This can be done by running

pip install --upgrade quantecon

## Examples and Sample Code

Many examples of QuantEcon.py in action can be found at [Quantitative Economics](https://lectures.quantecon.org/). See also the
Many examples of QuantEcon.py in action can be found at [Quantitative Economics](https://quantecon.org/lectures/). See also the

* [Documentation](https://quanteconpy.readthedocs.org/en/latest/)
* [Documentation](https://quanteconpy.readthedocs.io/en/latest/)
* [Notebook gallery](https://github.com/QuantEcon/notebook-gallery)

QuantEcon.py is supported financially by the [Alfred P. Sloan Foundation](http://www.sloan.org/) and is part of the [QuantEcon organization](https://quantecon.org).
Expand All @@ -63,10 +63,10 @@ An alternative is to download the sourcecode of the `quantecon` package and in

Once you have downloaded the source files then the package can be installed by running

pip install flit
flit install
cd QuantEcon.py
pip install .

(To learn the basics about setting up Git see [this link](https://help.github.com/articles/set-up-git/).)
(To learn the basics about setting up Git see [this link](https://docs.github.com/en/get-started/git-basics/set-up-git).)

## Citation

Expand All @@ -77,13 +77,14 @@ A BibTeX entry for LaTeX users is
```bibtex
@article{10.21105/joss.05585,
author = {Batista, Quentin and Coleman, Chase and Furusawa, Yuya and Hu, Shu and Lunagariya, Smit and Lyon, Spencer and McKay, Matthew and Oyama, Daisuke and Sargent, Thomas J. and Shi, Zejin and Stachurski, John and Winant, Pablo and Watkins, Natasha and Yang, Ziyue and Zhang, Hengcheng},
doi = {10.5281/zenodo.10345102},
doi = {10.21105/joss.05585},
title = {QuantEcon.py: A community based Python library for quantitative economics},
year = {2024},
journal = {Journal of Open Source Software},
volume = {9},
number = {93},
pages = {5585}
pages = {5585},
url = {https://joss.theoj.org/papers/10.21105/joss.05585}
}
```

Expand Down
4 changes: 4 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ srcclean:
rm -f source/game_theory.rst
rm -rf source/markov
rm -f source/markov.rst
rm -rf source/optimize
rm -f source/optimize.rst
rm -rf source/random
rm -f source/random.rst
rm -rf source/timings
rm -f source/timings.rst
rm -rf source/util
rm -f source/util.rst

Expand Down
33 changes: 5 additions & 28 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,23 @@ This is the main directory for the documentation for the `quantecon` python libr

## Dependencies

The documentation requires a few dependencies beyond those necessary for the quantecon library. These dependencies are (warning, this may be an incomplete list):

* sphinx
* numpydoc
* sphinx_rtd_theme
* mock

You can install these by executing
The documentation requires a few dependencies beyond those necessary for the quantecon library. The full documentation dependency set is listed in `rtd-requirements.txt` (this is what Read the Docs installs, see `.readthedocs.yaml` at the repository root). Install it with:

```
conda install sphinx numpydoc sphinx_rtd_theme mock
pip install -r rtd-requirements.txt
```

## Building the docs

In order to generate the documentation, follow these steps:

1. Install the `quantecon` python library locally. Do to this enter the commands below:
1. Install the `quantecon` python library locally. To do this enter the commands below:
```
cd ..
pip install .
cd docs
```
2. From this directory, execute the local file `qe_apidoc.py` (for an explanation of what the file does, see the module level docstring in the file)
2. (Optional -- `make html` in the next step runs this automatically.) From this directory, execute the local file `qe_apidoc.py` (for an explanation of what the file does, see the module level docstring in the file)
```
python qe_apidoc.py
```
Expand All @@ -37,22 +30,6 @@ make html
```
4. Open the file `build/html/index.html`.

I have added a couple utility commands to the make file:

```
srcclean:
rm -rf source/modules*
rm -rf source/models*
rm -rf source/tools*
rm -f source/index.rst
rm -f source/models.rst
rm -f source/tools.rst

myhtml:
make srcclean
cd .. && pip install . && cd docs
python qe_apidoc.py
make html
```
I have added a couple utility commands to the make file. `make srcclean` deletes the `source/` subdirectories and `.rst` files generated by `qe_apidoc.py`; `make myhtml` chains srcclean + reinstall + apidoc + html, automating steps 1-3 above. See the `srcclean` and `myhtml` targets in `docs/Makefile` for the exact list of paths.

Notice that we can automate steps 1-3 (and make sure we get a clean build) above by simply running `make myhtml`
Loading
Loading