Skip to content

Commit e8717b3

Browse files
authored
Merge branch 'main' into dependabot/pip/numpy-1.26.4
2 parents 6417818 + 941f32c commit e8717b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+860
-915
lines changed

.github/workflows/ci_cd_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: "Include 'API' and 'Examples' sections from nightly build docs"
3838
run: |
3939
cp -r gh-pages/version/dev/api doc/_build/html/api
40-
cp gh-pages/version/dev/examples.html doc/_build/html/examples.html
40+
cp -r gh-pages/version/dev/examples doc/_build/html/examples
4141
cp gh-pages/version/dev/index.html doc/_build/html/index.html
4242
4343
- name: "Upload combined artifacts"

.github/workflows/ci_cd_night.yml

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,64 @@ jobs:
3838

3939
doc-build:
4040
name: "Doc build"
41-
runs-on: ubuntu-latest
41+
runs-on: [self-hosted, pystk]
4242
timeout-minutes: 30
43-
if: inputs.run-doc || github.event_name == 'schedule'
4443
steps:
45-
- name: "Building project documentation"
46-
uses: ansys/actions/doc-build@v5
44+
45+
- name: "Checkout the project"
46+
uses: actions/checkout@v4
47+
48+
- name: "Generate the name of the Docker image and the container"
49+
run: |
50+
python_image_name=${{ env.STK_DOCKER_IMAGE }}-python${{ env.MAIN_PYTHON_VERSION }}
51+
container_name=stk-python${{ env.MAIN_PYTHON_VERSION }}
52+
echo "STK_PYTHON_IMAGE=$python_image_name" >> $GITHUB_ENV
53+
echo "STK_CONTAINER=$container_name" >> $GITHUB_ENV
54+
55+
- name: "Start the container from the desired image"
56+
run: |
57+
docker run \
58+
--detach -it \
59+
--network="host" \
60+
--name ${{ env.STK_CONTAINER }} \
61+
--env ANSYSLMD_LICENSE_FILE=${{ env.LICENSE_SERVER_PORT }}@${{ secrets.LICENSE_SERVER }} \
62+
--volume ${PWD}:/home/stk/pystk \
63+
${{ env.STK_PYTHON_IMAGE }}
64+
65+
- name: "Install Pandoc inside the container"
66+
run: |
67+
docker exec \
68+
--user root \
69+
--workdir ${{ env.PYSTK_DIR }} \
70+
${{ env.STK_CONTAINER }} /bin/bash -c \
71+
"yum install -y epel-release && yum install -y pandoc --enablerepo=epel"
72+
73+
- name: "Install Tox"
74+
run: |
75+
docker exec \
76+
--workdir ${{ env.PYSTK_DIR }} \
77+
${{ env.STK_CONTAINER }} /bin/bash -c \
78+
"python -m pip install tox && rm -rf .tox"
79+
80+
- name: "Build the full documentation"
81+
run: |
82+
docker exec \
83+
--workdir ${{ env.PYSTK_DIR }} \
84+
${{ env.STK_CONTAINER }} /bin/bash -c \
85+
"export BUILD_API=true BUILD_EXAMPLES=true && tox -e doc"
86+
87+
- name: "Upload combined artifacts"
88+
uses: actions/upload-artifact@v4
4789
with:
48-
python-version: ${{ env.MAIN_PYTHON_VERSION }}
49-
env:
50-
BUILD_API: true
51-
BUILD_EXAMPLES: true
90+
path: doc/_build/html
91+
name: documentation-html
92+
93+
- name: "Stop the container"
94+
if: always()
95+
run: |
96+
docker stop ${{ env.STK_CONTAINER }}
97+
docker logs ${{ env.STK_CONTAINER }}
98+
docker rm ${{ env.STK_CONTAINER }}
5299
53100
tests:
54101
name: "Tests Python ${{ matrix.python }}"

.github/workflows/ci_cd_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
steps.build-doc-with-api.outcome == 'success' ||
177177
steps.build-doc-minimum.outcome == 'success'
178178
run: |
179-
cp gh-pages/version/dev/examples.html doc/_build/html/examples.html
179+
cp -r gh-pages/version/dev/examples doc/_build/html/examples
180180
cp gh-pages/version/dev/index.html doc/_build/html/index.html
181181
182182
- name: "Upload combined artifacts"

.github/workflows/ci_cd_release.yml

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,65 @@ jobs:
4141

