Update pattern and curve example

This commit is contained in:
WQY\qiong
2022-11-04 22:50:28 +08:00
parent 0e45c8e825
commit 5de5f2f9dc

View File

@@ -402,10 +402,10 @@ def get_pattern_schema(name: str) -> dict[str, dict[str, Any]]:
def get_pattern(name: str, id: str) -> dict[str, Any]:
return api.get_pattern(name, id)
# example: set_pattern(p, ChangeSet({'id' : 'p0', 'factors': [1.0, 2.0, 3.0]}))
def set_pattern(name: str, cs: ChangeSet) -> ChangeSet:
return api.set_pattern(name, cs)
# example: add_pattern(p, ChangeSet({'id' : 'p0', 'factors': [1.0, 2.0, 3.0]}))
def add_pattern(name: str, cs: ChangeSet) -> ChangeSet:
return api.add_pattern(name, cs)
@@ -423,10 +423,10 @@ def get_curve_schema(name: str) -> dict[str, dict[str, Any]]:
def get_curve(name: str, id: str) -> dict[str, Any]:
return api.get_curve(name, id)
# example: set_curve(p, ChangeSet({'id' : 'c0', 'coords': [{'x': 1.0, 'y': 2.0}, {'x': 2.0, 'y': 1.0}]}))
def set_curve(name: str, cs: ChangeSet) -> ChangeSet:
return api.set_curve(name, cs)
# example: add_curve(p, ChangeSet({'id' : 'c0', 'c_type' : CURVE_TYPE_PUMP, 'coords': [{'x': 1.0, 'y': 2.0}, {'x': 2.0, 'y': 1.0}]}))
def add_curve(name: str, cs: ChangeSet) -> ChangeSet:
return api.add_curve(name, cs)