Skip to content

Commit

Permalink
Merge branch 'main' into release/0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RobPasMue committed Apr 18, 2023
2 parents 8989008 + 79fc47c commit 01318dc
Show file tree
Hide file tree
Showing 35 changed files with 1,004 additions and 202 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ updates:
- "dependencies"
ignore:
- dependency-name: "grpcio"
assignees:
assignees:
- "pyansys-ci-bot"

- package-ecosystem: "github-actions"
Expand All @@ -18,5 +18,5 @@ updates:
interval: "daily"
labels:
- "maintenance"
assignees:
assignees:
- "pyansys-ci-bot"
7 changes: 6 additions & 1 deletion .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

build-windows:
name: Building Geometry Service - Windows
runs-on: [self-hosted, pygeometry-ci-1]
runs-on: [self-hosted, pygeometry]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -56,6 +56,11 @@ jobs:
run: |
docker build -f Dockerfile.windows -t ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }} .
- name: Check location of self-hosted runner and define license server accordingly
if: runner.name == 'pygeometry-ci-1'
run:
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Launch Geometry service
run: |
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}
Expand Down
42 changes: 13 additions & 29 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
should-release:
python-version: ['3.8', '3.9', '3.10', '3.11']
should-release:
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
exclude:
- should-release: false
Expand Down Expand Up @@ -110,25 +110,17 @@ jobs:
- name: Download Geometry service container (if needed)
run: docker pull $env:ANSRV_GEO_IMAGE_WINDOWS_TAG

- name: Check runner type
- name: Check location of self-hosted runner and define license server accordingly
if: runner.name == 'pygeometry-ci-1'
env:
INTERNAL_DOCKER_EXTRA_ENVS: ${{ secrets.INTERNAL_DOCKER_EXTRA_ENVS }}
run: |
$env:INTERNAL_DOCKER_EXTRA_ENVS | Out-File -FilePath env.list -Encoding UTF8
- name: Check runner type (not needed)
if: runner.name != 'pygeometry-ci-1'
run: |
echo "" | Out-File -FilePath env.list -Encoding UTF8
run:
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Start Geometry service and verify start
run: |
.\.venv\Scripts\Activate.ps1
$env:ANSRV_GEO_PORT_MAP = $env:ANSRV_GEO_PORT + ":50051"
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER --env-file .\env.list -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
- name: Restore images cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -212,23 +204,15 @@ jobs:
- name: Download Geometry service container (if needed)
run: docker pull $env:ANSRV_GEO_IMAGE_WINDOWS_TAG

- name: Check runner type
- name: Check location of self-hosted runner and define license server accordingly
if: runner.name == 'pygeometry-ci-1'
env:
INTERNAL_DOCKER_EXTRA_ENVS: ${{ secrets.INTERNAL_DOCKER_EXTRA_ENVS }}
run: |
$env:INTERNAL_DOCKER_EXTRA_ENVS | Out-File -FilePath env.list -Encoding UTF8
- name: Check runner type (not needed)
if: runner.name != 'pygeometry-ci-1'
run: |
echo "" | Out-File -FilePath env.list -Encoding UTF8
run:
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Start Geometry service and verify start
run: |
.\.venv\Scripts\Activate.ps1
$env:ANSRV_GEO_PORT_MAP = $env:ANSRV_GEO_PORT + ":50051"
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER --env-file .\env.list -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
- name: Build the documentation (HTML)
Expand Down Expand Up @@ -344,7 +328,7 @@ jobs:
name: Fetch release artifacts
needs: [testing-windows, testing-linux, docs]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on:
runs-on:
group: ansys-internal
labels: [self-hosted, Windows, signtool]