4242
doc-build:
4343
name: "Doc build"
44-
runs-on: ubuntu-latest
45-
needs: doc-style
44+
runs-on: [self-hosted, pystk]
45+
needs: [doc-style]
46+
timeout-minutes: 30
4647
steps:
47-
- name: "Building project documentation"
48-
uses: ansys/actions/doc-build@v5
48+
49+
- name: "Checkout the project"
50+
uses: actions/checkout@v4
51+
52+
- name: "Generate the name of the Docker image and the container"
53+
run: |
54+
python_image_name=${{ env.STK_DOCKER_IMAGE }}-python${{ env.MAIN_PYTHON_VERSION }}
55+
container_name=stk-python${{ env.MAIN_PYTHON_VERSION }}
56+
echo "STK_PYTHON_IMAGE=$python_image_name" >> $GITHUB_ENV
57+
echo "STK_CONTAINER=$container_name" >> $GITHUB_ENV
58+
59+
- name: "Start the container from the desired image"
60+
run: |
61+
docker run \
62+
--detach -it \
63+
--network="host" \
64+
--name ${{ env.STK_CONTAINER }} \
65+
--env ANSYSLMD_LICENSE_FILE=${{ env.LICENSE_SERVER_PORT }}@${{ secrets.LICENSE_SERVER }} \
66+
--volume ${PWD}:/home/stk/pystk \
67+
${{ env.STK_PYTHON_IMAGE }}
68+
69+
- name: "Install Pandoc inside the container"
70+
run: |
71+
docker exec \
72+
--user root \
73+
--workdir ${{ env.PYSTK_DIR }} \
74+
${{ env.STK_CONTAINER }} /bin/bash -c \
75+
"yum install -y epel-release && yum install -y pandoc --enablerepo=epel"
76+
77+
- name: "Install Tox"
78+
run: |
79+
docker exec \
80+
--workdir ${{ env.PYSTK_DIR }} \
81+
${{ env.STK_CONTAINER }} /bin/bash -c \
82+
"python -m pip install tox && rm -rf .tox"
83+
84+
- name: "Build the full documentation"
85+
run: |
86+
docker exec \
87+
--workdir ${{ env.PYSTK_DIR }} \
88+
${{ env.STK_CONTAINER }} /bin/bash -c \
89+
"export BUILD_API=true BUILD_EXAMPLES=true && tox -e doc"
90+
91+
- name: "Upload combined artifacts"
92+
uses: actions/upload-artifact@v4
4993
with:
50-
python-version: ${{ env.MAIN_PYTHON_VERSION }}
51-
env:
52-
BUILD_API: true
53-
BUILD_EXAMPLES: false
94+
path: doc/_build/html
95+
name: documentation-html
96+
97+
- name: "Stop the container"
98+
if: always()
99+
run: |
100+
docker stop ${{ env.STK_CONTAINER }}
101+
docker logs ${{ env.STK_CONTAINER }}
102+
docker rm ${{ env.STK_CONTAINER }}
54103
55104
tests:
56105
name: "Tests Python ${{ matrix.python }}"

examples/stk_engine/solar_panel_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def __init__(self):
2424
self.window.protocol("WM_DELETE_WINDOW", self._exit)
2525
self.controlFrame = tk.Frame()
2626
self.globeControl = GlobeControl(self.controlFrame, width=320, height=200)
27-
self.globeControl.back_color = Color.FromRGB(217, 217, 217)
27+
self.globeControl.back_color = Color.from_rgb(217, 217, 217)
2828
self.globeControl.pack(fill=tk.BOTH, expand=tk.YES, side=tk.TOP)
2929
self.gfxAnalysisControl = GfxAnalysisControl(self.controlFrame, width=320, height=200)
30-
self.gfxAnalysisControl.back_color = Colors.FromRGB(217, 217, 217)
30+
self.gfxAnalysisControl.back_color = Colors.from_rgb(217, 217, 217)
3131
self.gfxAnalysisControl.pack(fill=tk.BOTH, expand=tk.YES, side=tk.TOP)
3232
self.controlFrame.pack(fill=tk.BOTH, expand=tk.YES, side=tk.LEFT)
3333
self.buttonFrame = tk.Frame()

