-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Hadn't noticed this previously. 👎
Originally posted by @seanpearsonuk in #4656
Body:
Several modules import PyFluent internals via the top-level package instead of their actual module paths, which creates unnecessary circular-import constraints.
Examples:
-
logger.pydoes:from ansys.fluent.core import config
This re-enters
__init__.pyand forces the current “config must be imported before logging” ordering.
It should import directly:from ansys.fluent.core.module_config import config
-
In other places, methods do:
import ansys.fluent.core as pyfluent something = pyfluent.config.get_whatever()
This is again using the top-level package as a proxy for internal modules, which tightly couples everything to
__init__.pyexecution order.
Proposed fix:
- Replace all top-level imports (
from ansys.fluent.core import Xorimport ansys.fluent.core as pyfluent) with direct module imports (from ansys.fluent.core.module_config import config, etc.). - This eliminates the circular-import dance and removes the artificial ordering rule in
__init__.py.
mkundu1
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
2026 Q1 Jan - Mar