-
Notifications
You must be signed in to change notification settings - Fork 57
Description
📝 Discussion
Multiple projects inside pyfluent
At the moment, all source files are located inside the ansys/ directory, which is contained at the root of the project. This folder holds:
- The
ansys-fluent-corelibary. - The
ansys-fluent-parametriclibrary. - The
ansys-fluent-postlibrary. - The
ansys-apifiles, which are generated from the logic undercodegenandprotosdirectories.
I saw that pymapdl follows the src/ layout exposed in the dev-guide. This is accomplished by having an ansys-api-mapdl in the Ansys GitHub organization.
I do not know which is the reason for not having an ansys-api-fluent repo in the Ansys organization. Is it because this product is still private?
Library layout
The current layout means having three separate libraries inside the ansys/fluent directory, as there is no __init__.py file:
ansys/fluent
├── core/
├── parametric/
└── post/
Ideally, each one of these libraries should be maintained in its own repo while having its own setup.py file. However, to reduce maintenance tasks, some advantage is taken from the find_namespace_packages() function in the setup.py file.
Although all three libraries are installed with the ansys-fluent-solver name, it is possible to run:
from ansys.fluent import core, parametric, postHowever, the following is not permitted:
for pkg in [parametric, post]: print(f"{pkg.__version__ = }")This is because parametric and post lack of a __version__ attribute. To keep using a single-source defined version, the following may be applied:
# Add this line to parametric/__init__.py and post/__init__.py files
__version__ == ansys.fluent.core.__version__
Moving to a src/ layout
This could be done by adding find_namespace_packages(where="src", include="ansys*"), which would still lead to:
import ansys.api.fluent.v0
from ansys.fluent import core, parametric, post