Skip to content

Commit

Permalink
Update initial documentation
Browse files Browse the repository at this point in the history
Updates to RST so code blocks show, and correct from 'import pyconceptev-core.main' to 'import ansys.conceptev.core.main'
  • Loading branch information
james-packer authored Mar 7, 2024
1 parent 515d967 commit e2c7a20
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ ConceptEV Specific Instructions


You need to:
- `Install the library`
- `Configure Session using .env file`
- `Get a token`
- `Create a client`
- `Understand the API` at https://dev-conceptev.awsansys3np.onscale.com/api/docs

* `Install the library`
* `Configure Session using .env file`
* `Get a token`
* `Create a client`
* `Understand the API` at https://dev-conceptev.awsansys3np.onscale.com/api/docs

Install the library
^^^^^^^^^^^^^
Expand All @@ -36,6 +37,7 @@ Install the library
pipx install poetry
#. Install dependencies using poetry:

.. code:: bash
poetry install
Expand All @@ -44,20 +46,22 @@ Configure Session using .env file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

you need to create a .env file to keep your password and other configurable data it should look something like this:

.. code-block:: bash
CONCEPTEV_USERNAME = joe.blogs@my_work.com
CONCEPTEV_PASSWORD = sup3r_s3cr3t_passw0rd
OCM_URL = https://test.portal.onscale.com/api
CONCEPTEV_URL = https://dev-conceptev.awsansys3np.onscale.com/api
Get a token
^^^^^^^^^^^

Import the main module and use get_token this should return a random string from the servers to get you access.

Check failure on line 60 in doc/source/index.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/index.rst#L60

[Vale.Spelling] Did you really mean 'get_token'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'get_token'?", "location": {"path": "doc/source/index.rst", "range": {"start": {"line": 60, "column": 32}}}, "severity": "ERROR"}

.. code-block:: python
import pyconceptev-core.main as pyconceptev #Test this
import ansys.conceptev.core.main as pyconceptev
token = pyconceptev.get_token()
Expand All @@ -67,7 +71,8 @@ Create a client
You need to create a client that can access and talk to the api. You can use the health check api to check your connection.

Check failure on line 71 in doc/source/index.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/index.rst#L71

[Vale.Spelling] Did you really mean 'api'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'api'?", "location": {"path": "doc/source/index.rst", "range": {"start": {"line": 71, "column": 61}}}, "severity": "ERROR"}

Check warning on line 71 in doc/source/index.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/index.rst#L71

[Google.WordList] Use 'select' instead of 'check'.
Raw output
{"message": "[Google.WordList] Use 'select' instead of 'check'.", "location": {"path": "doc/source/index.rst", "range": {"start": {"line": 71, "column": 89}}}, "severity": "WARNING"}

Check warning on line 71 in doc/source/index.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/index.rst#L71

[Google.WordList] Use 'select' instead of 'check'.
Raw output
{"message": "[Google.WordList] Use 'select' instead of 'check'.", "location": {"path": "doc/source/index.rst", "range": {"start": {"line": 71, "column": 102}}}, "severity": "WARNING"}

.. code-block:: python
import pythonconceptev-core.main as pyconceptev
import ansys.conceptev.core.main as pyconceptev
with pyconceptev.create_client(token,concept_id) as client:
print(pyconceptev.read(client,"/health"))
Expand All @@ -80,7 +85,9 @@ This shows you which verbs and which routes/paths are available and what inputs/
You can use the verb functions created in this module to make things simpler.

To create a configuration we need to use the verb `post` with route `/configurations` and add the `data` from the schema.

Check warning on line 87 in doc/source/index.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/index.rst#L87

[Google.We] Try to avoid using first-person plural like 'we'.
Raw output
{"message": "[Google.We] Try to avoid using first-person plural like 'we'.", "location": {"path": "doc/source/index.rst", "range": {"start": {"line": 87, "column": 27}}}, "severity": "WARNING"}

.. code-block:: python
pyconcetpev.create(client,'/configurations',data={"name": "New Aero Config",
"drag_coefficient": 1,
"cross_sectional_area": 2,
Expand Down

0 comments on commit e2c7a20

Please sign in to comment.