Skip to content

Commit

Permalink
Updates for new release targeting 24.2 (#331)
Browse files Browse the repository at this point in the history
* changes preparing for new release, targeting 24.2

* update 'SYC_MINOR_VERSION'

* mainly updates of examples

* update workflow to use organisation secrets
  • Loading branch information
iboyd-ansys authored Jul 2, 2024
1 parent 38cbe7c commit 50ea927
Show file tree
Hide file tree
Showing 26 changed files with 988 additions and 871 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
PACKAGE_NAME: "ansys-systemcoupling-core"
PACKAGE_NAMESPACE: "ansys.systemcoupling.core"
DOCUMENTATION_CNAME: "systemcoupling.docs.pyansys.com"
DOC_BUILD_SYC_VERSION: 24_1
DOC_BUILD_SYC_VERSION: 24_2

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -29,7 +29,7 @@ jobs:
- name: "PySystemCoupling documentation style checks"
uses: ansys/actions/doc-style@v6
with:
token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
vale-version: "3.4.1"

style:
Expand Down Expand Up @@ -78,8 +78,8 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GH_TOKEN }}
username: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}

- name: Generate API for v231
uses: ./.github/actions/generate-api
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GH_TOKEN }}
password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}

- name: Unit Test v23.1.0
uses: ./.github/actions/unit-test
Expand All @@ -162,13 +162,13 @@ jobs:
uses: ./.github/actions/unit-test
with:
image-tag: v24.1.0
upload-coverage: true
upload-coverage: false

- name: Unit Test v24.2.0
uses: ./.github/actions/unit-test
with:
image-tag: v24.2.0
upload-coverage: false
upload-coverage: true


docs:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ in this order:

* ``SYSC_ROOT``
* ``AWP_ROOT``
* ``AWP_ROOT241``
* ``AWP_ROOT242``

If a variable is set but does not refer to a valid installation, PySystemCoupling
fails at that point, rather than attempting to use the next variable.

In a standard user installation, the expectation is that only ``AWP_ROOT241`` is set.
In a standard user installation, the expectation is that only ``AWP_ROOT242`` is set.

(It is also possible to provide a different version number as an argument to the ``launch()``
function. This will affect which ``AWP_ROOT<version>`` environment variable is examined.)
Expand Down
8 changes: 4 additions & 4 deletions doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ after the preceding steps for cloning and installing the package.
The generated code is written to the directory ``src/ansys/systemcoupling/core/adaptor/api_<version>``,
where ``<version>`` is the version of the System Coupling instance that was run in the background
by the generation script. For example, the version ``24_1`` corresponds to the System Coupling 2024 R1.
The default is ``24_1``, which means that this release of System Coupling is expected to be at the
installation location given by the ``AWP_ROOT241`` environment variable.
by the generation script. For example, the version ``24_2`` corresponds to the System Coupling 2024 R2.
The default is ``24_2``, which means that this release of System Coupling is expected to be at the
installation location given by the ``AWP_ROOT242`` environment variable.

You can override the default behavior and run a different version, and generate the API classes for
this different version, by setting either the ``SYSC_ROOT`` environment variable to point to the
root directory of your System Coupling installation or the ``AWP_ROOT`` environment variable to
point to the root of an Ansys installation. If ``SYSC_ROOT`` and ``AWP_ROOT`` environment variables
are both set, the former takes priority. Additionally, both of these environment variables take priority
over the ``AWP_ROOT241`` environment variable.
over the ``AWP_ROOT242`` environment variable.


