Skip to content

Commit

Permalink
[docs] Add type annotations for the environment variables in docs (ba…
Browse files Browse the repository at this point in the history
…ckport #5492) (#5500)

[docs] Add type annotations for the environment variables in docs (#5492)

* [docs] Add type annotations for the environment variables in docs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 742d389)

Co-authored-by: Hailin Wang <hailin.wang@connect.polyu.hk>
  • Loading branch information
mergify[bot] and haiiliin authored Feb 24, 2024
1 parent 221c469 commit 51bc334
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
52 changes: 52 additions & 0 deletions docs/source/envvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
The following environment variables can be used to configure the package.

```{envvar} ABAQUS_BAT_PATH
**Type: string**
The file path of the `abaqus` command line batch file (`.bat`). Only set this environment variable if `abaqus` is not
the default Abaqus command line executable. This variable is used by `abqpy` to run the Abaqus command line
procedure inside the Python interpreter environment where it is installed.
```

````{envvar} ABAQUS_COMMAND_OPTIONS
**Type: string of a Python dictionary**
The default execution procedure invoked by `abqpy` inside the Python interpreter
environment where it is installed is to run one of the two following command lines:
Expand Down Expand Up @@ -72,54 +78,100 @@ boolean option to `True` and any other values to set it to `False`.
````

```{envvar} ABAQUS_CAE_DATABASE
**Type: string**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `database` option but has higher priority.
```

```{envvar} ABAQUS_CAE_REPLAY
**Type: string**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `replay` option but has higher priority.
```

```{envvar} ABAQUS_CAE_RECOVER
**Type: string**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `recover` option but has higher priority.
```

```{envvar} ABAQUS_CAE_STARTUP
**Type: string**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `startup` option but has higher priority.
```

```{envvar} ABAQUS_CAE_GUI
**Type: bool {true, false, on, off, yes, no, 1, 0}**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `gui` option but has higher priority.
```

```{envvar} ABAQUS_CAE_ENVSTARTUP
**Type: bool {true, false, on, off, yes, no, 1, 0}**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `envstartup` option but has higher priority.
```

```{envvar} ABAQUS_CAE_SAVED_OPTIONS
**Type: bool {true, false, on, off, yes, no, 1, 0}**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `savedOptions` option but has higher priority.
```

```{envvar} ABAQUS_CAE_SAVED_GUI_PREFS
**Type: bool {true, false, on, off, yes, no, 1, 0}**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `savedGuiPrefs` option but has higher priority.
```

```{envvar} ABAQUS_CAE_STARTUP_DIALOG
**Type: bool {true, false, on, off, yes, no, 1, 0}**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `startupDialog` option but has higher priority.
```

```{envvar} ABAQUS_CAE_CUSTOM
**Type: string**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `custom` option but has higher priority.
```

```{envvar} ABAQUS_CAE_GUI_TESTER
**Type: string**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `guiTester` option but has higher priority.
```

```{envvar} ABAQUS_CAE_GUI_RECORD
**Type: bool {true, false, on, off, yes, no, 1, 0}**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `guiRecord` option but has higher priority.
```

```{envvar} ABAQUS_PYTHON_SIM
**Type: string**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `sim` option but has higher priority.
```

```{envvar} ABAQUS_PYTHON_LOG
**Type: string**
A shortcut to the {envvar}`ABAQUS_COMMAND_OPTIONS` environment variable to set the `log` option but has higher priority.
```

Expand Down
3 changes: 1 addition & 2 deletions docs/source/user/python/use-scripts/interact.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ These arguments allow you to associate the callback function with both a particu
The interface definition of the callback function is

```python
def functionName(jobName, messageType, data, userData):
...
def functionName(jobName, messageType, data, userData): ...
```

The arguments to the callback function are:
Expand Down
2 changes: 2 additions & 0 deletions src/abqpy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class AbaqusCAEConfig(CompatibleBaseModel):
database: Optional[str] = None
replay: Optional[str] = None
recover: Optional[str] = None
startup: Optional[str] = None
gui: bool = False
envstartup: bool = True
savedOptions: bool = True
Expand Down Expand Up @@ -59,6 +60,7 @@ class AbaqusCommandOptions(AbaqusCAEConfig, AbaqusPythonConfig):
database=os.environ["ABAQUS_CAE_DATABASE"] if "ABAQUS_CAE_DATABASE" in os.environ else options.database,
replay=os.environ["ABAQUS_CAE_REPLAY"] if "ABAQUS_CAE_REPLAY" in os.environ else options.replay,
recover=os.environ["ABAQUS_CAE_RECOVER"] if "ABAQUS_CAE_RECOVER" in os.environ else options.recover,
startup=os.environ["ABAQUS_CAE_STARTUP"] if "ABAQUS_CAE_STARTUP" in os.environ else options.startup,
gui=os.environ["ABAQUS_CAE_GUI"].lower() in trues if "ABAQUS_CAE_GUI" in os.environ else options.gui,
envstartup=(
os.environ["ABAQUS_CAE_ENVSTARTUP"].lower() in trues
Expand Down

0 comments on commit 51bc334

Please sign in to comment.