Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
4f2c990
Add type level support for passing Path instances to download_file
Gobot1234 Sep 19, 2025
1ddf8e8
Add typing_extensions
Gobot1234 Sep 23, 2025
7825ff4
Fix inheritance for Meshing
Gobot1234 Sep 23, 2025
90d69a0
Fix create_launcher allowing None
Gobot1234 Sep 23, 2025
654deb4
Update launchers typing to be more specific
Gobot1234 Sep 23, 2025
ec258c3
Fix ci
Gobot1234 Sep 24, 2025
00c3a85
Fix ci again
Gobot1234 Sep 24, 2025
b6d2e3e
remove accidental commits
Gobot1234 Nov 5, 2025
0a48f90
run pyupgrade for moving typing to builtins and a couple of other things
Gobot1234 Nov 14, 2025
7b36a1c
fix some np.arrays that are meant to be ndarrays in types
Gobot1234 Dec 18, 2025
c04b413
pre-fix the conflict that will happen
Gobot1234 Jan 5, 2026
08e5525
add types for services
Gobot1234 Jan 12, 2026
7c2e9c3
Merge branch 'jhilton/typing-improvements' of https://github.com/ansy…
Gobot1234 Jan 12, 2026
0acf4ea
fix some low hanging fruit
Gobot1234 Jan 15, 2026
e6a7bf9
Merge remote-tracking branch 'origin/main' into jhilton/typing-improv…
Gobot1234 Jan 15, 2026
2ea0029
fix broken imports
Gobot1234 Jan 15, 2026
f28ce78
chore: adding changelog file 4761.added.md [dependabot-skip]
pyansys-ci-bot Jan 15, 2026
316128d
make the other imported modules not show up in __all__
Gobot1234 Jan 15, 2026
79956f3
pass bool
Gobot1234 Jan 19, 2026
4984170
respond to some review
Gobot1234 Jan 19, 2026
e130f13
add project infra for typechecking
Gobot1234 Jan 19, 2026
ee72ce6
test
Gobot1234 Jan 30, 2026
6e30e69
Merge branch 'main' into jhilton/typing-improvements
Gobot1234 Jan 30, 2026
0c7fb4b
Merge branch 'jhilton/typing-improvements' of https://github.com/ansy…
Gobot1234 Jan 30, 2026
f67ef50
gitattributes: enforce UTF-8 (no BOM) for patch and diff files
Gobot1234 Jan 30, 2026
e0ce93b
Add: public API regression test and fix type annotation issues
mayankansys Feb 3, 2026
912a036
Merge branch 'main' into jhilton/typing-improvements
Gobot1234 Feb 3, 2026
dc85158
Update ci.yml
Gobot1234 Feb 3, 2026
9a58a1e
Revert ci stuff
Gobot1234 Feb 3, 2026
e5309b7
Merge branch 'jhilton/typing-improvements' of https://github.com/ansy…
Gobot1234 Feb 3, 2026
3d37b81
no idea if this fixes ci
Gobot1234 Feb 3, 2026
6c5e692
Apply suggestions from code review
Gobot1234 Feb 3, 2026
b8a4a85
Update src/ansys/fluent/core/launcher/watchdog.py
Gobot1234 Feb 4, 2026
b38db19
fix ci up slightly
Gobot1234 Feb 4, 2026
5395956
fix launching and make it more type safe
Gobot1234 Feb 10, 2026
eae0f5b
misc changes
Gobot1234 Feb 10, 2026
7338cf9
Fix ci issues
Gobot1234 Feb 10, 2026
5bdade1
fix more stuff?
Gobot1234 Feb 10, 2026
ab34346
more typing fixes ci is still confusing me
Gobot1234 Feb 10, 2026
c4f0732
far too conservative
Gobot1234 Feb 10, 2026
a82d391
fix object installer types
Gobot1234 Feb 11, 2026
535c6b7
fix ci and mode related bug
Gobot1234 Feb 12, 2026
f6feab8
more ci work (api codegen check types)
Gobot1234 Feb 12, 2026
77e9854
fix ci
Gobot1234 Feb 12, 2026
f9b639a
fix not passing down all params in from_connection
Gobot1234 Feb 12, 2026
d1c6f53
run pyright
Gobot1234 Feb 12, 2026
dc6ec0b
Merge branch 'main' into jhilton/typing-improvements
Gobot1234 Feb 12, 2026
feac0d2
Update src/ansys/fluent/core/launcher/standalone_launcher.py
Gobot1234 Feb 12, 2026
e8cb20f
downgrade to 261 type checking for now
Gobot1234 Feb 12, 2026
57bd15c
Try logging in first
Gobot1234 Feb 13, 2026
58aefc4
cache for code style changes
Gobot1234 Feb 13, 2026
1809f84
fix some implicit optional parameters & other bits and bobs
Gobot1234 Feb 13, 2026
e050944
fix invocation of python
Gobot1234 Feb 13, 2026
dedba6c
gen certs
Gobot1234 Feb 16, 2026
13c8692
Merge branch 'main' into jhilton/typing-improvements
Gobot1234 Feb 16, 2026
3decd50
bump pytest in ci_types
Gobot1234 Feb 16, 2026
96e56a8
typing ci fixes
Gobot1234 Feb 16, 2026
1bb1408
add more deps?
Gobot1234 Feb 17, 2026
1f07cca
idk what else is missing here
Gobot1234 Feb 17, 2026
120f42d
Fix certificate generation script for Windows
Gobot1234 Feb 17, 2026
61b6806
chore: adding changelog file 4761.added.md [dependabot-skip]
pyansys-ci-bot Feb 17, 2026
4c1cb41
hopefully fix all the other issues
Gobot1234 Feb 17, 2026
3ac6141
Merge branch 'jhilton/typing-improvements' of https://github.com/ansy…
Gobot1234 Feb 17, 2026
d5596c6
Merge branch 'main' into jhilton/typing-improvements
Gobot1234 Feb 17, 2026
ba011d9
fix ci
Gobot1234 Feb 17, 2026
6e8cd22
okay for real this time
Gobot1234 Feb 17, 2026
b0aa392
I hope this fixes it
Gobot1234 Feb 17, 2026
83c443d
more errors
Gobot1234 Feb 17, 2026
bc787f1
fix the typing only symbol
Gobot1234 Feb 17, 2026
2de9fc2
Update slightly silly test
Gobot1234 Feb 18, 2026
c8e8999
Update examples/00-fluent/DOE_ML.py
Gobot1234 Feb 18, 2026
9517350
Update examples/00-fluent/DOE_ML.py
Gobot1234 Feb 18, 2026
c751908
Merge branch 'main' into jhilton/typing-improvements
Gobot1234 Feb 23, 2026
5649990
Update context_managers.py
Gobot1234 Feb 23, 2026
f73bcba
Update test_public_api.py
Gobot1234 Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added README.md
Empty file.
7 changes: 3 additions & 4 deletions devel/undocumented_fields/search_undocumented_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import os
import sys
from typing import Dict, Set

