Skip to content

Conversation

@debpal
Copy link
Collaborator

@debpal debpal commented Jun 28, 2025

This pull request introduces support for static type checking with mypy across the pySWATPlus codebase. To modernize and simplify type annotations, I replaced the older style of importing generic types from the typing module—such as List, Dict, and Tuple—with the built-in generic types list, dict, and tuple, as supported in Python 3.9 and later.

While preparing for mypy integration, I identified several common static typing issues in the code that will need to be addressed. These include errors such as 1) "Missing type parameters for generic type 'Pattern'", which occurs when using re.Pattern without specifying a type parameter like re.Pattern[str], 2) "Missing type parameters for generic type 'ndarray'", which appears when numpy.ndarray is used without specifying the expected data types and 3) “Missing type parameters for generic type "Callable"”. These issues have been noted but not yet fixed in this pull request; they will need to be resolved to ensure full compatibility with mypy and achieve clean type-checking results.

@zepholus zepholus merged commit f889967 into swat-model:main Jul 19, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants