Skip to content

Commit a17b77e

Browse files
committed
Merge branch 'main' into release/0.2
2 parents 955ad43 + 31765b1 commit a17b77e

File tree

21 files changed

+488
-180
lines changed

21 files changed

+488
-180
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
repos:
22

33
- repo: https://github.com/psf/black
4-
rev: 22.12.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
4+
rev: 23.1.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
55
hooks:
66
- id: black
77

88
- repo: https://github.com/adamchainz/blacken-docs
99
rev: 1.13.0
1010
hooks:
1111
- id: blacken-docs
12-
additional_dependencies: [black==22.12.0]
12+
additional_dependencies: [black==23.1.0]
1313

1414
- repo: https://github.com/pycqa/isort
1515
rev: 5.12.0

AUTHORS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Authors
2+
3+
## Project Lead
4+
5+
* [Roberto Pastor](https://github.com/RobPasMue)
6+
7+
## Contributors
8+
9+
* [Jonah Boling](https://github.com/jonahrb)
10+
* [Matteo Bini](https://github.com/b-matteo)
11+
* [Chad Queen](https://github.com/chadqueen)
12+
* [Revathy Venugopal](https://github.com/Revathyvenugopal162)
13+
* [Maxime Rey](https://github.com/MaxJPRey)
14+
* [Alexander Kaszynski](https://github.com/akaszynski)
15+
* [Jorge Martínez](https://github.com/jorgepiloto)
16+
* [Alejandro Fernández](https://github.com/AlejandroFernandezLuces)

CONTRIBUTING.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1-
# Contributing
1+
# Contributing
22

3+
We absolutely welcome any code contributions and we hope that this
4+
guide will facilitate an understanding of the PyGeometry code
5+
repository. It is important to note that while the PyGeometry software
6+
package is maintained by ANSYS and any submissions will be reviewed
7+
thoroughly before merging, we still seek to foster a community that can
8+
support user questions and develop new features to make this software
9+
a useful tool for all users. As such, we welcome and encourage any
10+
questions or submissions to this repository.
11+
12+
For contributing to this project, please refer to the [PyAnsys Developer's Guide].
13+
Further information about contributing to PyGeometry can be found in [Contributing].
14+
15+
[PyAnsys Developer's Guide]: https://dev.docs.pyansys.com/index.html
16+
[Contributing]: https://geometry.docs.pyansys.com/dev/contributing.html

README.rst

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,14 @@ If you want to change the defaults, modify the following environment variables:
119119
export ANSRV_GEO_HOST=127.0.0.1
120120
export ANSRV_GEO_PORT=50051
121121
122-
**On Windows**
122+
**On Windows Powershell**
123+
124+
.. code::
125+
126+
$env:ANSRV_GEO_HOST="127.0.0.1"
127+
$env:ANSRV_GEO_PORT=50051
128+
129+
**On Windows CMD**
123130

124131
.. code::
125132
@@ -182,6 +189,12 @@ To install PyGeometry in developer mode, perform these steps:
182189
183190
git clone https://github.com/pyansys/pygeometry
184191
192+
#. Access the ``pygeometry`` directory where the repository has been cloned:
193+
194+
.. code:: bash
195+
196+
cd pygeometry
197+
185198
#. Create a clean Python virtual environment and activate it:
186199

187200
.. code:: bash
@@ -204,18 +217,21 @@ To install PyGeometry in developer mode, perform these steps:
204217
205218
python -m pip install -U pip tox
206219
207-
208220
#. Install the project in editable mode:
209221

210222
.. code:: bash
211-
212-
python -m pip install ansys-geometry-core
213-
214-
#. Verify your development installation by running:
223+
224+
# Install the minimum requirements
225+
python -m pip install -e .
215226
216-
.. code:: bash
217-
218-
tox
227+
# Install the minimum + tests requirements
228+
python -m pip install -e .[tests]
229+
230+
# Install the minimum + doc requirements
231+
python -m pip install -e .[doc]
232+
233+
# Install the all requirements
234+
python -m pip install -e .[tests,doc]
219235
220236
Install in offline mode
221237
^^^^^^^^^^^^^^^^^^^^^^^

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
project = "ansys-geometry-core"
2323
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
2424
author = "ANSYS, Inc."
25-
release = version = "0.2.0"
25+
release = version = __version__
2626
cname = os.getenv("DOCUMENTATION_CNAME", default="nocname.com")
2727

2828
# Select desired logo, theme, and declare the html title

doc/source/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Documentation for the latest stable release of PyGeometry is hosted at
4343
`PyGeometry Documentation <https://geometry.docs.pyansys.com>`_.
4444

4545
Documentation for the latest development version, which tracks the
46-
``main`` branch, is hosted at `Development PyGeometry Documentation <https://dev.geometry.docs.pyansys.com/>`_.
46+
``main`` branch, is hosted at `Development PyGeometry Documentation <https://geometry.docs.pyansys.com/dev/>`_.
4747
This version is automatically kept up to date via GitHub actions.
4848

4949
Code style

doc/source/getting_started/docker.rst

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,89 @@
1+
.. _ref_docker:
2+
13
Geometry service using Docker
24
=============================
35

6+
Docker
7+
------
8+
9+
Ensure that the machine in which the Geometry service should run has Docker installed. Otherwise,
10+
please install `Docker Engine <https://docs.docker.com/engine/install/>`_ from the previous link.
11+
12+
.. caution::
13+
At the moment, the Geometry service backend is only delivered as a Windows Docker container.
14+
As such, this container only runs on a Windows machine. Furthermore, it has also been observed
15+
that certain Docker Desktop versions for Windows are not properly configured for running Windows
16+
Docker containers. Refer to our section
17+
:ref:`Running the Geometry service Windows Docker container <ref_docker_windows>` for further details.
18+
19+
.. _ref_docker_windows:
20+
21+
Running the Geometry service Windows Docker container
22+
-----------------------------------------------------
23+
24+
For running the Windows Docker container of the Geometry service, please ensure that
25+
you follow the upcoming steps when installing Docker:
26+
27+
#. Install `Docker Desktop 4.13.1 <https://docs.docker.com/desktop/release-notes/#4131>`_ **or below**.
28+
It has been observed that newer versions present problems when running Windows Docker containers.
29+
30+
#. When prompted for ``Use WSL2 instead of Hyper-V (recommended)``, **deselect this option**.
31+
32+
#. Once the installation process finishes, open up Docker Desktop.
33+
34+
#. On ``Settings >> Software updates``, deselect ``Automatically check for updates``. Then, ``Apply & restart``.
35+
36+
#. On the Windows taskbar, go to the ``Show hidden icons`` section, right click on the Docker Desktop app and
37+
select ``Switch to Windows containers...``.
38+
39+
At this point, your Docker engine will support running Windows Docker containers. Next step will involve downloading
40+
the Geometry service Windows Docker image.
41+
442
Install the PyGeometry image
543
----------------------------
644

45+
Once you have Docker installed on your machine, the next steps involve pulling down the Geometry service
46+
Docker container.
47+
748
#. Using your GitHub credentials, download the Docker image from the `pygeometry <https://github.com/pyansys/pygeometry>`_ repository.
49+
850
#. If you have Docker installed, use a GitHub personal access token (PAT) with packages read permission to authorize Docker
951
to access this repository. For more information,
1052
see `creating a personal access token <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token>`_.
1153

1254
#. Save the token to a file:
1355

14-
.. code:: bash
56+
.. code-block:: bash
1557
16-
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > GH_TOKEN.txt
58+
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > GH_TOKEN.txt
1759
1860
#. Authorize Docker to access the repository:
1961

20-
.. code:: bash
62+
.. tab-set::
2163

22-
GH_USERNAME=<my-github-username>
23-
cat GH_TOKEN.txt | docker login docker.pkg.github.com -u $GH_USERNAME --password-stdin
64+
.. tab-item:: Linux/Mac
65+
66+
.. code-block:: bash
67+
68+
GH_USERNAME=<my-github-username>
69+
cat GH_TOKEN.txt | docker login ghcr.io -u $GH_USERNAME --password-stdin
70+
71+
.. tab-item:: Powershell
72+
73+
.. code-block:: bash
74+
75+
$env:GH_USERNAME=<my-github-username>
76+
cat GH_TOKEN.txt | docker login ghcr.io -u $env:GH_USERNAME --password-stdin
77+
78+
.. tab-item:: Windows CMD
79+
80+
.. code-block:: bash
81+
82+
SET GH_USERNAME=<my-github-username>
83+
type GH_TOKEN.txt | docker login ghcr.io -u %GH_USERNAME% --password-stdin
2484
25-
#. Pull the Geometry service locally using Docker with:
2685
86+
#. Pull the Geometry service locally using Docker with:
2787

2888
.. code:: bash
2989
@@ -72,7 +132,15 @@ Depending on the mechanism chosen to launch the Geometry service, you can set th
72132
export ANSRV_GEO_ENABLE_TRACE=0
73133
export ANSRV_GEO_LOG_LEVEL=2
74134
75-
.. tab-item:: Windows
135+
.. tab-item:: Powershell
136+
137+
.. code-block:: bash
138+
139+
$env:ANSRV_GEO_LICENSE_SERVER="127.0.0.1"
140+
$env:ANSRV_GEO_ENABLE_TRACE=0
141+
$env:ANSRV_GEO_LOG_LEVEL=2
142+
143+
.. tab-item:: Windows CMD
76144

77145
.. code-block:: bash
78146
@@ -150,7 +218,14 @@ If you want to change the defaults, modify environment variables and the
150218
export ANSRV_GEO_HOST=127.0.0.1
151219
export ANSRV_GEO_PORT=50051
152220
153-
.. tab-item:: Windows
221+
.. tab-item:: Powershell
222+
223+
.. code-block:: bash
224+
225+
$env:ANSRV_GEO_HOST="127.0.0.1"
226+
$env:ANSRV_GEO_PORT=50051
227+
228+
.. tab-item:: Windows CMD
154229

155230
.. code-block:: bash
156231

doc/source/getting_started/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ To use PyGeometry, you must have a local installation of `Docker <https://docs.d
77
To start the service locally, you must be `authenticated to ghcr.io
88
<https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry>`_.
99

10+
.. caution::
11+
PyGeometry is a client library that works with a Geometry service backend. This service is distributed
12+
as a Docker container. At the moment, there is only a Windows Docker container version available for this
13+
service. For more information please refer to the :ref:`Geometry service using Docker <ref_docker>` section.
14+
1015
.. toctree::
1116

1217
docker

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ classifiers = [
2525
]
2626

2727
dependencies = [
28-
"ansys-api-geometry==0.2.0",
28+
"ansys-api-geometry==0.2.1",
2929
"beartype>=0.11.0",
3030
"google-api-python-client>=1.7.11",
3131
"googleapis-common-protos>=1.52.0",
@@ -43,11 +43,11 @@ dependencies = [
4343
[project.optional-dependencies]
4444
tests = [
4545
"beartype==0.12.0",
46-
"google-api-python-client==2.75.0",
46+
"google-api-python-client==2.77.0",
4747
"googleapis-common-protos==1.58.0",
4848
"grpcio==1.50.0",
4949
"grpcio-health-checking==1.48.2",
50-
"numpy==1.24.1",
50+
"numpy==1.24.2",
5151
"Pint==0.20.1",
5252
"protobuf==3.20.3",
5353
"pyvista==0.37.0",
@@ -57,10 +57,10 @@ tests = [
5757
"docker==6.0.1",
5858
"pytest==7.2.1",
5959
"pytest-cov==4.0.0",
60-
"pytest-pyvista==0.1.5",
60+
"pytest-pyvista==0.1.6",
6161
]
6262
doc = [
63-
"ansys-sphinx-theme==0.8.1",
63+
"ansys-sphinx-theme==0.8.2",
6464
"ipyvtklink==0.2.3",
6565
"jupyter_sphinx==0.4.0",
6666
"jupytext==1.14.4",

src/ansys/geometry/core/connection/launcher.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
from beartype.typing import TYPE_CHECKING, Optional
33

44
from ansys.geometry.core.connection.defaults import DEFAULT_PORT
5-
from ansys.geometry.core.connection.local_instance import GeometryContainers, LocalDockerInstance
5+
from ansys.geometry.core.connection.local_instance import (
6+
_HAS_DOCKER,
7+
GeometryContainers,
8+
LocalDockerInstance,
9+
)
610
from ansys.geometry.core.logger import LOG as logger
711
from ansys.geometry.core.misc import check_type
812

@@ -41,12 +45,12 @@ def launch_modeler() -> "Modeler":
4145

4246
# Start PyGeometry with PyPIM if the environment is configured for it
4347
# and a directive on how to launch it was not passed.
44-
if pypim.is_configured():
48+
if _HAS_PIM and pypim.is_configured():
4549
logger.info("Starting Geometry service remotely. The startup configuration is ignored.")
4650
return launch_remote_modeler()
4751

4852
# Otherwise, we are in the "local Docker Container" scenario
49-
if LocalDockerInstance.is_docker_installed():
53+
if _HAS_DOCKER and LocalDockerInstance.is_docker_installed():
5054
logger.info("Starting Geometry service locally from Docker container.")
5155
return launch_local_modeler()
5256

@@ -142,6 +146,9 @@ def launch_local_modeler(
142146

143147
from ansys.geometry.core.modeler import Modeler
144148

149+
if not _HAS_DOCKER: # pragma: no cover
150+
raise ModuleNotFoundError("The package 'docker' is required to use this function.")
151+
145152
# Call the LocalDockerInstance ctor.
146153
local_instance = LocalDockerInstance(
147154
port=port,

0 commit comments

Comments
 (0)