Skip to content

Commit db34314

Browse files
authored
Merge pull request #839 from compas-dev/data
Update data module and add schemas
2 parents 961b15e + e3f586d commit db34314

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+612
-105
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,7 @@ tag = True
88
search = version='{current_version}'
99
replace = version='{new_version}'
1010

11-
[bumpversion:file:schemas/graph.json]
12-
search = "$compas": "{current_version}"
13-
replace = "$compas": "{new_version}"
14-
15-
[bumpversion:file:schemas/halfedge.json]
16-
search = "$compas": "{current_version}"
17-
replace = "$compas": "{new_version}"
18-
19-
[bumpversion:file:schemas/halfface.json]
11+
[bumpversion:glob:schemas/*.json]
2012
search = "$compas": "{current_version}"
2113
replace = "$compas": "{new_version}"
2214

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Added
1212

1313
* Added `compas.topology.astar_lightest_path`.
14+
* Added jsonschema definitions for primitives and transformations.
15+
* Added schema implementation to primitives and transformations.
16+
* Added jsonschema implementation to primitives and transformations.
17+
* Added `compas.data.is_int3`, `compas.data.is_float3`, `compas_data.is_float4x4`.
1418

1519
### Changed
1620

1721
* Extended `compas.topology.astar_shortest_path` to work on `compas.datastructures.Mesh` and `compas.datastructures.Network`.
22+
* Fixed `compas.data.Data.to_jsonstring`.
23+
* Changed `compas.data.Data.data.setter` to raise `NotImplementedError`.
24+
* Changed annotations of `compas_blender.artists.BaseArtist`.
25+
* Fixed `__repr__` for primitives, shapes, transformations.
1826

1927
### Removed
2028

29+
* Removed duplicate cases from `compas.data.DataEncoder`.
2130

2231
## [1.6.2] 2021-05-12
2332

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
autopep8
22
attrs >=17.4
3-
bump2version >=0.5.11
3+
bump2version >=1.0.1
44
check-manifest >=0.36
55
doc8
66
flake8

schemas/circle.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/compas-dev/compas/schemas/circle.json",
4+
"$compas": "1.6.2",
5+
6+
"type": "object",
7+
"properties": {
8+
"plane": {
9+
"type": "array",
10+
"minItems": 2,
11+
"maxItems": 2,
12+
"items": [
13+
{"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}},
14+
{"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}}
15+
]
16+
},
17+
"radius": {"type": "number", "exclusiveMinimum": 0}
18+
},
19+
"required": ["plane", "radius"]
20+
}

schemas/ellipse.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/compas-dev/compas/schemas/ellipse.json",
4+
"$compas": "1.6.2",
5+
6+
"type": "object",
7+
"properties": {
8+
"plane": {
9+
"type": "array",
10+
"minItems": 2,
11+
"maxItems": 2,
12+
"items": [
13+
{"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}},
14+
{"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}}
15+
]
16+
},
17+
"major": {"type": "number", "exclusiveMinimum": 0},
18+
"minor": {"type": "number", "exclusiveMinimum": 0}
19+
},
20+
"required": ["plane", "major", "minor"]
21+
}

schemas/frame.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/compas-dev/compas/schemas/frame.json",
4+
"$compas": "1.6.2",
5+
6+
"type": "object",
7+
"properties": {
8+
"point": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}},
9+
"xaxis": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}},
10+
"yaxis": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}}
11+
},
12+
"required": ["point", "xaxis", "yaxis"]
13+
}

schemas/line.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/compas-dev/compas/schemas/line.json",
4+
"$compas": "1.6.2",
5+
6+
"type": "object",
7+
"properties": {
8+
"start": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}},
9+
"end": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}}
10+
},
11+
"required": ["start", "end"]
12+
}

schemas/plane.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/compas-dev/compas/schemas/plane.json",
4+
"$compas": "1.6.2",
5+
6+
"type": "object",
7+
"properties": {
8+
"point": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}},
9+
"normal": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}}
10+
},
11+
"required": ["point", "normal"]
12+
}

schemas/point.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/compas-dev/compas/schemas/point.json",
4+
"$compas": "1.6.2",
5+
6+
"type": "array",
7+
"minItems": 3,
8+
"maxItems": 3,
9+
"items": {"type": "number"}
10+
}

schemas/polygon.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://github.com/compas-dev/compas/schemas/polygon.json",
4+
"$compas": "1.6.2",
5+
6+
"type": "object",
7+
"properties": {
8+
"points": {"type": "array", "minItems": 2, "items": {"type": "array", "minItems": 3, "maxItems": 3, "items": {"type": "number"}}}
9+
},
10+
"required": ["points"]
11+
}

0 commit comments

Comments
 (0)