import ast_comments as ast

Expand Down Expand Up @@ -121,7 +120,7 @@ def visit_FunctionDef(self, node):
self.classes[self.current_class].add(child.target.attr)


def analyze_file(file_path: str) -> Dict[str, Set[str]]:
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:
Expand All @@ -134,7 +133,7 @@ def analyze_file(file_path: str) -> Dict[str, Set[str]]:
return {}


def analyze_package(package_path: str) -> Dict[str, Dict[str, Set[str]]]:
def analyze_package(package_path: str) -> dict[str, dict[str, set[str]]]:
"""Analyze all Python files in a package directory."""
result = {}

Expand All @@ -160,7 +159,7 @@ def analyze_package(package_path: str) -> Dict[str, Dict[str, Set[str]]]:
return result


def write_results(results: Dict[str, Dict[str, Set[str]]], f) -> str:
def write_results(results: dict[str, dict[str, set[str]]], f) -> None:
"""Format the analysis results."""
for module_name, classes in sorted(results.items()):

Expand Down
2 changes: 1 addition & 1 deletion doc/modify_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def modify_html(soup: BeautifulSoup) -> None:
/ "settings"
)
for html_file in html_dir.glob("*.html"):
with open(html_file, "r", encoding="utf-8") as f:
with open(html_file, encoding="utf-8") as f:
soup = BeautifulSoup(f, "html.parser", from_encoding="utf-8")

modify_html(soup)
Expand Down
13 changes: 6 additions & 7 deletions examples/00-fluent/DOE_ML.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
# flake8: noqa: E402

import os
from pathlib import Path

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -250,8 +249,8 @@
def display_scores(scores):
"""Display scores."""
print("\nCross-Validation Scores:", scores)
print("Mean:%0.2f" % (scores.mean()))
print("Std. Dev.:%0.2f" % (scores.std()))
print(f"Mean:{scores.mean():0.2f}")
print(f"Std. Dev.:{scores.std():0.2f}")


def fit_and_predict(model):
Expand All @@ -268,8 +267,8 @@ def fit_and_predict(model):
test_predictions = model.predict(X_test)
print(train_predictions.shape[0])
print("\n\nCoefficient Of Determination")
print("Train Data R2 Score: %0.3f" % (r2_score(train_predictions, y_train)))
print("Test Data R2 Score: %0.3f" % (r2_score(test_predictions, y_test)))
print(f"Train Data R2 Score: {r2_score(train_predictions, y_train):0.3f}")
print(f"Test Data R2 Score: {r2_score(test_predictions, y_test):0.3f}")
print(
"\n\nPredictions - Ground Truth (Kelvin): ", (test_predictions - y_test), "\n"
)
Expand Down Expand Up @@ -439,8 +438,8 @@ def fit_and_predict(model):
test_predictions = np.ravel(test_predictions.T)
print(test_predictions.shape)

print("\n\nTrain R2: %0.3f" % (r2_score(train_predictions, y_train)))
print("Test R2: %0.3f" % (r2_score(test_predictions, y_test)))
print(f"\n\nTrain R2: {r2_score(train_predictions, y_train):0.3f}")
print(f"Test R2: {r2_score(test_predictions, y_test):0.3f}")
print("Predictions - Ground Truth (Kelvin): ", (test_predictions - y_test))

fig = plt.figure(figsize=(12, 5))
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies = [
"pandas>=1.1.0,<3.0.0",
"pyansys-tools-report>=0.8.1",
"pyyaml>=6.0",
"typing-extensions>=4.12"
]
dynamic = ["version"]

Expand Down Expand Up @@ -233,3 +234,8 @@ skips = [
"B604",
"B607",
]

[tool.basedpyright]
reportUnknownMemberType = false
reportExplicitAny = false
reportPrivateUsage = false
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
"""Type alias for file system paths."""
4 changes: 2 additions & 2 deletions src/ansys/fluent/core/codegen/datamodelgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from pathlib import Path
import shutil
import string
from typing import Any, Dict
from typing import Any

