You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b7d0474
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
12
12
### Changed
13
13
14
+
* Refactored proto definitions from 31 separate files into three organized files (`geometry.proto`, `datastructures.proto`, `message.proto`) to better reflect COMPAS package structure.
### 2. Generate the python code for the updated proto file
51
+
52
+
Now run the following command to regenerate the python code from the updated proto files:
32
53
33
54
```bash
34
-
invoke protobuf.generate-proto-classes -t python
55
+
invoke generate-proto-classes -t python
35
56
```
36
57
37
-
A new module called `circle_pb2` should now be available in `compas_pb/generated/`.
58
+
The generated modules (`geometry_pb2`, `datastructures_pb2`, `message_pb2`) in `src/compas_pb/generated/` will now include your new type.
38
59
39
-
### 4. Create a (de)serializer for the new type
60
+
### 3. Create a (de)serializer for the new type
40
61
41
62
To create a (de)serializer for a custom type, use the `@pb_serializer` and `@pb_deserializer` decorators. These decorators will be used to register the serializer and deserializer with the plugin system.
42
63
43
64
```python title="compas_pb/conversions.py"
44
-
from compas_pb.dataimport pb_serializer
45
-
from compas_pb.dataimport pb_deserializer
46
-
from compas_pb.generated importcircle_pb2
65
+
from compas_pb.registryimport pb_serializer
66
+
from compas_pb.registryimport pb_deserializer
67
+
from compas_pb.generated importgeometry_pb2 # or datastructures_pb2
0 commit comments