Skip to content

Commit

Permalink
doc: Implement UML diagram for classes (#349)
Browse files Browse the repository at this point in the history
* doc: Implement UML diagram for classes

* doc: Update contribution guide for pyreverse
  • Loading branch information
titom73 committed Aug 8, 2023
1 parent 7bd542a commit 69341a7
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/api/device.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# AntaDevice base class

## UML representation

![](../imgs/uml/anta.device.AntaDevice.jpeg)

### ::: anta.device.AntaDevice
options:
filters: ["!^_[^_]", "!__(eq|rich_repr)__"]

# Async EOS device class

## UML representation

![](../imgs/uml/anta.device.AsyncEOSDevice.jpeg)

### ::: anta.device.AsyncEOSDevice
options:
filters: ["!^_[^_]", "!__(eq|rich_repr)__"]

17 changes: 17 additions & 0 deletions docs/api/models.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# Anta Test definition

## UML Diagram

![](../imgs/uml/anta.models.AntaTest.jpeg)

### ::: anta.models.AntaTest
options:
filters: ["!^_[^_]", "!__init_subclass__"]

# Anta Command definition

## UML Diagram

![](../imgs/uml/anta.models.AntaCommand.jpeg)
### ::: anta.models.AntaCommand

# Template command definition

## UML Diagram

![](../imgs/uml/anta.models.AntaTemplate.jpeg)

### ::: anta.models.AntaTemplate
6 changes: 6 additions & 0 deletions docs/api/result_manager.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Result Manager definition

## UML Diagram

![](../imgs/uml/anta.result_manager.ResultManager.jpeg)

### ::: anta.result_manager.ResultManager
options:
filters: ["!^_[^_]", "!^__len__"]
6 changes: 6 additions & 0 deletions docs/api/result_manager_models.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Test Result model

## UML Diagram

![](../imgs/uml/anta.result_manager.models.TestResult.jpeg)

### ::: anta.result_manager.models.TestResult
options:
filters: ["!^_[^_]", "!__str__"]
Expand Down
10 changes: 10 additions & 0 deletions docs/contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ By default, `mkdocs` listens to http://127.0.0.1:8000/, if you need to expose th
mkdocs serve --dev-addr=0.0.0.0:8080
```

### Build class diagram

To build class diagram to use in API documentation, you can use `pyreverse` part of `pylint` with [`graphviz`](https://graphviz.org/) installed for jpeg generation.

```bash
pyreverse anta --colorized -a1 -s1 -o jpeg -m true -k --output-directory docs/imgs/uml/ -c <FQDN anta class>
```

Image will be generated under `docs/imgs/uml/` and can be inserted in your documentation.

### Checking links

Writing documentation is crucial but managing links can be cumbersome. To be sure there is no dead links, you can use [`muffet`](https://github.com/raviqqe/muffet) with the following command:
Expand Down
Binary file added docs/imgs/uml/anta.device.AntaDevice.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/uml/anta.device.AsyncEOSDevice.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/uml/anta.models.AntaCommand.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/uml/anta.models.AntaTemplate.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/imgs/uml/anta.models.AntaTest.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 69341a7

Please sign in to comment.