import ansys.fluent.core as pyfluent
from ansys.fluent.core import FluentMode, launch_fluent
Expand Down Expand Up @@ -230,7 +230,7 @@ class DataModelGenerator:
def __init__(self, version, static_infos: dict, verbose: bool = False):
self.version = version
self._server_static_infos = static_infos
self._static_info: Dict[str, DataModelStaticInfo] = {}
self._static_info: dict[str, DataModelStaticInfo] = {}
self._verbose = verbose
if StaticInfoType.DATAMODEL_WORKFLOW in static_infos:
self._static_info["workflow"] = DataModelStaticInfo(
Expand Down
6 changes: 3 additions & 3 deletions src/ansys/fluent/core/codegen/tuigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import shutil
import string
import subprocess
from typing import Any, Dict
from typing import Any
import uuid

from defusedxml.ElementTree import parse
Expand Down Expand Up @@ -194,7 +194,7 @@ def find_class(self, module, name):
if module == "tuigen":
renamed_module = "ansys.fluent.core.codegen.tuigen"

return super(_RenameModuleUnpickler, self).find_class(renamed_module, name)
return super().find_class(renamed_module, name)


class TUIGenerator:
Expand All @@ -217,7 +217,7 @@ def __init__(
self._static_infos = static_infos
self._verbose = verbose

def _populate_menu(self, menu: _TUIMenu, info: Dict[str, Any]):
def _populate_menu(self, menu: _TUIMenu, info: dict[str, Any]):
for child_menu_name, child_menu_info in sorted(info["menus"].items()):
if _is_valid_tui_menu_name(child_menu_name):
child_menu = _TUIMenu(
Expand Down
3 changes: 1 addition & 2 deletions src/ansys/fluent/core/codegen/walk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@
"""

from inspect import signature
from typing import List

import ansys.fluent.core.solver.flobject as flobject


def walk_api(
api_cls, on_each_path, current_path: str | List[str] = "", api_item_type: str = ""
api_cls, on_each_path, current_path: str | list[str] = "", api_item_type: str = ""
):
"""
Recursively traverse the API hierarchy, calling `on_each_path` for each item.
Expand Down
30 changes: 15 additions & 15 deletions src/ansys/fluent/core/data_model_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import copy
from enum import Enum
from threading import RLock
from typing import Any, Dict, List, Optional
from typing import Any

from ansys.api.fluent.v0.variant_pb2 import Variant
from ansys.fluent.core.utils.fluent_version import FluentVersion
Expand All @@ -37,12 +37,12 @@
| int
| float
| str
| List[bool]
| List[int]
| List[float]
| List[str]
| List["StateType"]
| Dict[str, "StateType"]
| list[bool]
| list[int]
| list[float]
| list[str]
| list["StateType"]
| dict[str, "StateType"]
)


Expand Down Expand Up @@ -225,7 +225,7 @@ def set_config(self, rules: str, name: str, value: Any):
def _update_cache_from_variant_state(
self,
rules: str,
source: Dict[str, StateType],
source: dict[str, StateType],
key: str,
state: Variant,
updater_fn,
Expand Down Expand Up @@ -309,7 +309,7 @@ def update_source_with_state(state_field):

def _determine_key(
self,
source: Dict[str, StateType],
source: dict[str, StateType],
internal_names_as_keys: bool,
key: str,
state: Variant,
Expand Down Expand Up @@ -338,7 +338,7 @@ def _determine_key(
return new_key

def update_cache(
self, rules: str, state: Variant, deleted_paths: List[str], version=None
self, rules: str, state: Variant, deleted_paths: list[str], version=None
):
"""Update datamodel cache from streamed state.

Expand Down Expand Up @@ -377,8 +377,8 @@ def update_cache(

def _process_deleted_paths(
self,
cache: Dict[str, Any],
deleted_paths: List[str],
cache: dict[str, Any],
deleted_paths: list[str],
internal_names_as_keys: bool,
):
"""Process and delete paths from the cache based on the deleted paths list."""
Expand All @@ -387,7 +387,7 @@ def _process_deleted_paths(
self._delete_from_cache(cache, comps, internal_names_as_keys)

def _delete_from_cache(
self, sub_cache: Dict[str, Any], comps: List[str], internal_names_as_keys: bool
self, sub_cache: dict[str, Any], comps: list[str], internal_names_as_keys: bool
):
"""Recursively delete components from the cache."""
for i, comp in enumerate(comps):
Expand All @@ -407,12 +407,12 @@ def _delete_from_cache(

def _find_key_to_delete(
self,
sub_cache: Dict[str, Any],
sub_cache: dict[str, Any],
comp: str,
iname: str,
is_last_component: bool,
internal_names_as_keys: bool,
) -> Optional[str]:
) -> str | None:
"""Find the key to delete from the sub-cache."""
for k, v in sub_cache.items():
if (internal_names_as_keys and k == comp) or (
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/fluent/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
# SOFTWARE.

"""Custom common higher level exceptions."""
from typing import Any, Iterable
from collections.abc import Iterable
from typing import Any

from ansys.fluent.core.solver.error_message import allowed_name_error_message

Expand Down
Loading