From 741b333a8f21338fc106fec48f74e862f8dea7a5 Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Tue, 29 Apr 2025 16:43:25 -0400 Subject: [PATCH 1/3] chore: Search for undocumented fields in codebase --- .../search_undocumented_fields.py | 193 ++++++ .../undocumented_fields.txt | 616 ++++++++++++++++++ src/ansys/fluent/core/session_solver.py | 1 + 3 files changed, 810 insertions(+) create mode 100644 devel/undocumented_fields/search_undocumented_fields.py create mode 100644 devel/undocumented_fields/undocumented_fields.txt diff --git a/devel/undocumented_fields/search_undocumented_fields.py b/devel/undocumented_fields/search_undocumented_fields.py new file mode 100644 index 000000000000..44daddcb0317 --- /dev/null +++ b/devel/undocumented_fields/search_undocumented_fields.py @@ -0,0 +1,193 @@ +""" +Search code for undocumented fields in classes. Requires ast_comments module. + +Usage: python search_undocumented_fields.py ../../src +""" + +import os +import sys +from typing import Dict, Set + +import ast_comments as ast + + +class ClassFieldVisitor(ast.NodeVisitor): + """AST visitor that extracts public fields from classes.""" + + def __init__(self): + self.classes = {} + self.current_class = None + + def visit_ClassDef(self, node): + """Visit a class definition and extract field assignments.""" + old_class = self.current_class + self.current_class = node.name + self.classes[node.name] = set() + + # Visit all child nodes + for i, child in enumerate(node.body): + if isinstance(child, ast.Assign): + # Look for assignments in the class body + for target in child.targets: + if isinstance(target, ast.Name): + # Only add public fields (not starting with underscore) + if not target.id.startswith("_"): + has_doc_comment = False + if i > 0 and isinstance(node.body[i - 1], ast.Comment): + comment = node.body[i - 1].value.strip() + print(f"Comment found: {comment}") + if comment.startswith("#:"): + has_doc_comment = True + if not has_doc_comment: + self.classes[node.name].add(target.id) + elif isinstance(child, ast.AnnAssign) and isinstance( + child.target, ast.Name + ): + # Handle annotated assignments (e.g., x: int = 10) + if not child.target.id.startswith("_"): + has_doc_comment = False + if i > 0 and isinstance(node.body[i - 1], ast.Comment): + comment = node.body[i - 1].value.strip() + print(f"Comment found: {comment}") + if comment.startswith("#:"): + has_doc_comment = True + if not has_doc_comment: + self.classes[node.name].add(child.target.id) + + # Visit methods to find instance attribute assignments (self.attr = value) + for child in node.body: + if isinstance(child, ast.FunctionDef): + self.visit(child) + + self.current_class = old_class + + def visit_FunctionDef(self, node): + """Visit method definitions to find instance attributes.""" + if self.current_class is None: + return + + # Check if this is an instance method with 'self' parameter + if node.args.args and node.args.args[0].arg == "self": + results = list(ast.walk(node)) + for i, child in enumerate(results): + # Look for self.attr = value assignments + if isinstance(child, ast.Assign) and any( + isinstance(target, ast.Attribute) + and isinstance(target.value, ast.Name) + and target.value.id == "self" + and not target.attr.startswith("_") + for target in child.targets + ): + for target in child.targets: + if ( + isinstance(target, ast.Attribute) + and isinstance(target.value, ast.Name) + and target.value.id == "self" + ): + has_doc_comment = False + if i > 0 and isinstance(results[i - 1], ast.Comment): + comment = results[i - 1].value.strip() + print(f"Comment found: {comment}") + if comment.startswith("#:"): + has_doc_comment = True + if not has_doc_comment: + self.classes[self.current_class].add(target.attr) + + # Handle annotated assignments: self.attr: Type = value + elif ( + isinstance(child, ast.AnnAssign) + and isinstance(child.target, ast.Attribute) + and isinstance(child.target.value, ast.Name) + and child.target.value.id == "self" + and not child.target.attr.startswith("_") + ): + has_doc_comment = False + if i > 0 and isinstance(results[i - 1], ast.Comment): + comment = results[i - 1].value.strip() + print(f"Comment found: {comment}") + if comment.startswith("#:"): + has_doc_comment = True + if not has_doc_comment: + self.classes[self.current_class].add(child.target.attr) + + +def analyze_file(file_path: str) -> Dict[str, Set[str]]: + """Analyze a Python file and return classes with their public fields.""" + with open(file_path, "r", encoding="utf-8") as file: + try: + tree = ast.parse(file.read(), filename=file_path) + visitor = ClassFieldVisitor() + visitor.visit(tree) + return visitor.classes + except SyntaxError as e: + print(f"Syntax error in {file_path}: {e}", file=sys.stderr) + return {} + + +def analyze_package(package_path: str) -> Dict[str, Dict[str, Set[str]]]: + """Analyze all Python files in a package directory.""" + result = {} + + for root, dirs, files in os.walk(package_path): + # Skip directories named "generated" + if "generated" in dirs: + dirs.remove("generated") + + for file in files: + if file.endswith(".py"): + file_path = os.path.join(root, file) + module_name = os.path.relpath(file_path, package_path).replace( + os.path.sep, "." + ) + module_name = module_name[:-3] # Remove .py extension + + classes = analyze_file(file_path) + if classes: + result[module_name] = classes + + return result + + +def write_results(results: Dict[str, Dict[str, Set[str]]], f) -> str: + """Format the analysis results.""" + for module_name, classes in sorted(results.items()): + + if not classes: + continue + + module_written = False + for class_name, fields in sorted(classes.items()): + if not fields: + continue + + if not module_written: + f.write(f" Module: {module_name}\n") + module_written = True + + f.write(f" Class: {class_name}\n") + + for field in sorted(fields): + f.write(f" - {field}\n") + + if module_written: + f.write("\n") + + +def main(): + """Main function.""" + if len(sys.argv) != 2: + print(f"Usage: {sys.argv[0]} ", file=sys.stderr) + sys.exit(1) + + package_path = sys.argv[1] + if not os.path.isdir(package_path): + print(f"Error: {package_path} is not a directory", file=sys.stderr) + sys.exit(1) + + results = analyze_package(package_path) + with open("undocumented_fields.txt", "w", encoding="utf-8") as f: + write_results(results, f) + + +if __name__ == "__main__": + main() diff --git a/devel/undocumented_fields/undocumented_fields.txt b/devel/undocumented_fields/undocumented_fields.txt new file mode 100644 index 000000000000..d83512f11d27 --- /dev/null +++ b/devel/undocumented_fields/undocumented_fields.txt @@ -0,0 +1,616 @@ + Module: ansys.fluent.core.codegen.__init__ + Class: StaticInfoType + - DATAMODEL_FLICING + - DATAMODEL_MESHING + - DATAMODEL_MESHING_UTILITIES + - DATAMODEL_PART_MANAGEMENT + - DATAMODEL_PM_FILE_MANAGEMENT + - DATAMODEL_PREFERENCES + - DATAMODEL_SOLVER_WORKFLOW + - DATAMODEL_WORKFLOW + - SETTINGS + - TUI_MESHING + - TUI_SOLVER + + Module: ansys.fluent.core.codegen.datamodelgen + Class: DataModelGenerator + - version + Class: DataModelStaticInfo + - file_name + - modes + - rules + - static_info + - static_info_type + - stub_file + + Module: ansys.fluent.core.codegen.tuigen + Class: _TUIMenu + - children + - doc + - is_command + - name + - path + - tui_name + + Module: ansys.fluent.core.data_model_cache + Class: DataModelCache + - rules_str_to_cache + - rules_str_to_config + - use_display_name + Class: NameKey + - DISPLAY + - INTERNAL + Class: _CacheImpl + - name_key + + Module: ansys.fluent.core.field_data_interfaces + Class: PathlinesData + - lines + - particle_time + - pathlines_count + - scalar_field + - scalar_field_name + - vertices + Class: PathlinesFieldDataRequest + - accuracy_control_on + - additional_field_name + - coarsen + - field_name + - node_value + - provide_particle_time_field + - reverse + - skip + - step_size + - steps + - surfaces + - tolerance + - velocity_domain + - zones + Class: ScalarFieldDataRequest + - boundary_value + - field_name + - node_value + - surfaces + Class: SurfaceData + - connectivity + - face_centroids + - face_normals + - vertices + Class: SurfaceDataType + - FacesCentroid + - FacesConnectivity + - FacesNormal + - Vertices + Class: SurfaceFieldDataRequest + - data_types + - overset_mesh + - surfaces + Class: VectorFieldDataRequest + - field_name + - surfaces + + Module: ansys.fluent.core.file_session + Class: FileSession + - field_data + - field_info + - fields + - monitors + - session_id + Class: TransactionFieldData + - data + + Module: ansys.fluent.core.filereader.case_file + Class: InputParameter + - name + - value + Class: InputParameterOld + - name + - value + Class: MeshType + - SURFACE + - UNKNOWN + - VOLUME + Class: OutputParameter + - name + - units + Class: RPVarProcessor + - rp_vars_str + + Module: ansys.fluent.core.filereader.lispy + Class: Env + - outer + Class: InputPort + - file + - line + - tokenizer + + Module: ansys.fluent.core.fluent_connection + Class: FluentConnection + - connection_properties + - finalizer_cbs + - health_check + Class: FluentConnectionProperties + - cortex_host + - cortex_pid + - cortex_pwd + - fluent_host_pid + - inside_container + - ip + - password + - port + Class: MonitorThread + - cbs + Class: _ConnectionInterface + - scheme_eval + + Module: ansys.fluent.core.launcher.container_launcher + Class: DockerLauncher + - file_transfer_service + + Module: ansys.fluent.core.launcher.pim_launcher + Class: PIMLauncher + - file_transfer_service + + Module: ansys.fluent.core.launcher.pyfluent_enums + Class: Dimension + - THREE + - TWO + Class: FluentLinuxGraphicsDriver + - AUTO + - NULL + - OPENGL + - OPENGL2 + - X11 + Class: FluentMode + - MESHING + - PRE_POST + - PURE_MESHING + - SOLVER + - SOLVER_AERO + - SOLVER_ICING + Class: FluentWindowsGraphicsDriver + - AUTO + - DX11 + - MSW + - NULL + - OPENGL + - OPENGL2 + Class: LaunchMode + - CONTAINER + - PIM + - SLURM + - STANDALONE + Class: Precision + - DOUBLE + - SINGLE + Class: UIMode + - GUI + - HIDDEN_GUI + - NO_GRAPHICS + - NO_GUI + - NO_GUI_OR_GRAPHICS + + Module: ansys.fluent.core.launcher.slurm_launcher + Class: SlurmLauncher + - file_transfer_service + + Module: ansys.fluent.core.launcher.standalone_launcher + Class: StandaloneLauncher + - file_transfer_service + + Module: ansys.fluent.core.meshing.meshing_workflow + Class: WorkflowMode + - FAULT_TOLERANT_MESHING_MODE + - TOPOLOGY_BASED_MESHING_MODE + - TWO_DIMENSIONAL_MESHING_MODE + - WATERTIGHT_MESHING_MODE + + Module: ansys.fluent.core.parametric + Class: LocalDesignPoint + - name + Class: LocalParametricStudy + - case_filepath + - design_point_table + + Module: ansys.fluent.core.post_objects.meta + Class: Attribute + - VALID_NAMES + - function + - name + Class: Command + - arguments_attrs + - command_cls + - obj + Class: PyLocalContainer + - type + + Module: ansys.fluent.core.post_objects.post_helper + Class: PostAPIHelper + - field_data + - field_info + - id + - obj + - surface_api + + Module: ansys.fluent.core.post_objects.post_object_definitions + Class: ContourDefn + - PLURAL + Class: MeshDefn + - PLURAL + Class: MonitorDefn + - PLURAL + Class: PathlinesDefn + - PLURAL + Class: SurfaceDefn + - PLURAL + Class: Vector + - x + - y + - z + Class: VectorDefn + - PLURAL + Class: XYPlotDefn + - PLURAL + + Module: ansys.fluent.core.post_objects.post_objects_container + Class: Container + - session + + Module: ansys.fluent.core.services.app_utilities + Class: AppUtilities + - service + Class: AppUtilitiesOld + - scheme_eval + + Module: ansys.fluent.core.services.batch_ops + Class: BatchOps + - batching + + Module: ansys.fluent.core.services.datamodel_se + Class: Attribute + - ALLOWED_VALUES + - ARGUMENTS + - DEFAULT + - DEPRECATED_VERSION + - DISPLAY_TEXT + - ECHO_MODE + - ERROR_STATUS + - EXCLUDED_VALUES + - EXPOSURE_LEVEL + - FORCE_DEFAULT + - INTERNAL_NAMES + - IS_ACTIVE + - IS_READ_ONLY + - IS_TREE_NODE + - MAX + - MAX_LENGTH + - MEMBERS + - MIGRATION + - MIN + - MIN_LENGTH + - NAME + - NAMES + - PATHS + - REFERENCE_PATH + - ROOT_ID + - SHOW_AT_PARENT_NODE + - TOOL_TIP + - USER_ERROR_STATUS + - WIDGET_TYPE + Class: DatamodelService + - cache + - event_streaming + - file_transfer_service + - subscriptions + - version + Class: DatamodelServiceImpl + - file_transfer_service + Class: EventSubscription + - is_subscribed + - path + - tag + Class: PyCommand + - command + - file_behavior + - path + - rules + - service + Class: PyCommandArgumentsSubItem + - getAttribValue + - getState + - setState + Class: PyDictionary + - updateDict + Class: PyMenu + - deleteAllChildObjects + - deleteChildObjects + Class: PyMenuGeneric + - attrs + Class: PyNamedObjectContainer + - getChildObjectDisplayNames + - getState + - path + - rules + - service + Class: PyQuery + - path + - query + - rules + - service + Class: PySimpleMenuGeneric + - attrs + Class: PyStateContainer + - fixState + - getAttribValue + - getState + - setState + + Module: ansys.fluent.core.services.deprecated_field_data + Class: DeprecatedFieldData + - get_pathlines_field_data + - get_scalar_field_data + - get_surface_data + - get_vector_field_data + - is_data_valid + - scheme_eval + + Module: ansys.fluent.core.services.field_data + Class: BaseFieldData + - data + Class: CellElementType + - GHOST + - HEXAHEDRON + - POLYHEDRON + - PYRAMID + - QUADRATIC_HEXAHEDRON + - QUADRATIC_PYRAMID + - QUADRATIC_TETRAHEDRON + - QUADRATIC_WEDGE + - QUADRILATERAL + - TETRAHEDRON + - TRIANGLE + - WEDGE + Class: Element + - element_type + - facets + - node_indices + Class: Facet + - node_indices + Class: LiveFieldData + - get_pathlines_field_data + - get_scalar_field_data + - get_surface_data + - get_vector_field_data + - get_zones_info + - is_data_valid + - scheme_eval + Class: Mesh + - elements + - nodes + Class: Node + - x + - y + - z + Class: Transaction + - add_pathlines_fields_request + - add_scalar_fields_request + - add_surfaces_request + - add_vector_fields_request + Class: ZoneInfo + - name + - zone_type + Class: ZoneType + - CELL + - FACE + Class: _FieldDataConstants + - bytes_stream + - chunk_size + - np_data_type_to_proto_field_type + - payloadTags + - proto_field_type_to_np_data_type + + Module: ansys.fluent.core.services.reduction + Class: Reduction + - ctxt + - service + + Module: ansys.fluent.core.services.scheme_eval + Class: SchemeEval + - service + - version + Class: Symbol + - str + + Module: ansys.fluent.core.services.solution_variables + Class: SolutionVariableData + - get_data + Class: SvarError + - solution_variable_name + Class: ZoneError + - zone_name + + Module: ansys.fluent.core.session + Class: BaseSession + - connection_properties + - events + - field_data + - field_data_old + - field_data_streaming + - field_info + - fields + - health_check + - journal + - rp_vars + - scheme_eval + - transcript + + Module: ansys.fluent.core.session_pure_meshing + Class: PureMeshing + - datamodel_streams + + Module: ansys.fluent.core.solver._docstrings + Class: _DocStringAnalysis + - clean + - dubious + - empty + + Module: ansys.fluent.core.solver.flobject + Class: Action + - argument_names + Class: Base + - fluent_name + Class: Group + - child_names + - command_names + - query_names + Class: ListObject + - command_names + - query_names + Class: NamedObject + - command_names + - query_names + Class: Real + - base_set_state + - set_state + Class: RealList + - base_set_state + - set_state + Class: _Alias + - once + - scheme_eval + Class: _InlineConstants + - allowed_values + - default_value + - file_purpose + - is_active + - is_read_only + - is_stable + - max + - min + - user_creatable + + Module: ansys.fluent.core.solver.settings_builtin_bases + Class: Solver + - settings + Class: _CreatableNamedObjectSetting + - settings_source + Class: _NonCreatableNamedObjectSetting + - settings_source + Class: _SingletonSetting + - settings_source + + Module: ansys.fluent.core.streaming_services.events_streaming + Class: AboutToLoadCaseEventInfo + - case_file_name + Class: AboutToLoadDataEventInfo + - data_file_name + Class: CaseLoadedEventInfo + - case_file_name + Class: DataLoadedEventInfo + - data_file_name + Class: EventInfoBase + - derived_classes + Class: FatalErrorEventInfo + - error_code + - message + Class: IterationEndedEventInfo + - index + Class: MeshingEvent + - ABOUT_TO_LOAD_CASE + - CASE_LOADED + - FATAL_ERROR + - PROGRESS_UPDATED + - SETTINGS_CLEARED + Class: ProgressUpdatedEventInfo + - message + - percentage + Class: ReportDefinitionUpdatedEventInfo + - report_name + Class: ReportPlotSetUpdatedEventInfo + - plot_set_name + Class: SolutionPausedEventInfo + - index + - level + Class: SolverEvent + - ABOUT_TO_INITIALIZE_SOLUTION + - ABOUT_TO_LOAD_CASE + - ABOUT_TO_LOAD_DATA + - CALCULATIONS_ENDED + - CALCULATIONS_PAUSED + - CALCULATIONS_RESUMED + - CALCULATIONS_STARTED + - CASE_LOADED + - DATA_LOADED + - FATAL_ERROR + - ITERATION_ENDED + - PROGRESS_UPDATED + - REPORT_DEFINITION_UPDATED + - REPORT_PLOT_SET_UPDATED + - RESIDUAL_PLOT_UPDATED + - SETTINGS_CLEARED + - SOLUTION_INITIALIZED + - SOLUTION_PAUSED + - SOLVER_TIME_ESTIMATE_UPDATED + - TIMESTEP_ENDED + - TIMESTEP_STARTED + Class: SolverTimeEstimateUpdatedEventInfo + - hours + - minutes + - seconds + Class: TimestepEndedEventInfo + - index + - size + Class: TimestepStartedEventInfo + - index + - size + + Module: ansys.fluent.core.streaming_services.transcript_streaming + Class: AppendToFile + - f + Class: Transcript + - callback_ids + + Module: ansys.fluent.core.system_coupling + Class: Region + - display_name + - input_variables + - name + - output_variables + - topology + Class: Variable + - display_name + - is_extensive + - location + - name + - quantity_type + - tensor_type + + Module: ansys.fluent.core.utils.file_transfer_service + Class: ContainerFileTransferStrategy + - client + - container + - docker_client + - host_port + - image_name + - image_tag + - mount_source + - mount_target + - ports + Class: PimFileTransferService + - file_service + - pim_instance + - upload_server + Class: StandaloneFileTransferStrategy + - fluent_cwd + - pyfluent_cwd + + Module: ansys.fluent.core.utils.fluent_version + Class: FluentVersion + - v222 + - v231 + - v232 + - v241 + - v242 + - v251 + - v252 + diff --git a/src/ansys/fluent/core/session_solver.py b/src/ansys/fluent/core/session_solver.py index 1cadecb64c84..904a4576b855 100644 --- a/src/ansys/fluent/core/session_solver.py +++ b/src/ansys/fluent/core/session_solver.py @@ -167,6 +167,7 @@ def _build_from_fluent_connection( monitors_service = service_creator("monitors").create( fluent_connection._channel, fluent_connection._metadata, self._error_state ) + #: Manage Fluent's solution monitors. self.monitors = MonitorsManager(fluent_connection._id, monitors_service) self.events.register_callback( (SolverEvent.SOLUTION_INITIALIZED, SolverEvent.DATA_LOADED), From cd227db976a9508d552bc76c19de959db6b07c6b Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 29 Apr 2025 20:52:11 +0000 Subject: [PATCH 2/3] chore: adding changelog file 3984.maintenance.md [dependabot-skip] --- doc/changelog.d/3984.maintenance.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/3984.maintenance.md diff --git a/doc/changelog.d/3984.maintenance.md b/doc/changelog.d/3984.maintenance.md new file mode 100644 index 000000000000..12c8bd45c91d --- /dev/null +++ b/doc/changelog.d/3984.maintenance.md @@ -0,0 +1 @@ +Search for undocumented fields in codebase \ No newline at end of file From c4e63b07a5ebdc7a6aed08cfa09e14f8a8ca8e78 Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Wed, 30 Apr 2025 11:11:55 -0400 Subject: [PATCH 3/3] chore: Skip enums --- .../search_undocumented_fields.py | 72 ++++---- .../undocumented_fields.txt | 156 ------------------ 2 files changed, 39 insertions(+), 189 deletions(-) diff --git a/devel/undocumented_fields/search_undocumented_fields.py b/devel/undocumented_fields/search_undocumented_fields.py index 44daddcb0317..0c07ced41775 100644 --- a/devel/undocumented_fields/search_undocumented_fields.py +++ b/devel/undocumented_fields/search_undocumented_fields.py @@ -1,5 +1,5 @@ """ -Search code for undocumented fields in classes. Requires ast_comments module. +Search code for undocumented fields in classes. Requires the ast_comments package. Usage: python search_undocumented_fields.py ../../src """ @@ -11,6 +11,16 @@ import ast_comments as ast +def is_ith_undocumented_field(nodes, i: int) -> bool: + """Check if the ith node is an undocumented field assignment.""" + if i > 0 and isinstance(nodes[i - 1], ast.Comment): + comment = nodes[i - 1].value.strip() + print(f"Comment found: {comment}") + if comment.startswith("#:"): + return False + return True + + class ClassFieldVisitor(ast.NodeVisitor): """AST visitor that extracts public fields from classes.""" @@ -23,6 +33,24 @@ def visit_ClassDef(self, node): old_class = self.current_class self.current_class = node.name self.classes[node.name] = set() + is_enum = False + for x in node.bases: + if isinstance(x, ast.Name) and x.id in ( + "Enum", + "IntEnum", + "StrEnum", + "FluentEnum", + ): + is_enum = True + elif isinstance(x, ast.Attribute) and x.attr in ( + "Enum", + "IntEnum", + "StrEnum", + "FluentEnum", + ): + is_enum = True + if is_enum: + return # Skip Enum classes # Visit all child nodes for i, child in enumerate(node.body): @@ -31,28 +59,18 @@ def visit_ClassDef(self, node): for target in child.targets: if isinstance(target, ast.Name): # Only add public fields (not starting with underscore) - if not target.id.startswith("_"): - has_doc_comment = False - if i > 0 and isinstance(node.body[i - 1], ast.Comment): - comment = node.body[i - 1].value.strip() - print(f"Comment found: {comment}") - if comment.startswith("#:"): - has_doc_comment = True - if not has_doc_comment: - self.classes[node.name].add(target.id) + if target.id.startswith("_"): + continue + if is_ith_undocumented_field(node.body, i): + self.classes[node.name].add(target.id) elif isinstance(child, ast.AnnAssign) and isinstance( child.target, ast.Name ): # Handle annotated assignments (e.g., x: int = 10) - if not child.target.id.startswith("_"): - has_doc_comment = False - if i > 0 and isinstance(node.body[i - 1], ast.Comment): - comment = node.body[i - 1].value.strip() - print(f"Comment found: {comment}") - if comment.startswith("#:"): - has_doc_comment = True - if not has_doc_comment: - self.classes[node.name].add(child.target.id) + if child.target.id.startswith("_"): + continue + if is_ith_undocumented_field(node.body, i): + self.classes[node.name].add(child.target.id) # Visit methods to find instance attribute assignments (self.attr = value) for child in node.body: @@ -84,13 +102,7 @@ def visit_FunctionDef(self, node): and isinstance(target.value, ast.Name) and target.value.id == "self" ): - has_doc_comment = False - if i > 0 and isinstance(results[i - 1], ast.Comment): - comment = results[i - 1].value.strip() - print(f"Comment found: {comment}") - if comment.startswith("#:"): - has_doc_comment = True - if not has_doc_comment: + if is_ith_undocumented_field(results, i): self.classes[self.current_class].add(target.attr) # Handle annotated assignments: self.attr: Type = value @@ -101,13 +113,7 @@ def visit_FunctionDef(self, node): and child.target.value.id == "self" and not child.target.attr.startswith("_") ): - has_doc_comment = False - if i > 0 and isinstance(results[i - 1], ast.Comment): - comment = results[i - 1].value.strip() - print(f"Comment found: {comment}") - if comment.startswith("#:"): - has_doc_comment = True - if not has_doc_comment: + if is_ith_undocumented_field(results, i): self.classes[self.current_class].add(child.target.attr) diff --git a/devel/undocumented_fields/undocumented_fields.txt b/devel/undocumented_fields/undocumented_fields.txt index d83512f11d27..20e1870ee745 100644 --- a/devel/undocumented_fields/undocumented_fields.txt +++ b/devel/undocumented_fields/undocumented_fields.txt @@ -1,17 +1,3 @@ - Module: ansys.fluent.core.codegen.__init__ - Class: StaticInfoType - - DATAMODEL_FLICING - - DATAMODEL_MESHING - - DATAMODEL_MESHING_UTILITIES - - DATAMODEL_PART_MANAGEMENT - - DATAMODEL_PM_FILE_MANAGEMENT - - DATAMODEL_PREFERENCES - - DATAMODEL_SOLVER_WORKFLOW - - DATAMODEL_WORKFLOW - - SETTINGS - - TUI_MESHING - - TUI_SOLVER - Module: ansys.fluent.core.codegen.datamodelgen Class: DataModelGenerator - version @@ -37,9 +23,6 @@ - rules_str_to_cache - rules_str_to_config - use_display_name - Class: NameKey - - DISPLAY - - INTERNAL Class: _CacheImpl - name_key @@ -76,11 +59,6 @@ - face_centroids - face_normals - vertices - Class: SurfaceDataType - - FacesCentroid - - FacesConnectivity - - FacesNormal - - Vertices Class: SurfaceFieldDataRequest - data_types - overset_mesh @@ -106,10 +84,6 @@ Class: InputParameterOld - name - value - Class: MeshType - - SURFACE - - UNKNOWN - - VOLUME Class: OutputParameter - name - units @@ -151,45 +125,6 @@ Class: PIMLauncher - file_transfer_service - Module: ansys.fluent.core.launcher.pyfluent_enums - Class: Dimension - - THREE - - TWO - Class: FluentLinuxGraphicsDriver - - AUTO - - NULL - - OPENGL - - OPENGL2 - - X11 - Class: FluentMode - - MESHING - - PRE_POST - - PURE_MESHING - - SOLVER - - SOLVER_AERO - - SOLVER_ICING - Class: FluentWindowsGraphicsDriver - - AUTO - - DX11 - - MSW - - NULL - - OPENGL - - OPENGL2 - Class: LaunchMode - - CONTAINER - - PIM - - SLURM - - STANDALONE - Class: Precision - - DOUBLE - - SINGLE - Class: UIMode - - GUI - - HIDDEN_GUI - - NO_GRAPHICS - - NO_GUI - - NO_GUI_OR_GRAPHICS - Module: ansys.fluent.core.launcher.slurm_launcher Class: SlurmLauncher - file_transfer_service @@ -198,13 +133,6 @@ Class: StandaloneLauncher - file_transfer_service - Module: ansys.fluent.core.meshing.meshing_workflow - Class: WorkflowMode - - FAULT_TOLERANT_MESHING_MODE - - TOPOLOGY_BASED_MESHING_MODE - - TWO_DIMENSIONAL_MESHING_MODE - - WATERTIGHT_MESHING_MODE - Module: ansys.fluent.core.parametric Class: LocalDesignPoint - name @@ -267,36 +195,6 @@ - batching Module: ansys.fluent.core.services.datamodel_se - Class: Attribute - - ALLOWED_VALUES - - ARGUMENTS - - DEFAULT - - DEPRECATED_VERSION - - DISPLAY_TEXT - - ECHO_MODE - - ERROR_STATUS - - EXCLUDED_VALUES - - EXPOSURE_LEVEL - - FORCE_DEFAULT - - INTERNAL_NAMES - - IS_ACTIVE - - IS_READ_ONLY - - IS_TREE_NODE - - MAX - - MAX_LENGTH - - MEMBERS - - MIGRATION - - MIN - - MIN_LENGTH - - NAME - - NAMES - - PATHS - - REFERENCE_PATH - - ROOT_ID - - SHOW_AT_PARENT_NODE - - TOOL_TIP - - USER_ERROR_STATUS - - WIDGET_TYPE Class: DatamodelService - cache - event_streaming @@ -357,19 +255,6 @@ Module: ansys.fluent.core.services.field_data Class: BaseFieldData - data - Class: CellElementType - - GHOST - - HEXAHEDRON - - POLYHEDRON - - PYRAMID - - QUADRATIC_HEXAHEDRON - - QUADRATIC_PYRAMID - - QUADRATIC_TETRAHEDRON - - QUADRATIC_WEDGE - - QUADRILATERAL - - TETRAHEDRON - - TRIANGLE - - WEDGE Class: Element - element_type - facets @@ -399,9 +284,6 @@ Class: ZoneInfo - name - zone_type - Class: ZoneType - - CELL - - FACE Class: _FieldDataConstants - bytes_stream - chunk_size @@ -515,12 +397,6 @@ - message Class: IterationEndedEventInfo - index - Class: MeshingEvent - - ABOUT_TO_LOAD_CASE - - CASE_LOADED - - FATAL_ERROR - - PROGRESS_UPDATED - - SETTINGS_CLEARED Class: ProgressUpdatedEventInfo - message - percentage @@ -531,28 +407,6 @@ Class: SolutionPausedEventInfo - index - level - Class: SolverEvent - - ABOUT_TO_INITIALIZE_SOLUTION - - ABOUT_TO_LOAD_CASE - - ABOUT_TO_LOAD_DATA - - CALCULATIONS_ENDED - - CALCULATIONS_PAUSED - - CALCULATIONS_RESUMED - - CALCULATIONS_STARTED - - CASE_LOADED - - DATA_LOADED - - FATAL_ERROR - - ITERATION_ENDED - - PROGRESS_UPDATED - - REPORT_DEFINITION_UPDATED - - REPORT_PLOT_SET_UPDATED - - RESIDUAL_PLOT_UPDATED - - SETTINGS_CLEARED - - SOLUTION_INITIALIZED - - SOLUTION_PAUSED - - SOLVER_TIME_ESTIMATE_UPDATED - - TIMESTEP_ENDED - - TIMESTEP_STARTED Class: SolverTimeEstimateUpdatedEventInfo - hours - minutes @@ -604,13 +458,3 @@ - fluent_cwd - pyfluent_cwd - Module: ansys.fluent.core.utils.fluent_version - Class: FluentVersion - - v222 - - v231 - - v232 - - v241 - - v242 - - v251 - - v252 -