Skip to content

Commit 9c51d00

Browse files
authored
Fix mypy errors in docs/source/conf and tests/interface/test-utilities (#617)
Fix mypy errors in docs/source/conf and tests/interface/test-utilities Fix mypy erros in additional modules. - *Category*: Type hinting - *JIRA issue*: https://jira.ihme.washington.edu/browse/MIC-5742 - *JIRA issue*: https://jira.ihme.washington.edu/browse/MIC-5336 ### Changes and notes <!-- Change description – why, what, anything unexplained by the above. Include guidance to reviewers if changes are complex. --> ### Testing <!-- Details on how code was verified, any unit tests local for the repo, regression testing, etc. At a minimum, this should include an integration test for a framework change. Consider: plots, images, (small) csv file. -->
1 parent f6df1f1 commit 9c51d00

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
**3.3.20 - 04/30/25**
2+
3+
- Type-hinting: Fix mypy errors in docs/source/conf.py
4+
- Type-hinting: Fix mypy errors in tests/interface/test_utilities.py
5+
16
**3.3.19 - 04/29/25**
27

38
- Type-hinting: Fix mypy errors in tests/framework/test_values.py

docs/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
base_dir = Path(vivarium.__file__).parent
2323

24-
about = {}
24+
about: dict[str, str] = {}
2525
with (base_dir / "__about__.py").open() as f:
2626
exec(f.read(), about)
2727

@@ -88,7 +88,7 @@
8888
# List of patterns, relative to source directory, that match files and
8989
# directories to ignore when looking for source files.
9090
# This patterns also effect to html_static_path and html_extra_path
91-
exclude_patterns = []
91+
exclude_patterns: list[str] = []
9292

9393
# The name of the Pygments (syntax highlighting) style to use.
9494
pygments_style = "sphinx"
@@ -137,7 +137,7 @@
137137

138138
# -- Options for LaTeX output ---------------------------------------------
139139

140-
latex_elements = {
140+
latex_elements: dict[str, str] = {
141141
# The paper size ('letterpaper' or 'a4paper').
142142
#
143143
# 'papersize': 'letterpaper',

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ exclude = [
3030
'build',
3131
# Files below here should have their errors fixed and then be removed from this list
3232
# You will need to remove the mypy: ignore-errors comment from the file heading as well
33-
'docs/source/conf.py',
3433
'setup.py',
3534
'src/vivarium/examples/disease_model/disease.py',
3635
'src/vivarium/examples/disease_model/intervention.py',
@@ -41,7 +40,6 @@ exclude = [
4140
'src/vivarium/testing_utilities.py',
4241
'tests/framework/results/test_context.py',
4342
'tests/framework/test_event.py',
44-
'tests/interface/test_utilities.py',
4543
]
4644

4745
disable_error_code = []

tests/interface/test_utilities.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
)
2828

2929

30-
def _write_file(path: Path, contents: str):
30+
def _write_file(path: Path, contents: str) -> None:
3131
with open(path, "w") as file:
3232
file.write(contents)
3333

@@ -59,12 +59,12 @@ def _write_file(path: Path, contents: str):
5959
],
6060
)
6161
def test_get_output_model_name_string(
62-
artifact_path,
63-
model_spec_filename,
64-
contents,
65-
expected_output,
66-
tmp_path,
67-
):
62+
artifact_path: Path,
63+
model_spec_filename: str,
64+
contents: str,
65+
expected_output: str,
66+
tmp_path: Path,
67+
) -> None:
6868
model_spec_path = Path(f"{tmp_path}/{model_spec_filename}")
6969
_write_file(model_spec_path, contents)
7070

0 commit comments

Comments
 (0)