Skip to content
Merged
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 .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ jobs:

- name: Retrieve pyfluent-visualization version
run: |
echo "::set-output name=PYFLUENT_VISUALIZATION_VERSION::$(python -c "from ansys.fluent.post import __version__; print(__version__)")"
echo "pyfluent-visualization version is: $(python -c "from ansys.fluent.post import __version__; print(__version__)")"
echo "::set-output name=PYFLUENT_VISUALIZATION_VERSION::$(python -c "from ansys.fluent.visualization import __version__; print(__version__)")"
echo "pyfluent-visualization version is: $(python -c "from ansys.fluent.visualization import __version__; print(__version__)")"
id: version

- name: Cache examples
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ install:
@python -m pip install --upgrade pip poetry
@python -m pip install -r requirements/requirements_build.txt
@poetry build
@pip install dist/ansys*.whl
@pip install dist/ansys*.whl --force-reinstall

docker-pull:
@pip install docker
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Here we should discuss the different API modules at a high level.
:maxdepth: 4
:hidden:

post/index
visualization/index
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ environment and PyVista is used to visualze the extracted data.
.. code:: python

# import module
from ansys.fluent.post.pyvista import Graphics
from ansys.fluent.visualization.pyvista import Graphics

# get the graphics objects for the session

Expand Down Expand Up @@ -90,7 +90,7 @@ environment and data is plotted in MatplotLib.
.. code:: python

# import module
from ansys.fluent.post.matplotlib import Plots
from ansys.fluent.visualization.matplotlib import Plots

# get the plots object for the session
plots_session1 = Plots(session)
Expand All @@ -107,7 +107,7 @@ environment and data is plotted in MatplotLib.

session.exit()

.. currentmodule:: ansys.fluent.post
.. currentmodule:: ansys.fluent.visualization

.. autosummary::
:toctree: _autosummary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Graphics
========
.. currentmodule:: ansys.fluent.post.pyvista.pyvista_objects
.. currentmodule:: ansys.fluent.visualization.pyvista.pyvista_objects

.. autosummary::
:toctree: _autosummary
Expand Down
14 changes: 7 additions & 7 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pyvista
from sphinx_gallery.sorting import FileNameSortKey

from ansys.fluent.post import __version__
from ansys.fluent.visualization import __version__

