Skip to content

Commit b230548

Browse files
Resolves "Documentation Update" (#189)
* Updated examples to use new string for printing * updated module documentation to reflect new PyNeoDeviceEx * Updated documentation --------- Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
1 parent 6a28fc6 commit b230548

18 files changed

Lines changed: 277 additions & 290 deletions

IntrepidCS.png

3.84 KB
Loading

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ Python wrapper for interfacing to IntrepidCS Hardware.
2626
- Mac builds use [libicsneo](https://github.com/intrepidcs/libicsneo) and are built using cibuildwheel
2727
- libicsneolegacy.dylib is bundled with the wheel and python_ics will automatically use it.
2828

29+
# Basic usage
30+
31+
```python
32+
import ics
33+
34+
devices = ics.find_devices()
35+
print(f"Found {len(devices)} devices...")
36+
for device in devices:
37+
# Print, open, load default settings, close
38+
print(device)
39+
device.open()
40+
device.load_default_settings()
41+
device.close()
42+
```
43+
2944
# Documentation
3045

3146
http://python-ics.readthedocs.io/
@@ -35,6 +50,7 @@ http://python-ics.readthedocs.io/
3550

3651
- Building from source requires clang and clang-format to be present on the build machine.
3752
- python_ics has submodules, please be sure to initial all submodules also.
53+
3854
```powershell
3955
PS > git clone git@github.com:intrepidcs/python_ics.git
4056

doc/requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
cython>=0.20
1+
cython>=0.20
2+
m2r2
3+
docutils>=0.18.1,<0.21
4+
furo

doc/source/conf.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@
3333
extensions = [
3434
"sphinx.ext.autosummary",
3535
"sphinx.ext.autodoc",
36+
"m2r2",
3637
]
3738

3839
# Add any paths that contain templates here, relative to this directory.
3940
templates_path = ["_templates"]
4041

4142
# The suffix of source filenames.
42-
source_suffix = ".rst"
43+
source_suffix = [".rst", ".md"]
4344

4445
# The encoding of source files.
4546
# source_encoding = 'utf-8-sig'
@@ -103,13 +104,14 @@
103104

104105
# The theme to use for HTML and HTML Help pages. See the documentation for
105106
# a list of builtin themes.
106-
# html_theme = 'sphinx_rtd_theme'
107-
html_theme = "classic"
107+
#html_theme = 'sphinx_rtd_theme'
108+
#html_theme = "classic"
109+
html_theme = "furo"
108110

109111
# Theme options are theme-specific and customize the look and feel of a theme
110112
# further. For a list of options available for each theme, see the
111113
# documentation.
112-
html_theme_options = {"body_max_width": "80%"}
114+
#html_theme_options = {"body_max_width": "80%"}
113115

114116
# Add any paths that contain custom themes here, relative to this directory.
115117
# html_theme_path = []

doc/source/examples.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
============================================================
1+
##############################################################################
22
Examples
3-
============================================================
3+
##############################################################################
44

55
Examples can be found at https://github.com/intrepidcs/python_ics/tree/master/examples
66

77
For extra information on data structures and underlying functionality, please visit neoVI DLL Documentation under https://intrepidcs.com/support/support-resources/
88

99
Opening a device
10-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10+
==============================================================================
1111

1212
The ``open_device_example.py`` example shows how to successfully open and close an Intrepid device.
1313

1414
Transmitting and Receiving a CAN message
15-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
==============================================================================
1616

1717
The following examples show how to interact with CAN messages on an Intrepid device.
1818

@@ -22,7 +22,7 @@ The following examples show how to interact with CAN messages on an Intrepid dev
2222

2323

2424
ISO 15765-2 Example
25-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
==============================================================================
2626

2727
The ``iso15765_example.py`` example shows how to setup basic ISO 15765-2 receive filters and transmitting an ISO 15765-2 message.
2828

@@ -34,6 +34,6 @@ Similarly transmitting an ISO 15765-2 frame can be accomplished by passing a cus
3434

3535

3636
Missing an example?
37-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37+
==============================================================================
3838

3939
Need an example on something that isn't covered here? Please submit an issue on github or feel free to send over a Pull Request of your own.

doc/source/generate_documentation.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,37 +44,44 @@ def generate_variables():
4444

4545
def generate_documentation():
4646
return inspect.cleandoc(
47-
""".. include:: header.rst
47+
f""".. include:: header.rst
4848
.. include:: examples.rst
4949
50-
============================================================
50+
##############################################################################
51+
PyNeoDeviceEx
52+
##############################################################################
53+
.. autoclass:: ics.PyNeoDeviceEx
54+
:members:
55+
:show-inheritance:
56+
:undoc-members:
57+
58+
##############################################################################
5159
Module Documentation
52-
============================================================
60+
##############################################################################
5361
.. automodule:: ics.ics
5462
:members:
5563
:show-inheritance:
5664
:undoc-members:
5765
58-
============================================================
66+
##############################################################################
5967
Module Functions
60-
============================================================
68+
##############################################################################
6169
62-
%s
70+
{generate_functions()}
6371
64-
============================================================
72+
##############################################################################
6573
Module Structures
66-
============================================================
74+
##############################################################################
6775
68-
%s
76+
{generate_structures()}
6977
70-
============================================================
78+
##############################################################################
7179
Module Variables
72-
============================================================
80+
##############################################################################
7381
74-
%s
82+
{generate_variables()}
7583
7684
"""
77-
% (generate_functions(), generate_structures(), generate_variables())
7885
)
7986

8087

0 commit comments

Comments
 (0)