-
Notifications
You must be signed in to change notification settings - Fork 59
feat: Typing improvements #4761
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
base: main
Are you sure you want to change the base?
Changes from all commits
4f2c990
1ddf8e8
7825ff4
90d69a0
654deb4
ec258c3
00c3a85
b6d2e3e
0a48f90
7b36a1c
c04b413
08e5525
7c2e9c3
0acf4ea
e6a7bf9
2ea0029
f28ce78
316128d
79956f3
4984170
e130f13
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Typing improvements |
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change to star imports makes everything exported as public to to typechecker
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Gobot1234 We can't lose control over the public API.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh sorry if it wasn't clear you don't the modules define a dunder all and that's how public symbols are decided there is no regression in pyfluent's list of publicly available symbols
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @Gobot1234
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Gobot1234 OK, I didn't see that you had added those, and I confirm that I see those now. I can ask @mayankansys to add a test for
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A little on `__all__` if you weren't sure about thatPython has a special symbol This is the result of adding the all to the submodules (it should look basically no different), I have however adjusted some of the imports in pyfluent that aren't meant to be there. >>> dir()
['PS1', 'REPLHooks', '__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'get_last_command', 'is_wsl', 'original_ps1', 'platform', 'sys']
>>> import ansys.fluent.core as pyfluent
>>> dir(pyfluent)
['AboutToInitializeSolutionEventInfo', 'AboutToLoadCaseEventInfo', 'AboutToLoadDataEventInfo', 'BaseSession', 'BatchOps', 'CalculationsEndedEventInfo', 'CalculationsPausedEventInfo', 'CalculationsResumedEventInfo', 'CalculationsStartedEventInfo', 'CaseLoadedEventInfo', 'DataLoadedEventInfo', 'Dimension', 'Event', 'EventsManager', 'FatalErrorEventInfo', 'Fluent', 'FluentDevVersionWarning', 'FluentLinuxGraphicsDriver', 'FluentMode', 'FluentVersion', 'FluentWindowsGraphicsDriver', 'IterationEndedEventInfo', 'LocalParametricStudy', 'Meshing', 'MeshingEvent', 'PathlinesFieldDataRequest', 'PrePost', 'Precision', 'ProgressUpdatedEventInfo', 'PureMeshing', 'PyFluentDeprecationWarning', 'PyFluentUserWarning', 'ReportDefinitionUpdatedEventInfo', 'ReportPlotSetUpdatedEventInfo', 'ResidualPlotUpdatedEventInfo', 'ScalarFieldDataRequest', 'SettingsClearedEventInfo', 'SolutionInitializedEventInfo', 'SolutionPausedEventInfo', 'Solver', 'SolverAero', 'SolverEvent', 'SolverIcing', 'SolverTimeEstimateUpdatedEventInfo', 'SurfaceDataType', 'SurfaceFieldDataRequest', 'TimestepEndedEventInfo', 'TimestepStartedEventInfo', 'UIMode', 'VectorFieldDataRequest', '_README_FILE', '_THIS_DIRNAME', '_TYPE_CHECKING', '_VERSION_INFO', '__builtins__', '__cached__', '__doc__', '__file__', '__getattr__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_config_by_deprecated_name', '_fldoc', '_os', '_pydoc', '_types', '_warnings', 'config', 'create_launcher', 'data_model_cache', 'docker', 'exceptions', 'field_data_interfaces', 'filereader', 'fluent_connection', 'get_build_details', 'get_build_version', 'get_build_version_string', 'get_user_data_dir', 'journaling', 'launch_fluent', 'launcher', 'load_module', 'logger', 'meshing', 'module_config', 'parametric', 'pyfluent_warnings', 'rpvars', 'scheduler', 'search', 'services', 'session', 'session_base_meshing', 'session_meshing', 'session_pure_meshing', 'session_shared', 'session_solver', 'session_solver_aero', 'session_solver_icing', 'session_utilities', 'set_console_logging_level', 'setup_for_fluent', 'solver', 'streaming_services', 'system_coupling', 'utils', 'variable_strategies', 'version_info', 'warning', 'workflow', 'workflow_new']
>>> from ansys.fluent.core import *
>>> dir()
['AboutToInitializeSolutionEventInfo', 'AboutToLoadCaseEventInfo', 'AboutToLoadDataEventInfo', 'BaseSession', 'BatchOps', 'CalculationsEndedEventInfo', 'CalculationsPausedEventInfo', 'CalculationsResumedEventInfo', 'CalculationsStartedEventInfo', 'CaseLoadedEventInfo', 'DataLoadedEventInfo', 'Dimension', 'Event', 'EventsManager', 'FatalErrorEventInfo', 'Fluent', 'FluentDevVersionWarning', 'FluentLinuxGraphicsDriver', 'FluentMode', 'FluentVersion', 'FluentWindowsGraphicsDriver', 'IterationEndedEventInfo', 'LocalParametricStudy', 'Meshing', 'MeshingEvent', 'PS1', 'PathlinesFieldDataRequest', 'PrePost', 'Precision', 'ProgressUpdatedEventInfo', 'PureMeshing', 'PyFluentDeprecationWarning', 'PyFluentUserWarning', 'REPLHooks', 'ReportDefinitionUpdatedEventInfo', 'ReportPlotSetUpdatedEventInfo', 'ResidualPlotUpdatedEventInfo', 'ScalarFieldDataRequest', 'SettingsClearedEventInfo', 'SolutionInitializedEventInfo', 'SolutionPausedEventInfo', 'Solver', 'SolverAero', 'SolverEvent', 'SolverIcing', 'SolverTimeEstimateUpdatedEventInfo', 'SurfaceDataType', 'SurfaceFieldDataRequest', 'TimestepEndedEventInfo', 'TimestepStartedEventInfo', 'UIMode', 'VectorFieldDataRequest', '__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'config', 'create_launcher', 'data_model_cache', 'docker', 'exceptions', 'field_data_interfaces', 'filereader', 'fluent_connection', 'get_build_details', 'get_build_version', 'get_build_version_string', 'get_last_command', 'get_user_data_dir', 'is_wsl', 'journaling', 'launch_fluent', 'launcher', 'load_module', 'logger', 'meshing', 'module_config', 'original_ps1', 'parametric', 'platform', 'pyfluent', 'pyfluent_warnings', 'rpvars', 'scheduler', 'search', 'services', 'session', 'session_base_meshing', 'session_meshing', 'session_pure_meshing', 'session_shared', 'session_solver', 'session_solver_aero', 'session_solver_icing', 'session_utilities', 'set_console_logging_level', 'setup_for_fluent', 'solver', 'streaming_services', 'sys', 'system_coupling', 'utils', 'variable_strategies', 'version_info', 'warning', 'workflow', 'workflow_new'] |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,5 +31,5 @@ | |||||
| import os | ||||||
| from typing import TypeAlias | ||||||
|
|
||||||
| PathType: TypeAlias = "os.PathLike[str] | os.PathLike[bytes] | str | bytes" | ||||||
| PathType: TypeAlias = "os.PathLike[str] | str" | ||||||
|
||||||
| PathType: TypeAlias = "os.PathLike[str] | str" | |
| PathType: TypeAlias = "os.PathLike[str] | os.PathLike[bytes] | str | bytes" |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium