-
Notifications
You must be signed in to change notification settings - Fork 139
ci: adding mypy support #3940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: adding mypy support #3940
Conversation
…s/pymapdl into maint/annotating-some-files
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Reviewer's GuideThis PR adds mypy support by simplifying and standardizing type annotations across the codebase, removing unsupported typing constructs and type ignores, and updating function signatures and imports to enable static type checking. Class Diagram: Removed TypedDicts in launcher.pyclassDiagram
class args_type {
<<TypedDict (Removed)>>
-force_intel: bool | None
-broadcast: bool | None
-graphics_backend: str | None
-just_launch: bool | None
-on_pool: bool | None
-_debug_no_launch: bool | None
-launch_on_hpc: bool
-ip: str | None
-set_no_abort: bool
-kwargs: Dict[str, Any]
}
class start_parameters_type {
<<TypedDict (Removed)>>
-additional_switches: str | None
-check_parameter_names: bool
-env_vars: dict[str, str]
-exec_file: str | None
-finish_job_on_exit: bool
-hostname: str | None
-ip: str | None
-jobid: int | None
-jobname: str | None
-launch_on_hpc: bool
-launched: bool
-mode: Literal["grpc", "console"]
-nproc: int | bool
-override: bool
-port: int
-print_com: bool
-process: subprocess.Popen[bytes] | None
-ram: str | None
-run_location: str
-start_instance: bool
-start_timeout: int
-timeout: int
}
Class Diagram: Updated MapdlTheme in plotting/theme.pyclassDiagram
class Theme {
<<PyVista Base Class>>
font: Font
axes: Axes
# Other attributes/methods
}
class MapdlTheme {
+__init__()
+font.family: str
+font.size: int
+font.title_size: int
+font.label_size: int
+font.color: str
+axes.x_color: str
+axes.y_color: str
+axes.z_color: str
+cmap: Any
+show_edges: bool
+color: str
+outline_color: str
+edge_color: str
+color_cycler: Cycler
+render_points_as_spheres: bool
}
MapdlTheme --|> Theme : inherits
Class Diagram: Updated CommandOutput in commands.pyclassDiagram
class CommandOutput{
- _cmd: Any # Type hint str | None removed
+ __new__(cls, content: str, cmd: Optional[str])
}
Class Diagram: Updated ComponentListing in commands.pyclassDiagram
class ComponentListing{
# _parsed() np.ndarray # property, return type changed
}
CommandListingOutput <|-- ComponentListing
Class Diagram: Updated Lines in convert.pyclassDiagram
class UserList_str {
<<Old Base Class>>
}
class list {
<<New Base Class>>
}
class Lines{
+ __init__(mute: bool)
+ append(item: Any, mute: bool = True)
# Other list methods implicitly available
}
Lines --|> list
note for Lines "Previously inherited from UserList[str]"
Class Diagram: Updated ScriptTranslator in convert.pyclassDiagram
class ScriptTranslator{
- lines: Lines # Type is now list-based Lines
- _functions: list # Element type unspecified
- macros_names: list # Element type unspecified
- _block_current_cmd: Optional[str] # Type hint simplified
+ format_using_autopep8(text: str) str # signature changed
+ save(filename: str, format_autopep8: bool = True) # signature changed
+ initialize_mapdl_object(loglevel: str, exec_file: str) # signature changed
+ store_command(function: Callable, parameters: List[str]) # signature changed, implies None return
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
@pyansys-ci-bot LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
As the title.
Issue linked
Related to #3480
Checklist
draft
if it is not ready to be reviewed yet.feat: adding new MAPDL command
)Summary by Sourcery
Enable mypy support by overhauling type hints across the codebase and cleaning up type‐ignore directives to satisfy static type checking.
Enhancements:
# type: ignore
comments for improved type safetycmd
argument types and simplifyingsubmitter
andlaunch_*
functions