-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding type annotations to some constructor parameters
1. Add `from __future__ import annotations` as the first line of generated files so that modern Python type annotation syntax can be used in older versions of Python. 1. Add `from typing import Any` and `from numpy.types import NDArray` to all generated files rather than trying to figure out which of these imports are needed on a file-by-file basis. 1. Rename `get_typing_type` in `codegen/datatypes.py` to `get_python_type` to make purpose clearer. 1. Add additional optional parameter to `get_python_type` so that `compound` and `compound_array` types in the schema are converted to `None` rather than causing an exception. 1. Modify `codegen/datatypes.py` to add type annotations to constructor parameters. 1. Modify `codegen/figure.py` to add `bool` type to one figure constructor parameter. FIXME: figure out what type should actually be returned for `compound` and `compound_array`. FIXME: figure out what types to use for other standard parameters of figures generated by `codegen/figure.py`.
- Loading branch information
Showing
1,064 changed files
with
22,600 additions
and
19,407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.