Expand All @@ -353,7 +337,7 @@ jobs:
run: |
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/DockerWindows.zip --output windows-binaries.zip
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/DockerLinux.zip --output linux-binaries.zip
- name: Upload Windows binaries as workflow artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# Label based on branch name
- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'doc') ||
startsWith(github.event.pull_request.head.ref, 'doc') ||
startsWith(github.event.pull_request.head.ref, 'docs')
with:
labels: documentation
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Suggest to add labels
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
# Execute only when no labels have been applied to the pull request
if: toJSON(github.event.pull_request.labels.*.name) == '{}'
with:
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/nightly_docker_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,15 @@ jobs:
docker image rm $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
docker pull $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
- name: Check runner type
- name: Check location of self-hosted runner and define license server accordingly
if: runner.name == 'pygeometry-ci-1'
env:
INTERNAL_DOCKER_EXTRA_ENVS: ${{ secrets.INTERNAL_DOCKER_EXTRA_ENVS }}
run: |
$env:INTERNAL_DOCKER_EXTRA_ENVS | Out-File -FilePath env.list -Encoding UTF8
- name: Check runner type (not needed)
if: runner.name != 'pygeometry-ci-1'
run: |
echo "" | Out-File -FilePath env.list -Encoding UTF8
run:
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Start Geometry service and verify start
run: |
.\.venv\Scripts\Activate.ps1
$env:ANSRV_GEO_PORT_MAP = $env:ANSRV_GEO_PORT + ":50051"
docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER --env-file .\env.list -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }} python -c "from ansys.geometry.core.connection.validate import validate; validate()"
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
- name: Run PyGeometry tests
Expand Down
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:

- repo: https://github.com/psf/black
rev: 23.1.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
rev: 23.3.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
hooks:
- id: black

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.1.0]
additional_dependencies: [black==23.3.0]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
Expand Down Expand Up @@ -40,6 +40,8 @@ repos:
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
- id: trailing-whitespace

# this validates our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
Expand Down
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ Installing PyGeometry in developer mode allows
you to modify the source and enhance it.

.. note::

Before contributing to the project, ensure that you are thoroughly familiar
with the `PyAnsys Developer's Guide`_.

To install PyGeometry in developer mode, perform these steps:

#. Clone the ``pygeometry`` repository:
Expand Down Expand Up @@ -222,7 +222,7 @@ To install PyGeometry in developer mode, perform these steps:
#. Install the project in editable mode:

.. code:: bash
# Install the minimum requirements
python -m pip install -e .
Expand All @@ -244,14 +244,14 @@ archive from the `Releases Page <https://github.com/pyansys/pygeometry/releases>
corresponding machine architecture.

Each wheelhouse archive contains all the Python wheels necessary to install PyGeometry from scratch on Windows,
Linux, and MacOS from Python 3.7 to 3.11. You can install this on an isolated system with a fresh Python
Linux, and MacOS from Python 3.8 to 3.11. You can install this on an isolated system with a fresh Python
installation or on a virtual environment.

For example, on Linux with Python 3.7, unzip the wheelhouse archive and install it with:
For example, on Linux with Python 3.8, unzip the wheelhouse archive and install it with:

.. code:: bash
unzip ansys-geometry-core-v0.2.3-wheelhouse-Linux-3.7.zip wheelhouse
unzip ansys-geometry-core-v0.2.3-wheelhouse-Linux-3.8.zip wheelhouse
pip install ansys-geometry-core -f wheelhouse --no-index --upgrade --ignore-installed
If you're on Windows with Python 3.9, unzip to a wheelhouse directory and install using the preceding command.
Expand All @@ -263,7 +263,7 @@ Testing

This project takes advantage of `tox`_. This tool automate common
development tasks (similar to Makefile), but it is oriented towards Python
development.
development.

Using ``tox``
^^^^^^^^^^^^^
Expand All @@ -279,7 +279,7 @@ The following environments commands are provided:
- **tox -e py-coverage**: Checks for unit testing and code coverage.
- **tox -e doc**: Checks for documentation building process.

.. admonition:: pyvista-pytest plugin
.. admonition:: pyvista-pytest plugin

This plugin facilitates the comparison of the images produced in PyGeometry for testing the plots.
If you are changing the images, use flag ``--reset_image_cache`` which is not recommended except
Expand Down Expand Up @@ -331,7 +331,7 @@ the building requirements and then executing the build module:

.. code:: bash
python -m pip install -U pip
python -m pip install -U pip
python -m build
python -m twine check dist/*
Expand Down
2 changes: 1 addition & 1 deletion doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ goto end
goto build-examples-py

:clean
rmdir /s /q %BUILDDIR% > /NUL 2>&1
rmdir /s /q %BUILDDIR% > /NUL 2>&1
for /d /r %SOURCEDIR% %%d in (_autosummary) do @if exist "%%d" rmdir /s /q "%%d"
goto end

Expand Down
Binary file modified doc/source/_static/thumbnails/101_getting_started.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Overall guidance on contributing to a PyAnsys library appears in the
in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar
with it and all `How-to <https://dev.docs.pyansys.com/how-to/index.html>`_ pages
before attempting to contribute to PyGeometry.

