Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions doc/source/_ext/autodocclass.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from enum import IntEnum
from typing import Any, Optional
from typing import Any

from docutils.statemachine import StringList
from sphinx.application import Sphinx
Expand Down Expand Up @@ -28,7 +28,7 @@ def add_directive_header(self, sig: str) -> None:
super().add_directive_header(sig)
self.add_line(" ", self.get_sourcename())

def add_content(self, more_content: Optional[StringList]) -> None:
def add_content(self, more_content: StringList | None) -> None:
super().add_content(more_content)

source_name = self.get_sourcename()
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pyside6 = { version = "~=6.8.1", optional = true }
[tool.poetry.extras]
interactive = ["pyvistaqt"]
single-window = ["pyvistaqt", "pyside6"]
ci_types = ["pyvistaqt", "pyside6", "ipython"]

[tool.poetry.urls]
"Documentation" = "https://visualization.fluent.docs.pyansys.com/"
Expand Down Expand Up @@ -77,3 +78,12 @@ skips = [
"B604",
"B607",
]

[tool.basedpyright]
reportUnknownMemberType = false
reportExplicitAny = false
reportPrivateUsage = false
reportUnusedCallResult = false
reportUnannotatedClassAttribute = false
reportPrivateImportUsage = false
ignore = ["doc"]
8 changes: 5 additions & 3 deletions src/ansys/fluent/interface/post_objects/check_in_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@
from ansys.fluent.core import PyFluentDeprecationWarning


def in_jupyter():
def in_jupyter() -> bool:
"""Checks if the library is being used in a Jupyter environment."""
try:
from IPython import get_ipython

return "IPKernelApp" in get_ipython().config
return (
"IPKernelApp" in get_ipython().config
) # pyright: ignore[reportOptionalMemberAccess]
except (ImportError, AttributeError):
return False


def in_notebook():
def in_notebook() -> bool:
warnings.warn("Please use 'in_jupyter' instead.", PyFluentDeprecationWarning)
return in_jupyter()
Loading
Loading