Skip to content

Commit 7c3313b

Browse files
committed
Merge branch 'main' into release/0.2
2 parents 8e6677f + 7e07357 commit 7c3313b

File tree

13 files changed

+249
-110
lines changed

13 files changed

+249
-110
lines changed

.github/workflows/ci_cd.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,4 +412,3 @@ jobs:
412412
with:
413413
cname: ${{ env.DOCUMENTATION_CNAME }}
414414
token: ${{ secrets.GITHUB_TOKEN }}
415-
python-version: ${{ env.MAIN_PYTHON_VERSION }}

.github/workflows/docker_push_stable.yml

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ concurrency:
2323
permissions:
2424
packages: write
2525

26+
env:
27+
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable
28+
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
29+
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:windows-latest
30+
LINUX_UNSTABLE: ghcr.io/ansys/geometry:linux-latest-unstable
31+
LINUX_STABLE_GHCR: ghcr.io/ansys/geometry:linux-latest
32+
LINUX_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:linux-latest
33+
2634
jobs:
2735
windows:
2836
name: Publish Windows latest image
2937
runs-on: windows-latest
3038
if: inputs.images == 'all' || inputs.images == 'windows-latest'
31-
env:
32-
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable
33-
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
34-
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:windows-latest
3539
steps:
3640
- name: Login in Github Container registry
3741
uses: docker/login-action@v2
@@ -49,30 +53,41 @@ jobs:
4953
- name: Publish latest stable container in ghcr.io
5054
run: docker push ${{ env.WINDOWS_STABLE_GHCR }}
5155

56+
windows-ansyslab:
57+
name: Publish Windows latest image on AnsysLab
58+
if: inputs.ansyslab
59+
needs: [windows]
60+
runs-on:
61+
group: ansys-internal
62+
labels: Windows
63+
steps:
64+
- name: Login in Github Container registry
65+
uses: docker/login-action@v2
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Pull Windows latest unstable container
72+
run: docker pull ${{ env.WINDOWS_STABLE_GHCR }}
73+
5274
- name: Login in AnsysLab registry
53-
if: ${{ inputs.ansyslab }}
5475
uses: docker/login-action@v2
5576
with:
5677
registry: azwepsifujiaksacr.azurecr.io
5778
username: ${{ secrets.FUJI_USER }}
5879
password: ${{ secrets.FUJI_TOKEN }}
5980

6081
- name: Tag container as latest (stable) for AnsysLab registry
61-
if: ${{ inputs.ansyslab }}
62-
run: docker tag ${{ env.WINDOWS_UNSTABLE }} ${{ env.WINDOWS_STABLE_FUJI }}
82+
run: docker tag ${{ env.WINDOWS_STABLE_GHCR }} ${{ env.WINDOWS_STABLE_FUJI }}
6383

6484
- name: Publish latest stable container in AnsysLab registry
65-
if: ${{ inputs.ansyslab }}
6685
run: docker push ${{ env.WINDOWS_STABLE_FUJI }}
6786

6887
linux:
6988
name: Publish Linux latest image
7089
runs-on: ubuntu-latest
7190
if: inputs.images == 'all' || inputs.images == 'linux-latest'
72-
env:
73-
LINUX_UNSTABLE: ghcr.io/ansys/geometry:linux-latest-unstable
74-
LINUX_STABLE_GHCR: ghcr.io/ansys/geometry:linux-latest
75-
LINUX_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:linux-latest
7691
steps:
7792
- name: Login in Github Container registry
7893
uses: docker/login-action@v2
@@ -90,18 +105,33 @@ jobs:
90105
- name: Publish latest stable container in ghcr.io
91106
run: docker push ${{ env.LINUX_STABLE_GHCR }}
92107

108+
linux-ansyslab:
109+
name: Publish Linux latest image on AnsysLab
110+
if: inputs.ansyslab
111+
needs: [linux]
112+
runs-on:
113+
group: ansys-internal
114+
labels: Linux
115+
steps:
116+
- name: Login in Github Container registry
117+
uses: docker/login-action@v2
118+
with:
119+
registry: ghcr.io
120+
username: ${{ github.actor }}
121+
password: ${{ secrets.GITHUB_TOKEN }}
122+
123+
- name: Pull Linux latest stable container
124+
run: docker pull ${{ env.LINUX_STABLE_GHCR }}
125+
93126
- name: Login in AnsysLab registry
94-
if: ${{ inputs.ansyslab }}
95127
uses: docker/login-action@v2
96128
with:
97129
registry: azwepsifujiaksacr.azurecr.io
98130
username: ${{ secrets.FUJI_USER }}
99131
password: ${{ secrets.FUJI_TOKEN }}
100132

