Skip to content

Commit ef01fd1

Browse files
authored
Merge pull request #1208 from rickecon/pillow
Update uv.lock with pillow 12.3.0 and update .gitignore
2 parents 7ecd125 + f5a4a93 commit ef01fd1

15 files changed

Lines changed: 725 additions & 683 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ ogcore/tests/OUTPUT_REFORM/*
5151
regression/OUTPUT_BASELINE/*
5252
regression/OUTPUT_REFORM*
5353
.vscode/
54+
.claude/
5455
*default.profraw
5556
*un_api_token.txt

‎CHANGELOG.md‎

Lines changed: 25 additions & 104 deletions
Large diffs are not rendered by default.

‎Makefile‎

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,75 +5,70 @@
55
# to work in that environment (and not on Windows).
66
# USAGE: OG-Core$ make [TARGET]
77

8-
.PHONY=help
8+
.PHONY: help
99
help:
1010
@echo "USAGE: make [TARGET]"
1111
@echo "TARGETS:"
1212
@echo "help : show help message"
1313
@echo "clean : remove .pyc files and local ogcore package"
1414
@echo "install : build and install local package"
15-
@echo "pytest : generate report for and cleanup after"
16-
@echo " pytest -W ignore -m ''"
17-
@echo "cstest : generate coding-style errors using the"
18-
@echo " pycodestyle (nee pep8) tool"
15+
@echo "pytest_all : run all tests"
16+
@echo "pytest_ci : run same set of tests as GitHub Actions CI"
1917
@echo "coverage : generate test coverage report"
20-
@echo "git-sync : synchronize local, origin, and upstream Git repos"
21-
@echo "git-pr N=n : create local pr-n branch containing upstream PR"
2218
@echo "documentation : build new Jupyter Book documentation files"
19+
@echo "format : format code using ruff and linecheck"
2320

24-
.PHONY=clean
21+
.PHONY: clean
2522
clean:
26-
@find . -name *pyc -exec rm {} \;
27-
@find . -name *cache -maxdepth 1 -exec rm -r {} \;
28-
@conda uninstall ogcore --yes --quiet 2>&1 > /dev/null
23+
@find . -name '*.pyc' -delete
24+
@find . -maxdepth 1 -name '*cache' -exec rm -r {} +
2925

30-
.PHONY=install
26+
.PHONY: install
3127
install:
32-
pip install -e .[dev]
28+
uv sync --extra dev --extra docs
3329

34-
.PHONY=pytest
35-
pytest:
36-
@cd ogcore ; pytest -W ignore
30+
.PHONY: pytest_all
31+
pytest_all:
32+
uv run python -m pytest
3733

38-
ogcore_JSON_FILES := $(shell ls -l ./ogcore/*json | awk '{print $$9}')
34+
.PHONY: pytest_ci
35+
pytest_ci:
36+
uv run python -m pytest -m "not local and not benchmark"
3937

40-
.PHONY=cstest
41-
cstest:
42-
-pycodestyle ogcore
43-
-pycodestyle --ignore=E501,E121 $(ogcore_JSON_FILES)
38+
ogcore_JSON_FILES := $(shell ls -l ./ogcore/*json | awk '{print $$9}')
4439

4540
define coverage-cleanup
4641
rm -f .coverage htmlcov/*
4742
endef
4843

49-
COVMARK = ""
44+
COVMARK = "not local and not benchmark"
5045

5146
OS := $(shell uname -s)
5247

53-
.PHONY=coverage
48+
.PHONY: coverage
5449
coverage:
5550
@$(coverage-cleanup)
56-
@coverage run -m pytest -v -m $(COVMARK) > /dev/null
57-
@coverage html --ignore-errors
51+
uv run python -m pytest -m $(COVMARK) -n 4 --cov=ogcore --cov-report=html --cov-report=term
5852
ifeq ($(OS), Darwin) # on Mac OS X
5953
@open htmlcov/index.html
6054
else
6155
@echo "Open htmlcov/index.html in browser to view report"
6256
endif
63-
@$(pytest-cleanup)
6457

65-
.PHONY=documentation
58+
.PHONY: documentation
6659
documentation:
67-
uv run python -m ipykernel install --user --name=ogcore-dev
68-
uv run jb clean docs
69-
uv run python ./docs/make_params.py
70-
uv run python ./docs/make_vars.py
71-
uv run jb build ./docs/book
60+
uv run --extra docs python -m ipykernel install --user --name=ogcore-dev
61+
uv run --extra docs jb clean docs
62+
uv run --extra docs python ./docs/make_params.py
63+
uv run --extra docs python ./docs/make_vars.py
64+
uv run --extra docs jb build ./docs/book
7265

66+
.PHONY: format
7367
format:
7468
uv run ruff format .
7569
uv run ruff check . --fix
7670
uv run linecheck . --fix
7771

72+
.PHONY: pip-package
7873
pip-package:
7974
uv build

‎docs/book/_config.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ sphinx:
4949
extra_extensions : ['sphinx.ext.autodoc', 'sphinx.ext.mathjax',
5050
'sphinx.ext.viewcode', 'sphinx.ext.napoleon',
5151
'alabaster'] # A list of extra extensions to load by Sphinx.
52+
local_extensions : # Local extensions, "name: path" (path relative to this file)
53+
suppress_header_warnings : _ext
5254
config : # key-value pairs to directly over-ride the Sphinx configuration
5355
bibtex_reference_style: author_year
5456
mathjax_path : https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""Suppress MyST ``myst.header`` warnings for the auto-generated pages.
2+
3+
``docs/book/content/intro/parameters.md`` and ``variables.md`` are written by
4+
``docs/make_params.py`` and ``docs/make_vars.py``. Both deliberately place the
5+
parameter/variable headings two levels below their section heading (H2 to H4),
6+
which MyST reports as "Non-consecutive header level increase". MyST reads
7+
Sphinx's global ``suppress_warnings`` setting, so silencing ``myst.header``
8+
there would silence it for the whole book. This extension instead drops those
9+
records only when they come from the two generated files.
10+
"""
11+
12+
import logging
13+
import os
14+
15+
TARGETS = (
16+
"content/intro/parameters.md",
17+
"content/intro/variables.md",
18+
)
19+
SUBTYPE = "[myst.header]"
20+
21+
22+
class HeaderWarningFilter(logging.Filter):
23+
"""Drop ``myst.header`` warnings raised by the generated pages."""
24+
25+
def filter(self, record):
26+
if SUBTYPE not in str(record.msg):
27+
return True
28+
location = str(getattr(record, "location", "") or "")
29+
location = location.replace(os.sep, "/")
30+
return not any(target in location for target in TARGETS)
31+
32+
33+
def _add_filter(app):
34+
log_filter = HeaderWarningFilter()
35+
for handler in logging.getLogger("sphinx").handlers:
36+
# Insert ahead of Sphinx's own filters: WarningSuppressor increments
37+
# the build's warning count and WarningIsErrorFilter raises under
38+
# ``-W``, and both run before any filter added with addFilter().
39+
handler.filters.insert(0, log_filter)
40+
41+
42+
def setup(app):
43+
app.connect("builder-inited", _add_filter)
44+
return {
45+
"version": "1.0",
46+
"parallel_read_safe": True,
47+
"parallel_write_safe": True,
48+
}

‎docs/book/_toc.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ parts:
77
- caption: OG-Core API
88
chapters:
99
- file: content/api/public_api
10+
sections:
11+
- file: content/api/aggregates
12+
- file: content/api/config
13+
- file: content/api/demographics
14+
- file: content/api/elliptical_u_est
15+
- file: content/api/execute
16+
- file: content/api/firm
17+
- file: content/api/fiscal
18+
- file: content/api/household
19+
- file: content/api/output_plots
20+
- file: content/api/output_tables
21+
- file: content/api/parameter_plots
22+
- file: content/api/parameter_tables
23+
- file: content/api/parameters
24+
- file: content/api/pensions
25+
- file: content/api/solvers
26+
- file: content/api/SS
27+
- file: content/api/tax
28+
- file: content/api/TPI
29+
- file: content/api/txfunc
30+
- file: content/api/utils
1031
- caption: OG-Core Theory
1132
chapters:
1233
- file: content/theory/intro

‎docs/book/content/api/SS.rst‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. _SS:
2+
3+
Steady-State Functions
4+
=================================================
5+
6+
**SS.py modules**
7+
8+
ogcore.SS
9+
------------------------------------------
10+
11+
.. automodule:: ogcore.SS
12+
:members: euler_equation_solver, solve_for_j, inner_loop, SS_solver,
13+
SS_fsolve, SS_initial_guesses, run_SS

‎docs/book/content/api/TPI.rst‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. _TPI:
2+
3+
Transition Path Functions
4+
=================================================
5+
6+
**TPI.py modules**
7+
8+
ogcore.TPI
9+
------------------------------------------
10+
11+
.. automodule:: ogcore.TPI
12+
:members: get_initial_SS_values, firstdoughnutring, twist_doughnut,
13+
inner_loop, run_TPI

‎docs/book/content/api/config.rst‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. _config:
2+
3+
Logging Configuration
4+
=================================================
5+
6+
**config.py modules**
7+
8+
ogcore.config
9+
------------------------------------------
10+
11+
.. automodule:: ogcore.config
12+
:members: set_logging_level

‎docs/book/content/api/public_api.rst‎

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,4 @@ make up the `OG-Core` model. Below is a list of these modules (in alphabetical
88
order) with documentation about how to call each class method and function.
99
There is also a link to the source code for each documented member.
1010

11-
.. toctree::
12-
:maxdepth: 1
13-
14-
aggregates
15-
config
16-
demographics
17-
elliptical_u_est
18-
execute
19-
firm
20-
fiscal
21-
household
22-
output_plots
23-
output_tables
24-
parameter_plots
25-
parameter_tables
26-
parameters
27-
pensions
28-
solvers
29-
SS
30-
tax
31-
TPI
32-
txfunc
33-
utils
11+
.. tableofcontents::

0 commit comments

Comments
 (0)