Skip to content

Commit f0b327f

Browse files
committed
fixed namespace shortening and finalised documentation
1 parent d0a74bf commit f0b327f

3 files changed

Lines changed: 18 additions & 22 deletions

File tree

DOCUMENTATION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ To make sharing graphic textures as easy as possible, the library provides some
167167
The `syphon.utils.raw` module contains methods to create and manipulate textures with a raw `bytes` array.
168168

169169
#### Create MTLTexture
170-
To create an [MTLTexture](https://developer.apple.com/documentation/metal/mtltexture) the method `syphon.utils.raw.create_mtl_texture` can be used. It is possible to create your own default device or use a server's `device` property to get the current device.
170+
To create an [MTLTexture](https://developer.apple.com/documentation/metal/mtltexture) the method `syphon.utils.raw.create_mtl_texture` can be used. It is possible to create your own default device or use a server's `syphon.server.SyphonMetalServer.device` property to get the current device.
171171

172172
```python
173173
import Metal
@@ -178,7 +178,7 @@ texture = create_mtl_texture(mtl_device, 512, 512)
178178
```
179179

180180
#### Manipulate MTLTexture
181-
To write `bytes` to an [MTLTexture](https://developer.apple.com/documentation/metal/mtltexture) the method `syphon.utils.raw.copy_bytes_to_mtl_texture` can be used.
181+
To write `bytes` to an [MTLTexture](https://developer.apple.com/documentation/metal/mtltexture) the method `syphon.utils.raw.copy_bytes_to_mtl_texture()` can be used.
182182

183183
```python
184184
from syphon.utils.raw import copy_bytes_to_mtl_texture
@@ -189,7 +189,7 @@ texture = ... # MLTTexture object
189189
copy_bytes_to_mtl_texture(data, texture)
190190
```
191191

192-
To read `bytes` from an [MTLTexture](https://developer.apple.com/documentation/metal/mtltexture) the method `syphon.utils.raw.copy_mtl_texture_to_bytes` can be used.
192+
To read `bytes` from an [MTLTexture](https://developer.apple.com/documentation/metal/mtltexture) the method `syphon.utils.raw.copy_mtl_texture_to_bytes()` can be used.
193193

194194
```python
195195
from syphon.utils.raw import copy_mtl_texture_to_bytes
@@ -204,7 +204,7 @@ If you are working with [Numpy](https://numpy.org/) arrays, the `syphon.utils.nu
204204

205205
It is important to note that the `numpy` package is not installed by default, it must be installed using `pip install numpy`.
206206

207-
To write a numpy image to a MTLTexture, the `syphon.utils.numpy.copy_image_to_mtl_texture` method can be used.
207+
To write a numpy image to a MTLTexture, the `syphon.utils.numpy.copy_image_to_mtl_texture()` method can be used.
208208

209209
```python
210210
import numpy as np
@@ -219,7 +219,7 @@ texture_data = np.zeros((512, 512, 4), dtype=np.uint8)
219219
copy_image_to_mtl_texture(texture_data, texture)
220220
```
221221

222-
To read a numpy image from a MTLTexture, the `syphon.utils.numpy.copy_mtl_texture_to_image` method can be used.
222+
To read a numpy image from a MTLTexture, the `syphon.utils.numpy.copy_mtl_texture_to_image()` method can be used.
223223

224224
```python
225225
import numpy as np

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
[![Build](https://github.com/cansik/syphon-python/actions/workflows/build.yml/badge.svg)](https://github.com/cansik/syphon-python/actions/workflows/build.yml)
55
[![PyPI](https://img.shields.io/pypi/v/syphon-python)](https://pypi.org/project/syphon-python/)
66

7-
⚠️ This library is still *under development*.
7+
⚠️ This library is still *in development*.
88

9-
Python wrapper for the GPU texture sharing framework Syphon. This library has been created to support the Metal backend
10-
as well as the deprecated OpenGL backend. It requires **macOS 11 or higher**.
9+
Python wrapper for the Syphon GPU texture sharing framework. This library was created to support both the Metal backend
10+
and the deprecated OpenGL backend. It requires **macOS 11 or above**.
1111

12-
The implementation is based on [PyObjC](https://github.com/ronaldoussoren/pyobjc) to wrap
13-
the [Syphon-Framework](https://github.com/Syphon/Syphon-Framework) directly from within Python. This approach removes
14-
the need of a native wrapper and allows Python developers to extend the library if needed.
12+
The implementation is based on [PyObjC](https://github.com/ronaldoussoren/pyobjc) to wrap the
13+
Syphon framework](https://github.com/Syphon/Syphon-Framework) directly from Python. This approach eliminates
14+
native wrapper and allows Python developers to extend the library as needed.
1515

1616
## State of Development
1717

@@ -23,19 +23,19 @@ the need of a native wrapper and allows Python developers to extend the library
2323
- [ ] Syphon Client On Frame Callback
2424

2525
## Usage
26-
To install `syphon-python` it is recommended to use a pre-built binary from PyPi:
26+
To install `syphon-python` it is recommended to use a prebuilt binary from PyPi:
2727

2828
```bash
2929
pip install syphon-python
3030
```
3131

32-
For examples using `numpy`, please also install numpy:
32+
To run all the examples, please also install [Numpy](https://numpy.org/) and [OpenCV](https://opencv.org/):
3333

3434
```bash
35-
pip install numpy
35+
pip install numpy opencv-python
3636
```
3737

38-
The following code snippet is a basic example which shows how to share `numpy` images as a `MTLTexture` with a `SyphonMetalServer`. There are more examples under [examples](/examples).
38+
The following code snippet is a basic example showing how to share `numpy` images as `MTLTexture` with a `SyphonMetalServer`. There are more examples in [examples](/examples).
3939

4040
```python
4141
import time
@@ -65,7 +65,7 @@ server.stop()
6565
```
6666

6767
## Development
68-
To develop the library or install it manually, use the following commands to setup the local repository.
68+
To develop or manually install the library, use the following commands to set up the local repository.
6969

7070
### Installation
7171

@@ -84,7 +84,7 @@ pip install opencv-python
8484

8585
### Build
8686

87-
Build the Syphon-Framework on your machine:
87+
Build the Syphon framework on your machine:
8888

8989
```bash
9090
python setup.py build

scripts/generate_doc.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@ def linkify_repl(m: re.Match):
9090
if plain_text.endswith("()"):
9191
plain_text = f"{doc.name}()"
9292
else:
93-
# replaced doc.fullname with doc.name if is class (uppercase letter) to only display identifier
94-
if doc.fullname.split(".")[-1][0].isupper():
95-
plain_text = doc.name
96-
else:
97-
plain_text = doc.fullname
93+
plain_text = doc.name
9894
return f'<a href="{relative_link(context["module"].modulename, module)}{qualname}">{plain_text}</a>'
9995
else:
10096
return text

0 commit comments

Comments
 (0)