101133
- name: Tag container as latest (stable) for AnsysLab registry
102-
if: ${{ inputs.ansyslab }}
103-
run: docker tag ${{ env.LINUX_UNSTABLE }} ${{ env.LINUX_STABLE_FUJI }}
134+
run: docker tag ${{ env.LINUX_STABLE_GHCR }} ${{ env.LINUX_STABLE_FUJI }}
104135

105136
- name: Publish latest stable container in AnsysLab registry
106-
if: ${{ inputs.ansyslab }}
107137
run: docker push ${{ env.LINUX_STABLE_FUJI }}

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
* [Jorge Martínez](https://github.com/jorgepiloto)
1717
* [Alejandro Fernández](https://github.com/AlejandroFernandezLuces)
1818
* [Lance Lance](https://github.com/LanceX2214)
19+
* [Dastan Abdulla](https://github.com/dastan-ansys)

docker/Dockerfile.linux

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ RUN unzip -qqju linux-binaries.zip -d . && rm linux-binaries.zip
1616
# Let the dynamic link loader where to search for shared libraries
1717
ENV LD_LIBRARY_PATH="/app"
1818

19+
# Define env variables
20+
ENV ANS_DSCO_REMOTE_PORT=50051
21+
ENV ANS_DSCO_REMOTE_IP="0.0.0.0"
22+
ENV LOG_LEVEL=2
23+
ENV ENABLE_TRACE=0
24+
ENV ANSYSLMD_LICENSE_FILE=""
25+
1926
# Add container labels
2027
LABEL org.opencontainers.image.authors="ANSYS Inc."
2128
LABEL org.opencontainers.image.vendor="ANSYS Inc."

docker/Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN for /R "tmp_folder" %f in (*) do move /Y "%f" .
2020
RUN del windows-binaries.zip && rmdir /s /q tmp_folder
2121

2222
# Defining environment variables
23-
ENV LICENSE_SERVER = ""
23+
ENV LICENSE_SERVER=""
2424
ENV SERVER_ENDPOINT="0.0.0.0:50051"
2525
ENV ENABLE_TRACE=0
2626
ENV LOG_LEVEL=2
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""Provides the PyGeometry ``designer`` subpackage."""
22

3-
from ansys.geometry.core.designer.body import Body, MidSurfaceOffsetType, TemplateBody
3+
from ansys.geometry.core.designer.body import Body, MasterBody, MidSurfaceOffsetType
44
from ansys.geometry.core.designer.component import Component, SharedTopologyType
55
from ansys.geometry.core.designer.design import Design, DesignFileFormat
66
from ansys.geometry.core.designer.designpoint import DesignPoint
77
from ansys.geometry.core.designer.edge import CurveType, Edge
88
from ansys.geometry.core.designer.face import Face, SurfaceType
9-
from ansys.geometry.core.designer.part import Part, TransformedPart
9+
from ansys.geometry.core.designer.part import MasterComponent, Part
1010
from ansys.geometry.core.designer.selection import NamedSelection

src/ansys/geometry/core/designer/body.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class IBody(ABC):
5858
"""
5959
Abstract Body interface.
6060
61-
Defines the common methods for a body. TemplateBody and Body both inherit from this.
61+
Defines the common methods for a body. MasterBody and Body both inherit from this.
6262
All child classes must implement all abstract methods.
6363
"""
6464

@@ -443,7 +443,7 @@ def unite(self, other: "Body") -> None:
443443
return
444444

445445

446-
class TemplateBody(IBody):
446+
class MasterBody(IBody):
447447
"""
448448
Represents solids and surfaces organized within the design assembly.
449449
@@ -460,7 +460,7 @@ class TemplateBody(IBody):
460460
grpc_client : GrpcClient
461461
An active supporting geometry service instance for design modeling.
462462
is_surface : bool, default: False
463-
Boolean indicating whether the ``TemplateBody`` is in fact a surface or an actual
463+
Boolean indicating whether the ``MasterBody`` is in fact a surface or an actual
464464
3D object (with volume).
465465
"""
466466

@@ -471,7 +471,7 @@ def __init__(
471471
grpc_client: GrpcClient,
472472
is_surface: bool = False,
473473
):
474-
"""Initialize ``TemplateBody`` class."""
474+
"""Initialize ``MasterBody`` class."""
475475
check_type(id, str)
476476
check_type(name, str)
477477
check_type(grpc_client, GrpcClient)
@@ -489,7 +489,7 @@ def __init__(
489489
self._tessellation = None
490490

491491
def reset_tessellation_cache(func):
492-
"""Decorate ``TemplateBody`` methods that require a tessellation cache update.
492+
"""Decorate ``MasterBody`` methods that require a tessellation cache update.
493493
494494
Parameters
495495
----------
@@ -503,7 +503,7 @@ def reset_tessellation_cache(func):
503503
"""
504504

505505
@wraps(func)
506-
def wrapper(self: "TemplateBody", *args, **kwargs):
506+
def wrapper(self: "MasterBody", *args, **kwargs):
507507
self._tessellation = None
508508
return func(self, *args, **kwargs)
509509

@@ -614,7 +614,7 @@ def imprint_curves(
614614
) -> Tuple[List[Edge], List[Face]]: # noqa: D102
615615
raise NotImplementedError(
616616
"""
617-
imprint_curves is not implemented at the TemplateBody level.
617+
imprint_curves is not implemented at the MasterBody level.
618618
Instead, call this method on a Body.
619619
"""
620620
)
@@ -630,7 +630,7 @@ def project_curves(
630630
) -> List[Face]: # noqa: D102
631631
raise NotImplementedError(
632632
"""
633-
project_curves is not implemented at the TemplateBody level.
633+
project_curves is not implemented at the MasterBody level.
634634
Instead, call this method on a Body.
635635
"""
636636
)
@@ -676,7 +676,7 @@ def copy(self, parent: "Component", name: str = None) -> "Body": # noqa: D102
676676
)
677677

678678
# Assign the new body to its specified parent (and return the new body)
679-
tb = TemplateBody(
679+
tb = MasterBody(
680680
response.master_id, copy_name, self._grpc_client, is_surface=self.is_surface
681681
)
682682
parent._transformed_part.part.bodies.append(tb)
@@ -726,23 +726,23 @@ def plot(
726726

727727
def intersect(self, other: "Body") -> None: # noqa: D102
728728
raise NotImplementedError(
729-
"TemplateBody does not implement boolean methods. Call this method on a Body instead."
729+
"MasterBody does not implement boolean methods. Call this method on a Body instead."
730730
)
731731

732732
def subtract(self, other: "Body") -> None: # noqa: D102
733733
raise NotImplementedError(
734-
"TemplateBody does not implement boolean methods. Call this method on a Body instead."
734+
"MasterBody does not implement boolean methods. Call this method on a Body instead."
735735
)
736736

737737
def unite(self, other: "Body") -> None:
738738
# noqa: D102
739739
raise NotImplementedError(
740-
"TemplateBody does not implement boolean methods. Call this method on a Body instead."
740+
"MasterBody does not implement boolean methods. Call this method on a Body instead."
741741
)
742742

743743
def __repr__(self) -> str:
744-
"""Represent the ``TemplateBody`` as a string."""
745-
lines = [f"ansys.geometry.core.designer.TemplateBody {hex(id(self))}"]
744+
"""Represent the ``MasterBody`` as a string."""
745+
lines = [f"ansys.geometry.core.designer.MasterBody {hex(id(self))}"]
746746
lines.append(f" Name : {self.name}")
747747
lines.append(f" Exists : {self.is_alive}")
748748
lines.append(f" Surface body : {self.is_surface}")
@@ -767,11 +767,11 @@ class Body(IBody):
767767
User-defined label for the body.
768768
parent : Component
769769
Parent component to nest the new component under within the design assembly.
770-
template : TemplateBody
770+
template : MasterBody
771771
The master body that this body is an occurrence of.
772772
"""
773773

774-
def __init__(self, id, name, parent: "Component", template: TemplateBody) -> None:
774+
def __init__(self, id, name, parent: "Component", template: MasterBody) -> None:
775775
"""Initialize ``Body`` class."""
776776
self._id = id
777777
self._name = name
@@ -1016,7 +1016,7 @@ def __repr__(self) -> str:
10161016
lines.append(f" Name : {self.name}")
10171017
lines.append(f" Exists : {self.is_alive}")
10181018
lines.append(f" Parent component : {self._parent.name}")
1019-
lines.append(f" TemplateBody : {self._template.id}")
1019+
lines.append(f" MasterBody : {self._template.id}")
10201020
lines.append(f" Surface body : {self.is_surface}")
10211021
if self.is_surface:
10221022
lines.append(f" Surface thickness : {self.surface_thickness}")

0 commit comments

Comments
 (0)