examples/stk_engine/stk_tutorial.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ def __init__(self):
4848
self.window.protocol("WM_DELETE_WINDOW", self._exit)
4949
self.controlFrame = tk.Frame()
5050
self.mapControl = MapControl(self.controlFrame, width=640, height=360)
51-
self.mapControl.back_color = Color.FromRGB(217, 217, 217)
51+
self.mapControl.back_color = Color.from_rgb(217, 217, 217)
5252
self.mapControl.pack(fill=tk.BOTH, expand=tk.YES, side=tk.TOP)
5353
self.globeControl = GlobeControl(
5454
self.controlFrame, width=640, height=360
5555
)
56-
self.globeControl.back_color = Color.FromRGB(217, 217, 217)
56+
self.globeControl.back_color = Color.from_rgb(217, 217, 217)
5757
self.globeControl.pack(fill=tk.BOTH, expand=tk.YES, side=tk.TOP)
5858
self.controlFrame.pack(fill=tk.BOTH, expand=tk.YES, side=tk.LEFT)
5959
self.buttonFrame = tk.Frame()
@@ -659,14 +659,14 @@ def _configure_display_intervals(self):
659659
gfxInterval = customAtt.Intervals.Add(
660660
"1 Jul 2023 11:30:00.000", "1 Jul 2023 12:00:00.000"
661661
)
662-
gfxInterval.GfxAttributes.Color = Colors.FromRGB(156, 49, 24)
662+
gfxInterval.GfxAttributes.Color = Colors.from_rgb(156, 49, 24)
663663
gfxInterval.GfxAttributes.IsVisible = True
664664
gfxInterval.GfxAttributes.Inherit = True
665665

666666
gfxInterval = customAtt.Intervals.Add(
667667
"1 Jul 2023 23:30:00.000", "1 Jul 2023 24:00:00.000"
668668
)
669-
gfxInterval.GfxAttributes.Color = Colors.FromRGB(116, 80, 94)
669+
gfxInterval.GfxAttributes.Color = Colors.from_rgb(116, 80, 94)
670670
gfxInterval.GfxAttributes.IsVisible = True
671671
gfxInterval.GfxAttributes.Inherit = True
672672
self.root.rewind()

examples/stk_engine/stk_vgt_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def __init__(self):
165165
self.increaseSpeedBtn.pack(side=tk.LEFT)
166166
self.animationBtnFrame.pack(side=tk.TOP, anchor=tk.W)
167167
self.globeControl = GlobeControl(self.window, width=873, height=429)
168-
self.globeControl.back_color = Color.FromRGB(217, 217, 217)
168+
self.globeControl.back_color = Color.from_rgb(217, 217, 217)
169169
self.globeControl.pack(fill=tk.BOTH, expand=tk.YES, side=tk.TOP)
170170
self.lowerFrame = tk.Frame(self.window, width=873)
171171
self.descriptionFrame = tk.LabelFrame(self.lowerFrame, text="Description")

src/ansys/stk/core/internal/grpcutil.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def _grpc_post_process_return_vals(return_vals, marshallers, *input_args):
6868
temp_return_list.append(marshaller(return_val).python_val)
6969
elif marshaller is OLEColorArg:
7070
c = Color()
71-
c._FromOLECOLOR(return_val)
71+
c._from_ole_color(return_val)
7272
temp_return_list.append(c)
7373
else:
7474
temp_return_list.append(return_val)
@@ -374,7 +374,7 @@ def _marshall_input_arg(self, arg:typing.Any, dest_grpc_arg) -> None:
374374
elif val is None:
375375
rpc_val.null.SetInParent()
376376
elif type(val) == Color:
377-
rpc_val.unsigned_int_val = val._ToOLECOLOR()
377+
rpc_val.unsigned_int_val = val._to_ole_color()
378378
dest_grpc_arg.values.append(rpc_val)
379379

380380
def invoke(self, p:AgGrpcServices_pb2.STKObject, guid:str, method_offset, *args) -> typing.Any:

src/ansys/stk/core/internal/marshall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def __init__(self, val: agcolor.Color = None):
589589
else:
590590
if type(val) == agcolor.ColorRGBA:
591591
raise STKColorError("Argument type is RGB only, use Color class instead of ColorRGBA.")
592-
self.OLE_COLOR = agcom.OLE_COLOR(val._ToOLECOLOR())
592+
self.OLE_COLOR = agcom.OLE_COLOR(val._to_ole_color())
593593
def __enter__(self):
594594
return self
595595
def __exit__(self, type, value, tb):
@@ -600,7 +600,7 @@ def com_val(self) -> agcom.OLE_COLOR:
600600
@property
601601
def python_val(self) -> agcolor.Color:
602602
c = agcolor.Color()
603-
c._FromOLECOLOR(self.OLE_COLOR.value)
603+
c._from_ole_color(self.OLE_COLOR.value)
604604
return c
605605

606606
class VariantBoolArg(object):

0 commit comments

Comments
 (0)