Skip to content

Commit 2d30267

Browse files
RobPasMueAlejandroFernandezLucesPipKat
authored
feat: improved getting-started section (#732)
Co-authored-by: afernand <alex.fernandezluces@ansys.com> Co-authored-by: Alex Fernandez <21alex295@gmail.com> Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com>
1 parent 6724969 commit 2d30267

File tree

16 files changed

+587
-356
lines changed

16 files changed

+587
-356
lines changed

README.rst

Lines changed: 5 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -41,120 +41,13 @@ PyAnsys Geometry is a Python client library for the Ansys Geometry service.
4141
Usage
4242
-----
4343

44-
There are two different ways of getting started with the Geometry service and its client-library, PyAnsys Geometry.
44+
There are different ways of getting started with using the Geometry service and its client library, PyAnsys Geometry.
4545

46-
Using PyAnsys Geometry launcher
47-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46+
For more information, see
47+
`Getting Started <https://geometry.docs.pyansys.com/version/stable/getting_started/index.html>`_ documentation.
4848

49-
PyAnsys Geometry is provided with an internal launcher that is capable of handling the specifics of
50-
launching the Geometry service locally. The only requirements are that:
51-
52-
* Docker is installed on your machine.
53-
* You have access to the Geometry service image.
54-
55-
.. note::
56-
57-
The Geometry service is mainly available as a Windows Docker image. The development
58-
team is working on getting the Linux Docker container available as soon as possible. In the meantime,
59-
make sure that your Docker engine is configured to run Windows Docker images.
60-
61-
Using the GitHub Container Registry image
62-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63-
64-
First, bear in mind that you have to be `authenticated to ghcr.io
65-
<https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry>`_.
66-
Once authenticated, please proceed to download the Geometry service Docker image:
67-
68-
.. code:: bash
69-
70-
docker pull ghcr.io/ansys/geometry:<tag>
71-
72-
The following OS-dependent tags are available:
73-
74-
* ``windows-latest``
75-
* ``windows-latest-unstable``
76-
* ``linux-latest``
77-
* ``linux-latest-unstable``
78-
79-
Build your own Geometry service image
80-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81-
82-
Access the ``docker`` folder in this repository and go through the instructions
83-
presented in the `main README file <https://github.com/ansys/pyansys-geometry/blob/main/docker/README.rst>`_.
84-
85-
Launching the Geometry service image
86-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87-
88-
Next, you will be ready to run the Geometry service directly from PyAnsys Geometry:
89-
90-
.. code:: python
91-
92-
from ansys.geometry.core.connection import launch_modeler
93-
94-
modeler = launch_modeler()
95-
96-
The previous ``launch_modeler()`` method will launch the Geometry service under the default
97-
conditions. For more configurability, please use ``launch_local_modeler()``.
98-
99-
Manual service launch
100-
^^^^^^^^^^^^^^^^^^^^^
101-
102-
First, start the Geometry service locally. If you have Docker installed and have
103-
`authenticated to ghcr.io`_, you can start the service locally using Docker with:
104-
105-
.. code:: bash
106-
107-
docker run --name ans_geo -e LICENSE_SERVER=<LICENSE-SERVER> -p 50051:50051 ghcr.io/ansys/geometry:<TAG>
108-
109-
The Geometry service has a set of environment variables that are **mandatory**:
110-
111-
* ``LICENSE_SERVER``: the license server (IP, DNS) to which the Geometry service shall connect. For example, ``127.0.0.1``.
112-
113-
Other optional environment variables are:
114-
115-
* ``ENABLE_TRACE``: whether to set up the trace level for debugging purposes. Expects either ``1`` or ``0``.
116-
By default, ``0`` (which means it is not activated).
117-
* ``LOG_LEVEL``: sets the Geometry service logging level. By default, ``2``.
118-
119-
Next, connect to the service with:
120-
121-
.. code:: python
122-
123-
from ansys.geometry.core import Modeler
124-
125-
modeler = Modeler()
126-
127-
By default ``Modeler`` connects to ``127.0.0.1`` (``'localhost'``) on
128-
port ``50051``. You can change this by modifying the ``host`` and ``port``
129-
parameters of ``Modeler``, but note that you must also modify
130-
your ``docker run`` command by changing ``<HOST-PORT>:50051``.
131-
132-
If you want to change the defaults, modify the following environment variables:
133-
134-
**On Linux/Mac OS**
135-
136-
.. code::
137-
138-
export ANSRV_GEO_HOST=127.0.0.1
139-
export ANSRV_GEO_PORT=50051
140-
141-
**On Windows Powershell**
142-
143-
.. code::
144-
145-
$env:ANSRV_GEO_HOST="127.0.0.1"
146-
$env:ANSRV_GEO_PORT=50051
147-
148-
**On Windows CMD**
149-
150-
.. code::
151-
152-
SET ANSRV_GEO_HOST=127.0.0.1
153-
SET ANSRV_GEO_PORT=50051
154-
155-
156-
Install the package
157-
-------------------
49+
Installation
50+
------------
15851

15952
PyAnsys Geometry has three installation modes: user, developer, and offline.
16053

doc/make.bat

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ if "%SPHINXOPTS%" == "" (
1313
set SOURCEDIR=source
1414
set BUILDDIR=_build
1515

16+
REM TODO: these lines of code should be removed once the feature branch is merged
17+
for /f %%i in ('pip freeze ^| findstr /c:"sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi"') do set is_custom_sphinx_autoapi_installed=%%i
18+
if NOT "%is_custom_sphinx_autoapi_installed%" == "sphinx-autoapi" (
19+
pip uninstall --yes sphinx-autoapi
20+
pip install "sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi@feat/single-page-option")
21+
REM TODO: these lines of code should be removed once the feature branch is merged
22+
1623
if "%1" == "" goto help
1724
if "%1" == "clean" goto clean
1825
if "%1" == "pdf" goto pdf
@@ -35,10 +42,6 @@ if errorlevel 9009 (
3542
goto end
3643

3744
:html
38-
REM TODO: these lines of code should be removed once the feature branch is merged
39-
pip uninstall --yes sphinx-autoapi
40-
pip install "sphinx-autoapi @ git+https://github.com/ansys/sphinx-autoapi@feat/single-page-option"
41-
REM TODO: these lines of code should be removed once the feature branch is merged
4245
%SPHINXBUILD% -M html %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
4346
%SPHINXBUILD% -M linkcheck %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
4447
goto build-examples-py
@@ -52,10 +55,6 @@ goto end
5255
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
5356

5457
:pdf
55-
REM TODO: these lines of code should be removed once the feature branch is merged
56-
pip uninstall --yes sphinx-autoapi
57-
pip install "sphinx-autoapi @ git+https://github.com/jorgepiloto/sphinx-autoapi@feat/single-page-option"
58-
REM TODO: these lines of code should be removed once the feature branch is merged
5958
%SPHINXBUILD% -M latex %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
6059
cd "%BUILDDIR%\latex"
6160
for %%f in (*.tex) do (

doc/source/_static/custom.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515

1616
/* Remove once implemented in ansys-sphinx-theme*/
1717

18-
.sd-card {
19-
border-radius: 0;
20-
padding: 20px 10px 20px 10px;
21-
}
22-
2318
.sd-card .sd-card-img-top {
2419
height: 100px;
2520
width: 100px;

doc/source/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
# variables are the title of pdf, watermark
210210
latex_elements = {"preamble": latex.generate_preamble(html_title)}
211211

212-
linkcheck_exclude_documents = ["index", "getting_started/creating_local_session"]
212+
linkcheck_exclude_documents = ["index", "getting_started/local/index"]
213213

214214
# -- Declare the Jinja context -----------------------------------------------
215215
exclude_patterns = []
@@ -227,6 +227,12 @@
227227
"build_api": BUILD_API,
228228
"build_examples": BUILD_EXAMPLES,
229229
},
230+
"linux_containers": {
231+
"add_windows_warnings": False,
232+
},
233+
"windows_containers": {
234+
"add_windows_warnings": True,
235+
},
230236
}
231237

232238

0 commit comments

Comments
 (0)