# Manage errors
pyvista.set_error_output_file("errors.txt")
Expand Down Expand Up @@ -198,7 +198,7 @@ def _stop_fluent_container(gallery_conf, fname):
(
master_doc,
f"pyfluent-visualization-Documentation-{__version__}.tex",
"ansys.fluent.post Documentation",
"ansys.fluent.visualization Documentation",
author,
"manual",
),
Expand All @@ -212,8 +212,8 @@ def _stop_fluent_container(gallery_conf, fname):
man_pages = [
(
master_doc,
"ansys.fluent.post",
"ansys.fluent.post Documentation",
"ansys.fluent.visualization",
"ansys.fluent.visualization Documentation",
[author],
1,
)
Expand All @@ -228,10 +228,10 @@ def _stop_fluent_container(gallery_conf, fname):
texinfo_documents = [
(
master_doc,
"ansys.fluent.post",
"ansys.fluent.post Documentation",
"ansys.fluent.visualization",
"ansys.fluent.visualization Documentation",
author,
"ansys.fluent.post",
"ansys.fluent.visualization",
"Pythonic interface for Fluent using gRPC",
"Engineering Software",
),
Expand Down
1 change: 0 additions & 1 deletion doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ mode:
cd pyfluent
pip install pip -U
pip install -e .
pip install -e .[post] # If you want to use pyvista

Building Documentation
----------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ You can launch Fluent from Python using the ``launch_fluent`` function:
session.check_health()
session.start_transcript() # Streaming the transcript locally

The ``post`` package provides integrations with both
The ``visualization`` package provides integrations with both
``pyvista`` and ``matplotlib``.

If you want to interact with the Fluent graphical user interface, set the
Expand Down
8 changes: 4 additions & 4 deletions doc/source/users_guide/postprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PyFluent postprocessing supports graphics and plotting.

Rendering Graphics Objects
--------------------------
The post package library is used for rendering graphics objects.
The visualization package library is used for rendering graphics objects.
The following graphics operations are supported.

Displaying Mesh Objects
Expand All @@ -15,9 +15,9 @@ The following example demonstrates how you can display the mesh object:

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.post import set_config
from ansys.fluent.post.matplotlib import Plots
from ansys.fluent.post.pyvista import Graphics
from ansys.fluent.visualization import set_config
from ansys.fluent.visualization.matplotlib import Plots
from ansys.fluent.visualization.pyvista import Graphics

set_config(blocking=True, set_view_on_display="isometric")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples

from ansys.fluent.post import set_config
from ansys.fluent.post.matplotlib import Plots
from ansys.fluent.post.pyvista import Graphics
from ansys.fluent.visualization import set_config
from ansys.fluent.visualization.matplotlib import Plots
from ansys.fluent.visualization.pyvista import Graphics

set_config(blocking=True, set_view_on_display="isometric")

Expand Down
6 changes: 0 additions & 6 deletions src/ansys/fluent/post/matplotlib/__init__.py

This file was deleted.

6 changes: 0 additions & 6 deletions src/ansys/fluent/post/pyvista/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ def _update_vtk_version():

if import_errors:
raise ImportError("\n".join(import_errors))
from ansys.fluent.post._config import get_config, set_config # noqa: F401
from ansys.fluent.visualization._config import get_config, set_config # noqa: F401
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Global configuration state for post."""
"""Global configuration state for visualization."""

_global_config = {"blocking": False, "set_view_on_display": None}


def get_config() -> dict:
"""Retrieve post configuration.
"""Retrieve visualization configuration.

Returns
-------
Expand All @@ -15,7 +15,7 @@ def get_config() -> dict:


def set_config(blocking: bool = False, set_view_on_display: str = None):
"""Set post configuration.
"""Set visualization configuration.

Parameters
----------
Expand Down
6 changes: 6 additions & 0 deletions src/ansys/fluent/visualization/matplotlib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""A package that provides interfacing Fluent with Matplotlib."""

from ansys.fluent.visualization.matplotlib.matplot_objects import Plots # noqa: F401
from ansys.fluent.visualization.matplotlib.matplot_windows_manager import ( # noqa: F401
matplot_windows_manager,
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"""Module providing post objects for Matplotlib."""
"""Module providing visualization objects for Matplotlib."""
import inspect
import sys
from typing import Optional

from ansys.fluent.core.meta import PyLocalContainer

from ansys.fluent.post.matplotlib.matplot_windows_manager import matplot_windows_manager
from ansys.fluent.post.post_object_defns import MonitorDefn, XYPlotDefn
from ansys.fluent.visualization.matplotlib.matplot_windows_manager import (
matplot_windows_manager,
)
from ansys.fluent.visualization.post_object_defns import MonitorDefn, XYPlotDefn


class Plots:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@
from ansys.fluent.core.session import Session
from ansys.fluent.core.utils.generic import AbstractSingletonMeta, in_notebook

from ansys.fluent.post import get_config
from ansys.fluent.post.matplotlib.plotter_defns import Plotter, ProcessPlotter
from ansys.fluent.post.post_data_extractor import XYPlotDataExtractor
from ansys.fluent.post.post_object_defns import MonitorDefn, PlotDefn, XYPlotDefn
from ansys.fluent.post.post_windows_manager import PostWindow, PostWindowsManager
from ansys.fluent.visualization import get_config
from ansys.fluent.visualization.matplotlib.plotter_defns import Plotter, ProcessPlotter
from ansys.fluent.visualization.post_data_extractor import XYPlotDataExtractor
from ansys.fluent.visualization.post_object_defns import (
MonitorDefn,
PlotDefn,
XYPlotDefn,
)
from ansys.fluent.visualization.post_windows_manager import (
PostWindow,
PostWindowsManager,
)


class _ProcessPlotterHandle:
Expand Down Expand Up @@ -219,7 +226,7 @@ def open_window(self, window_id: Optional[str] = None) -> str:
return window_id

def set_object_for_window(self, object: PlotDefn, window_id: str) -> None:
"""Associate post object with running window instance.
"""Associate visualization object with running window instance.

Parameters
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ansys.api.fluent.v0.field_data_pb2 import PayloadTag
import numpy as np

from ansys.fluent.post.post_object_defns import GraphicsDefn, PlotDefn
from ansys.fluent.visualization.post_object_defns import GraphicsDefn, PlotDefn


class FieldDataExtractor:
Expand Down Expand Up @@ -188,7 +188,7 @@ def __init__(self, post_object: PlotDefn):
self._post_object: PlotDefn = post_object

def fetch_data(self) -> Dict[str, Dict[str, np.array]]:
"""Fetch data for post object.
"""Fetch data for visualization object.

Parameters
----------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Module providing post objects definition."""
"""Module providing visualization objects definition."""
from abc import abstractmethod
from typing import List, NamedTuple, Optional

Expand All @@ -11,7 +11,7 @@


class BasePostObjectDefn:
"""Base class for post objects."""
"""Base class for visualization objects."""

def _pre_display(self):
local_surfaces_provider = self._get_top_most_parent()._local_surfaces_provider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from abc import ABCMeta, abstractmethod
from typing import List, Optional, Union

from ansys.fluent.post.post_object_defns import GraphicsDefn, PlotDefn
from ansys.fluent.visualization.post_object_defns import GraphicsDefn, PlotDefn


class PostWindow:
"""Abstract class for post window."""
"""Abstract class for visualization window."""

@abstractmethod
def plot(self):
Expand All @@ -18,7 +18,7 @@ def plot(self):


class PostWindowsManager(metaclass=ABCMeta):
"""Abstract class for post windows management."""
"""Abstract class for visualization windows management."""

@abstractmethod
def open_window(self, window_id: Optional[str] = None) -> str:
Expand All @@ -40,7 +40,7 @@ def open_window(self, window_id: Optional[str] = None) -> str:
def set_object_for_window(
self, object: Union[GraphicsDefn, PlotDefn], window_id: str
) -> None:
"""Associate post object with running window instance.
"""Associate visualization object with running window instance.

Parameters
----------
Expand Down
6 changes: 6 additions & 0 deletions src/ansys/fluent/visualization/pyvista/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""A package that provides interfacing Fluent with PyVista."""

from ansys.fluent.visualization.pyvista.pyvista_objects import Graphics # noqa: F401
from ansys.fluent.visualization.pyvista.pyvista_windows_manager import ( # noqa: F401
pyvista_windows_manager,
)
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
"""Module providing post objects for PyVista."""
"""Module providing visualization objects for PyVista."""

import inspect
import sys
from typing import Optional

from ansys.fluent.core.meta import PyLocalContainer

from ansys.fluent.post.post_object_defns import (
from ansys.fluent.visualization.post_object_defns import (
ContourDefn,
MeshDefn,
SurfaceDefn,
VectorDefn,
)
from ansys.fluent.post.pyvista.pyvista_windows_manager import pyvista_windows_manager
from ansys.fluent.visualization.pyvista.pyvista_windows_manager import (
pyvista_windows_manager,
)


class Graphics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
import pyvista as pv
from pyvistaqt import BackgroundPlotter

from ansys.fluent.post import get_config
from ansys.fluent.post.post_data_extractor import FieldDataExtractor
from ansys.fluent.post.post_object_defns import GraphicsDefn
from ansys.fluent.post.post_windows_manager import PostWindow, PostWindowsManager
from ansys.fluent.visualization import get_config
from ansys.fluent.visualization.post_data_extractor import FieldDataExtractor
from ansys.fluent.visualization.post_object_defns import GraphicsDefn
from ansys.fluent.visualization.post_windows_manager import (
PostWindow,
PostWindowsManager,
)


class PyVistaWindow(PostWindow):
Expand Down Expand Up @@ -395,7 +398,7 @@ def open_window(self, window_id: Optional[str] = None) -> str:
return window_id

def set_object_for_window(self, object: GraphicsDefn, window_id: str) -> None:
"""Associate post object with running window instance.
"""Associate visualization object with running window instance.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ansys.fluent.post import __version__
from ansys.fluent.visualization import __version__


def test_pkg_version():
Expand Down
4 changes: 2 additions & 2 deletions tests/test_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import numpy as np
import pytest

from ansys.fluent.post.matplotlib import Plots
from ansys.fluent.post.pyvista import Graphics
from ansys.fluent.visualization.matplotlib import Plots
from ansys.fluent.visualization.pyvista import Graphics


@pytest.fixture(autouse=True)
Expand Down