Improve typing for LocalSite and LocalSiteManager.
Review Request #14954 — Created March 23, 2026 and updated
This adds typing throughout
LocalSiteandLocalSiteManager, fleshing
out arguments, return types, field relations, and the Local Site
statistics dictionaries.It also modernizes some of the documentation, which was pretty out of
date, and deprecates some positional arguments.
Unit tests pass.
| Summary | ID |
|---|---|
| 7c754e38934bf786c3f3b129ca7744a96efaa7fd |
| Description | From | Last Updated |
|---|---|---|
|
Preexisting typo: LocalSit -> LocalSite |
|
|
|
ValueError is probably more correct. |
|
|
|
ValueError is probably more correct. |
|
|
|
This string is missing f-prefixes |
|
|
|
This docstring doesn't list any exceptions. If we keep the assert it should have AssertionError, if we change to raise_invalid_type … |
|
|
|
If we want runtime checking that won't be stripped with -O, instead of an assert it might be nice to … |
|
|
|
SyntaxError: expected ':' Column: 48 Error code: E999 |
|
-
-
-
-
-
-
This docstring doesn't list any exceptions. If we keep the assert it should have AssertionError, if we change to raise_invalid_type (see next comment) it should be ValueError
-
If we want runtime checking that won't be stripped with -O, instead of an assert it might be nice to do:
if isinstance(local_site_or_id, self.model): ... elif isinstance(local_site_or_id, int): ... else: raise_invalid_type(...)
- Change Summary:
-
- Switched some
AssertionErrorstoValueErrors. - Fixed a typo in a docstring.
- Added missing f-prefixes for a string.
- Switched some
- Commits:
-
Summary ID 4f5733630086b8f6c66bc8bcb7b426bb2d805e3a e137b84926d5740056cd0f1f89e1723e54f01103 - Diff:
-
Revision 2 (+458 -146)
- Change Summary:
-
Added a mising colon.
- Commits:
-
Summary ID e137b84926d5740056cd0f1f89e1723e54f01103 7c754e38934bf786c3f3b129ca7744a96efaa7fd - Diff:
-
Revision 3 (+458 -146)