-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Rewrite python generation files with comments
During the process of debugging the python wrapping code, several code style conventions were implemented. Primarily in CMake code, set variables were 'unset' as soon as they were no longer needed in order to limit their scope. In python,the monolithic script was made more module, updated to 'black' formatting conventions, added some typehints, and corrected some python code improvement recommendations in order to improve readability and debugging capabilities. Additionally, variables were made to have more local scope, and a limited number of typehints were added to assist with tracing incorrect behavior. - Remove non python wrapping optional code. - Fix python coding recommendations - Remove shadowed variable names, fix undefined escape sequence, use snake_case over CamelCase. - Fix igenerator.py coding recommendations - Remove shadowed variable names, fix undefined escape sequence, use snake_case over CamelCase. - index.txt files belong in pkl_dir - Move setting ITK_STUB_DIR/ITK_PKL_DIR to correct scope. - Conform to python coding style - Changed camel case to snake case. Removed shadowed variables. Make formatting consistent. - Added typehints, and simplified trivial code tests. - These changes will make future changes easier to identify. - Add new input to explicitly allow monitoring and tracking of required biproduct files. - Updated debugging ITK_PYI_INDEX_FILE_SETTING. - Remove SWIG_INTERFACE_MODULE ambiguity. - Minimize scope of of variables in cmake. - Make list of proxy and template imports, and add debugging capabilities - More prepend/append changes. - Decouple CASTXML_INCLUDE, SWIG_INCLUDE from WRAPPER_INCLUDE_FILES - Remove unnecessary unsets - test that WRAPPER_LIBRARY_PYTHON is required in all cases. - Remove checking mandatory WRAPPER_LIBRARY_PYTHON - Prefer string APPEND/PREPEND for ITK_WRAP_PYTHON_SWIG_EXT - Put temporary generated wrapping files in named subdirectories. - This greatly cleans up the directory tree so that it is easier to trace which process generates which files. - Encapsulate test_lib_module_names_different - Remove outdated comments. - The logic for when to add subdirectories for PyUtils and PyBase was unnecessarily complicated now that only Python wrapping is supported. - Adding debugging code for wrapping - The wrapping code contaminates the global namespace. These debugging functions are useful for identifying changed values in macros. - Restructured python type hint generation procedure. A few inter-submodule dependencies were causing a few classes typehints to fail. This commit restructures the generation process to allow for these dependencies. The generation occurs in two stages: 1. pickle files are saved for each class defined for each submodule in igenerator (Some classes are defined multiple times (once for each submodule)) 2. Pickle files are merged and stub files are produced in pyi_generator (This runs once after all runs of igenerator have finished) Currently pyi_generator runs before igenerator, this is a problem. A dependency needs to be added to cause pyi_generator to be ran last. Co-authored-by: Kian Weimer <kianweimer@gmail.com>
- Loading branch information
1 parent
37239fe
commit 9e5d62d
Showing
12 changed files
with
2,535 additions
and
2,012 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
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.