Build documentation
Expand Down
22 changes: 11 additions & 11 deletions doc/source/examples/00-systemcoupling/heating_tank_fmu.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Download input files\nClear the downloads target directory (which is to be used as the\nworking directory). Download the case file for Fluent and the FMU file, which\ndefine the participant-specifc setup information.\n\n"
"## Download input files\nClear the downloads target directory (which is to be used as the\nworking directory). Download the case file for Fluent and the FMU file, which\ndefine the participant-specific setup information.\n\n"
]
},
{
Expand All @@ -58,7 +58,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Launch Fluent\nLaunch a remote Fluent instance and return a *client* object\n(a ``Session`` object) that allows you to interact with Fluent\nvia an API exposed into the current Python environment.\nRead in the Fluent case file.\n\n<div class=\"alert alert-info\"><h4>Note</h4><p>Fluent version greater than 24.1 is required.\n To specify Fluent version explicitly when launching Fluent,\n use ``product_version`` argument to the ``launch_fluent``\n function, e.g. ``pyfluent.launch_fluent(product_version=\"24.2.0\")``</p></div>\n\n"
"## Launch Fluent\nLaunch a remote Fluent instance and return a *client* object\n(a ``Session`` object) that allows you to interact with Fluent\nvia an API exposed into the current Python environment.\nRead in the Fluent case file.\n\n<div class=\"alert alert-info\"><h4>Note</h4><p>Fluent version greater than 24.1 is required.\n To specify Fluent version explicitly when launching Fluent,\n use ``product_version`` argument to the ``launch_fluent``\n function, for example ``pyfluent.launch_fluent(product_version=\"24.2.0\")``</p></div>\n\n"
]
},
{
Expand All @@ -69,7 +69,7 @@
},
"outputs": [],
"source": [
"fluent_session = pyfluent.launch_fluent(start_transcript=False)\nfluent_v241 = pyfluent.utils.fluent_version.FluentVersion.v241\nassert fluent_session.get_fluent_version() >= fluent_v241\n\nfluent_session.file.read(file_type=\"case\", file_name=fluent_cas_file)"
"fluent_session = pyfluent.launch_fluent(start_transcript=False)\nfluent_v242 = pyfluent.utils.fluent_version.FluentVersion.v242\nassert fluent_session.get_fluent_version() >= fluent_v242\n\nfluent_session.settings.file.read(file_type=\"case\", file_name=fluent_cas_file)"
]
},
{
Expand Down Expand Up @@ -382,7 +382,7 @@
},
"outputs": [],
"source": [
"def save_png(fluent_session, png_name):\n fluent_session.results.graphics.picture.driver_options.hardcopy_format = \"png\"\n fluent_session.results.graphics.picture.use_window_resolution = False\n fluent_session.results.graphics.picture.x_resolution = 1920\n fluent_session.results.graphics.picture.y_resolution = 1080\n fluent_session.tui.display.save_picture(png_name)"
"def save_png(fluent_session, png_name):\n fluent_session.settings.results.graphics.picture.driver_options.hardcopy_format = (\n \"png\"\n )\n fluent_session.settings.results.graphics.picture.use_window_resolution = False\n fluent_session.settings.results.graphics.picture.x_resolution = 1920\n fluent_session.settings.results.graphics.picture.y_resolution = 1080\n fluent_session.tui.display.save_picture(png_name)"
]
},
{
Expand All @@ -400,7 +400,7 @@
},
"outputs": [],
"source": [
"normal_plane = \"zx\"\nposition = 0.0\nplane_name = \"plane\" + \"-\" + normal_plane + \"-\" + str(position)\nfluent_session.results.surfaces.plane_surface.create(plane_name)\nfluent_session.results.surfaces.plane_surface[plane_name].method = (\n normal_plane + \"-plane\"\n)\nfluent_session.results.surfaces.plane_surface[plane_name].y = position"
"normal_plane = \"zx\"\nposition = 0.0\nplane_name = \"plane\" + \"-\" + normal_plane + \"-\" + str(position)\nfluent_session.settings.results.surfaces.plane_surface.create(plane_name)\nfluent_session.settings.results.surfaces.plane_surface[plane_name].method = (\n normal_plane + \"-plane\"\n)\nfluent_session.settings.results.surfaces.plane_surface[plane_name].y = position"
]
},
{
Expand All @@ -418,7 +418,7 @@
},
"outputs": [],
"source": [
"normal_multiplane = \"xy\"\nmutliplane_list = []\nnumber_of_planes = 8\nheight = 0.14\nstep = height / (number_of_planes + 2)\nfor i in range(0, number_of_planes):\n multiplane_name = \"plane\" + \"-\" + normal_multiplane + \"-\" + str(i)\n fluent_session.results.surfaces.plane_surface.create(multiplane_name)\n fluent_session.results.surfaces.plane_surface[multiplane_name].method = (\n normal_multiplane + \"-plane\"\n )\n fluent_session.results.surfaces.plane_surface[multiplane_name].z = (\n float(i) * step + step\n )\n mutliplane_list.append(multiplane_name)"
"normal_multiplane = \"xy\"\nmutliplane_list = []\nnumber_of_planes = 8\nheight = 0.14\nstep = height / (number_of_planes + 2)\nfor i in range(0, number_of_planes):\n multiplane_name = \"plane\" + \"-\" + normal_multiplane + \"-\" + str(i)\n fluent_session.settings.results.surfaces.plane_surface.create(multiplane_name)\n fluent_session.settings.results.surfaces.plane_surface[multiplane_name].method = (\n normal_multiplane + \"-plane\"\n )\n fluent_session.settings.results.surfaces.plane_surface[multiplane_name].z = (\n float(i) * step + step\n )\n mutliplane_list.append(multiplane_name)"
]
},
{
Expand All @@ -436,7 +436,7 @@
},
"outputs": [],
"source": [
"def contour(fluent_session, surface_list, surface_name, field, color):\n contour_name = \"contour-\" + field + \"-\" + surface_name\n fluent_session.results.graphics.contour.create(contour_name)\n fluent_session.results.graphics.contours.render_mesh = True\n fluent_session.results.graphics.contour[contour_name] = {\n \"name\": contour_name,\n \"field\": field,\n \"filled\": True,\n \"boundary_values\": True,\n \"contour_lines\": False,\n \"node_values\": True,\n \"surfaces_list\": surface_list,\n \"range_option\": {\n \"option\": \"auto-range-on\",\n \"auto_range_on\": {\"global_range\": True},\n },\n \"coloring\": {\"option\": \"smooth\", \"smooth\": False},\n \"color_map\": {\n \"visible\": True,\n \"size\": 100,\n \"color\": color,\n \"log_scale\": False,\n \"format\": \"%0.4g\",\n \"user_skip\": 20,\n \"show_all\": True,\n \"position\": 1,\n \"font_name\": \"Helvetica\",\n \"font_automatic\": True,\n \"font_size\": 0.032,\n \"length\": 0.54,\n \"width\": 6.0,\n },\n \"display_state_name\": \"None\",\n }\n fluent_session.results.graphics.contour[contour_name].display()\n scene(fluent_session, contour_name)"
"def contour(fluent_session, surface_list, surface_name, field, color):\n contour_name = \"contour-\" + field + \"-\" + surface_name\n fluent_session.settings.results.graphics.contour.create(contour_name)\n fluent_session.settings.results.graphics.contours.render_mesh = True\n fluent_session.settings.results.graphics.contour[contour_name] = {\n \"name\": contour_name,\n \"field\": field,\n \"filled\": True,\n \"boundary_values\": True,\n \"contour_lines\": False,\n \"node_values\": True,\n \"surfaces_list\": surface_list,\n \"range_option\": {\n \"option\": \"auto-range-on\",\n \"auto_range_on\": {\"global_range\": True},\n },\n \"coloring\": {\"option\": \"smooth\", \"smooth\": False},\n \"color_map\": {\n \"visible\": True,\n \"size\": 100,\n \"color\": color,\n \"log_scale\": False,\n \"format\": \"%0.4g\",\n \"user_skip\": 20,\n \"show_all\": True,\n \"position\": 1,\n \"font_name\": \"Helvetica\",\n \"font_automatic\": True,\n \"font_size\": 0.032,\n \"length\": 0.54,\n \"width\": 6.0,\n },\n \"display_state_name\": \"None\",\n }\n fluent_session.results.graphics.contour[contour_name].display()\n scene(fluent_session, contour_name)"
]
},
{
Expand All @@ -454,7 +454,7 @@
},
"outputs": [],
"source": [
"def vector(fluent_session, surfaces_list, surface_name, field):\n vector_name = \"vectors-\" + field + \"-\" + surface_name\n fluent_session.results.graphics.vector.create(vector_name)\n fluent_session.results.graphics.vector[vector_name].style = \"arrow\"\n fluent_session.results.graphics.vector[vector_name].scale.scale_f = 0.6\n fluent_session.results.graphics.vector[vector_name].field = field\n fluent_session.results.graphics.vector[vector_name].surfaces_list = surfaces_list\n fluent_session.results.graphics.vector[vector_name] = {\n \"color_map\": {\n \"visible\": True,\n \"size\": 100,\n \"color\": \"field-temperature\",\n \"log_scale\": False,\n \"format\": \"%0.4g\",\n \"user_skip\": 20,\n \"show_all\": True,\n \"position\": 1,\n \"font_name\": \"Helvetica\",\n \"font_automatic\": True,\n \"font_size\": 0.032,\n \"length\": 0.54,\n \"width\": 6.0,\n }\n }\n fluent_session.results.graphics.vector[vector_name].display()\n scene(fluent_session, vector_name)"
"def vector(fluent_session, surfaces_list, surface_name, field):\n vector_name = \"vectors-\" + field + \"-\" + surface_name\n fluent_session.settings.results.graphics.vector.create(vector_name)\n fluent_session.settings.results.graphics.vector[vector_name].style = \"arrow\"\n fluent_session.settings.results.graphics.vector[vector_name].scale.scale_f = 0.6\n fluent_session.settings.results.graphics.vector[vector_name].field = field\n fluent_session.settings.results.graphics.vector[vector_name].surfaces_list = (\n surfaces_list\n )\n fluent_session.settings.results.graphics.vector[vector_name] = {\n \"color_map\": {\n \"visible\": True,\n \"size\": 100,\n \"color\": \"field-temperature\",\n \"log_scale\": False,\n \"format\": \"%0.4g\",\n \"user_skip\": 20,\n \"show_all\": True,\n \"position\": 1,\n \"font_name\": \"Helvetica\",\n \"font_automatic\": True,\n \"font_size\": 0.032,\n \"length\": 0.54,\n \"width\": 6.0,\n }\n }\n fluent_session.settings.results.graphics.vector[vector_name].display()\n scene(fluent_session, vector_name)"
]
},
{
Expand All @@ -472,7 +472,7 @@
},
"outputs": [],
"source": [
"def outline(fluent_session):\n fluent_session.results.graphics.mesh.create(\"outline\")\n fluent_session.results.graphics.mesh[\"outline\"].coloring.option = \"manual\"\n fluent_session.results.graphics.mesh[\"outline\"].surfaces_list = [\n \"wall\",\n \"heat_source\",\n \"top\",\n \"sensor\",\n ]\n fluent_session.results.graphics.mesh[\"outline\"].coloring.manual.faces = \"light gray\""
"def outline(fluent_session):\n fluent_session.settings.results.graphics.mesh.create(\"outline\")\n fluent_session.settings.results.graphics.mesh[\"outline\"].coloring.option = \"manual\"\n fluent_session.settings.results.graphics.mesh[\"outline\"].surfaces_list = [\n \"wall\",\n \"heat_source\",\n \"top\",\n \"sensor\",\n ]\n fluent_session.settings.results.graphics.mesh[\"outline\"].coloring.manual.faces = (\n \"light gray\"\n )"
]
},
{
Expand All @@ -490,7 +490,7 @@
},
"outputs": [],
"source": [
"def scene(fluent_session, object_name):\n scene_name = \"scene-\" + object_name\n fluent_session.results.scene.create(scene_name)\n fluent_session.results.scene[scene_name] = {}\n fluent_session.results.scene[scene_name].graphics_objects[\"outline\"] = {}\n fluent_session.results.scene[scene_name].graphics_objects[\n \"outline\"\n ].transparency = 90\n fluent_session.results.scene[scene_name].graphics_objects[object_name] = {}\n fluent_session.results.scene[scene_name].display()\n fluent_session.results.graphics.views.restore_view(view_name=\"top\")\n fluent_session.results.graphics.views.camera.orbit(right=140, up=20)\n fluent_session.results.graphics.views.camera.zoom(factor=1.1)\n save_png(fluent_session, scene_name)"
"def scene(fluent_session, object_name):\n scene_name = \"scene-\" + object_name\n fluent_session.settings.results.scene.create(scene_name)\n fluent_session.settings.results.scene[scene_name] = {}\n fluent_session.settings.results.scene[scene_name].graphics_objects[\"outline\"] = {}\n fluent_session.settings.results.scene[scene_name].graphics_objects[\n \"outline\"\n ].transparency = 90\n fluent_session.settings.results.scene[scene_name].graphics_objects[object_name] = {}\n fluent_session.settings.results.scene[scene_name].display()\n fluent_session.settings.results.graphics.views.restore_view(view_name=\"top\")\n fluent_session.settings.results.graphics.views.camera.orbit(right=140, up=20)\n fluent_session.settings.results.graphics.views.camera.zoom(factor=1.1)\n save_png(fluent_session, scene_name)"
]
},
{
Expand Down Expand Up @@ -553,7 +553,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 50ea927

Please sign in to comment.