The following contribution information is specific to PyGeometry.

Clone the repository
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/01_getting_started/04_modeling.mystnb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ More features of each of these objects will be shown in upcoming demos.

Finally, it is highly recommended once you finish interacting with your modeling
service, you close the active server session. This will allow to free resources
wherever the service is running on.
wherever the service is running on.

In order to close the session, do as follows.

Expand Down
6 changes: 3 additions & 3 deletions doc/source/examples/02_sketching/dynamic_sketch_plane.mystnb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ from ansys.geometry.core.sketch import Sketch

## Define a sketch profile for the PCB

You can create, modify, and plot ``Sketch`` instances independent of supporting
You can create, modify, and plot ``Sketch`` instances independent of supporting
Geometry service instances.

Create a sketch outline of individual ``Segment`` and ``Arc`` objects with two
Expand Down Expand Up @@ -75,8 +75,8 @@ sketch.plot()

## Extrude multiple bodies with a single sketch

Establish a server connection and use the single sketch profile to extrude
the board profile at multiple Z-offsets. A named selection is created from the
Establish a server connection and use the single sketch profile to extrude
the board profile at multiple Z-offsets. A named selection is created from the
resulting list of layer bodies.

Note that translating the sketch plane prior to extrusion is more effective (10 server calls)
Expand Down
4 changes: 2 additions & 2 deletions doc/source/examples/03_modeling/design_organization.mystnb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The ``Design`` instance creates a design project within the remote Geometry serv
complete all CAD modeling against.

You can organize all solid and surface bodies in each design within a customizable
component hierarchy. A component is simply an organization mechanism.
component hierarchy. A component is simply an organization mechanism.

The top-level design node and each child-component node can have one or more bodies assigned
and one or more components assigned.
Expand All @@ -44,7 +44,7 @@ from ansys.geometry.core.sketch import Sketch
## Organize design

Extrude two sketches to create bodies. Assign the cylinder to the
top-level design component. Assign the slot to the component nested
top-level design component. Assign the slot to the component nested
one level beneath the top-level design component.

```{code-cell} ipython3
Expand Down
10 changes: 5 additions & 5 deletions doc/source/examples/03_modeling/plate_with_hole.mystnb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The projection is at the center of the face. The default projection depth is thr

Start by performing required imports.

```{code-cell} ipython3
```{code-cell} ipython3
import numpy as np
from pint import Quantity

Expand All @@ -47,7 +47,7 @@ a box on the center, and a circle at its four corners.
You can use a single sketch instance for multiple design operations such as extruding a body,
projecting a profile, or imprinting curves.

```{code-cell} ipython3
```{code-cell} ipython3
sketch = Sketch()
(sketch.segment(Point2D([-4, 5], unit=UNITS.m), Point2D([4, 5], unit=UNITS.m))
.segment_to_point(Point2D([4, -5], unit=UNITS.m))
Expand All @@ -63,8 +63,8 @@ sketch = Sketch()

## Create the design by extruding the sketch

Establish a server connection and use the single sketch profile to extrude
the base component at the Z axis. A named selection is created from the
Establish a server connection and use the single sketch profile to extrude
the base component at the Z axis. A named selection is created from the
resulting list of bodies. In only three server calls, the design extrudes
the four segments with the desired thickness.

Expand Down Expand Up @@ -102,7 +102,7 @@ design.plot()

## Extrude from face to create body

You can extrude a face profile by a given distance to create a solid body.
You can extrude a face profile by a given distance to create a solid body.
There are no modifications against the body containing the source face.

```{code-cell} ipython3
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/03_modeling/tessellation_usage.mystnb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ body = comp.extrude_sketch("Body", sketch=sketch_2, distance=10 * UNITS.m)
## Tessellation of the component as two merged bodies

Tessellate the component and merge each body into a single dataset.
This effectively combines all the faces of each individual body into a
This effectively combines all the faces of each individual body into a
single dataset without separating faces.

```{code-cell} ipython3
Expand Down
Loading

0 comments on commit 01318dc

Please sign in to comment.