From 3a4bdc947adec422259dabcc0288c4b987f97c53 Mon Sep 17 00:00:00 2001 From: Hanbang Wang Date: Fri, 21 Jun 2024 16:44:45 +0900 Subject: [PATCH 1/6] update graphclient 2.10.0 --- .../webstackgraphclient.py | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/python/mujinwebstackclient/webstackgraphclient.py b/python/mujinwebstackclient/webstackgraphclient.py index 601c2a5..eecb94c 100644 --- a/python/mujinwebstackclient/webstackgraphclient.py +++ b/python/mujinwebstackclient/webstackgraphclient.py @@ -2,7 +2,7 @@ # # DO NOT EDIT, THIS FILE WAS AUTO-GENERATED # GENERATED BY: mujin_webstackclientpy_generategraphclient.py -# GENERATED AGAINST: mujinwebstack/2.9.14+fc5d71d8cac090905a386ca503248dda7a4b0302 +# GENERATED AGAINST: mujinwebstack/2.10.0+0cdb864bf9c743e90fd76f3184ae020b165398c0 # from .webstackgraphclientutils import GraphClientBase @@ -1183,6 +1183,20 @@ def GetVisionTaskModuleByVisionTaskType(self, visionTaskType, fields=None, timeo ] return self._CallSimpleGraphAPI('query', operationName='GetVisionTaskModuleByVisionTaskType', parameterNameTypeValues=parameterNameTypeValues, returnType='VisionTaskModule', fields=fields, timeout=timeout) + def GetWebStackState(self, fields=None, timeout=None): + """Get published component states of WebStack. + + Args: + fields (list or dict, optional): Specifies a subset of fields to return. + timeout (float, optional): Number of seconds to wait for response. + + Returns: + WebStackState: WebStackState contains published component states of WebStack. + """ + parameterNameTypeValues = [ + ] + return self._CallSimpleGraphAPI('query', operationName='GetWebStackState', parameterNameTypeValues=parameterNameTypeValues, returnType='WebStackState', fields=fields, timeout=timeout) + def IsAttachedSensorMoveable(self, attachedSensorName, bodyName, environmentId, fields=None, timeout=None): """Check and see if attached sensor is moveable on a robot @@ -1307,6 +1321,25 @@ def ListConfigurations(self, options=None, resolveReferences=None, fields=None, ] return self._CallSimpleGraphAPI('query', operationName='ListConfigurations', parameterNameTypeValues=parameterNameTypeValues, returnType='ListConfigurationsReturnValue', fields=fields, timeout=timeout) + @UseLazyGraphQuery + def ListConfigurationsEx(self, options=None, resolveReferences=None, fields=None, timeout=None): + """List available configurations using aggregation options. + + Args: + options (ListOptionsWithAggregationsInput, optional): + resolveReferences (bool, optional): Whether to operate on resolved configurations. Defaults to operate and return unresolved data. + fields (list or dict, optional): Specifies a subset of fields to return. + timeout (float, optional): Number of seconds to wait for response. + + Returns: + ListConfigurationsExReturnValue: + """ + parameterNameTypeValues = [ + ('options', 'ListOptionsWithAggregationsInput', options), + ('resolveReferences', 'Boolean', resolveReferences), + ] + return self._CallSimpleGraphAPI('query', operationName='ListConfigurationsEx', parameterNameTypeValues=parameterNameTypeValues, returnType='ListConfigurationsExReturnValue', fields=fields, timeout=timeout) + @UseLazyGraphQuery def ListConnectedBodies(self, bodyId, environmentId, options=None, resolveReferences=None, units=None, fields=None, timeout=None): """List connected bodies defined on a robot. @@ -1404,6 +1437,27 @@ def ListEnvironments(self, options=None, resolveReferences=None, units=None, fie ] return self._CallSimpleGraphAPI('query', operationName='ListEnvironments', parameterNameTypeValues=parameterNameTypeValues, returnType='ListEnvironmentsReturnValue', fields=fields, timeout=timeout) + @UseLazyGraphQuery + def ListEnvironmentsEx(self, options=None, resolveReferences=None, units=None, fields=None, timeout=None): + """List environments with aggregations. + + Args: + options (ListOptionsWithAggregationsInput, optional): + resolveReferences (bool, optional): Whether to operate on resolved bodies in the environment. Defaults to operate and return unresolved data. + units (UnitSelectionInput, optional): Optional unit selection. + fields (list or dict, optional): Specifies a subset of fields to return. + timeout (float, optional): Number of seconds to wait for response. + + Returns: + ListEnvironmentsExReturnValue: + """ + parameterNameTypeValues = [ + ('options', 'ListOptionsWithAggregationsInput', options), + ('resolveReferences', 'Boolean', resolveReferences), + ('units', 'UnitSelectionInput', units), + ] + return self._CallSimpleGraphAPI('query', operationName='ListEnvironmentsEx', parameterNameTypeValues=parameterNameTypeValues, returnType='ListEnvironmentsExReturnValue', fields=fields, timeout=timeout) + @UseLazyGraphQuery def ListGeometries(self, bodyId, environmentId, linkId, options=None, resolveReferences=None, units=None, fields=None, timeout=None): """List geometries in a link. From 11a8821420df8b456c988c2a5050ff4c8522940e Mon Sep 17 00:00:00 2001 From: Ziyan Date: Fri, 21 Jun 2024 10:27:30 -0400 Subject: [PATCH 2/6] Bump version and changelog. --- CHANGELOG.md | 6 ++++++ python/mujinwebstackclient/version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5137da8..d4da72d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.8.0 (2024-06-21) + +### Changes + +- Support `GetWebStackState`. + ## 0.7.11 (2024-06-14) ### Changes diff --git a/python/mujinwebstackclient/version.py b/python/mujinwebstackclient/version.py index 8a56210..5a49596 100644 --- a/python/mujinwebstackclient/version.py +++ b/python/mujinwebstackclient/version.py @@ -1,4 +1,4 @@ -__version__ = '0.7.11' +__version__ = '0.8.0' # Do not forget to update CHANGELOG.md From 2c22d837bb9fe34a635bcbdac9e609ee429993d3 Mon Sep 17 00:00:00 2001 From: Hanbang Wang Date: Mon, 24 Jun 2024 15:12:13 +0900 Subject: [PATCH 3/6] add webstackConfigSchema --- python/mujinwebstackclient/schema/__init__.py | 93 +++++++++++++++++++ setup.py | 7 +- 2 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 python/mujinwebstackclient/schema/__init__.py diff --git a/python/mujinwebstackclient/schema/__init__.py b/python/mujinwebstackclient/schema/__init__.py new file mode 100644 index 0000000..a42529c --- /dev/null +++ b/python/mujinwebstackclient/schema/__init__.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- + +from .. import _ + +filterSchema = { + 'type': 'object', + 'properties': { + 'operation': { + 'type': 'string', + 'enum': ['constant', 'pointer', 'not', 'isNull', 'notNull', 'and', 'or', 'equal', 'notEqual', 'less', 'lessEqual', 'greater', 'greaterEqual', 'in', 'notIn', 'like', 'insensitiveLike', 'regexMatch', 'startsWith', 'insensitiveStartsWith', 'endsWith', 'insensitiveEndsWith', 'contains', 'insensitiveContains', 'plus', 'minus', 'multiply', 'divide', 'mod', 'concatenate'], + 'description': _('Operation of the filter.') + }, + 'operands': { + 'type': 'array', + 'items': {'$refs': '#'}, + 'description': _('Operands of the operation.') + }, + 'field': { + 'type': 'array', + 'items': { + 'type': ['string', 'integer'], + 'default': '', + }, + 'description': _('A path of either string or int to a (nested) field.') + }, + 'value': { + } + }, + 'required': ['operation'] +} +filterSchema['properties']['operands']['items'] = filterSchema + +webstackConfigSchema = { + 'type': 'object', + 'typeName': 'WebStackConfiguration', + 'description': _('WebStack specific configuration.'), + 'properties': { + 'sync': { + 'type': 'object', + 'typeName': 'SyncWebStackConfiguration', + 'description': _('The configuration for syncing resources with other controllers.'), + 'properties': { + 'remotes': { + 'type': 'array', + 'items': { + 'type': 'object', + 'typeName': 'RemoteWebStack', + 'description': _('Remote Webstack configuration.'), + 'properties': { + 'url': { + 'type': 'string', + 'description': _('URL of the remote WebStack.'), + }, + 'username': { + 'type': 'string', + 'description': _('Username of the remote WebStack.'), + }, + 'password': { + 'type': 'string', + 'description': _('Password of the remote WebStack.'), + }, + 'pullInterval': { + 'type': 'string', + 'description': _('Pulling interval for this remote, overwrites global default if set.\nValid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y".'), + }, + 'configurationFilter': dict( + filterSchema, + description=_('Configuration syncing filter for this remote, overwrites global default if set.') + ), + 'environmentFilter': dict( + filterSchema, + description=_('Environment syncing filter for this remote, overwrites global default if set.') + ), + } + }, + 'description': _('List of remote WebStacks to sync with.') + }, + 'pullInterval': { + 'type': 'string', + 'description': _('Pulling interval, disable pulling if it is not set.\nValid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y".'), + }, + 'configurationFilter': dict( + filterSchema, + description=_('Configuration syncing filter, configurations are not synced if this filter is not set.') + ), + 'environmentFilter': dict( + filterSchema, + description=_('Environment syncing filter, environments are not synced if this filter is not set.') + ), + } + } + } +} diff --git a/setup.py b/setup.py index 8ae552a..50c8e81 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ # Copyright (C) 2012-2014 MUJIN Inc from distutils.core import setup try: - from mujincommon.setuptools import Distribution + from mujinbuildcommon.distributions import Distribution except (ImportError, SyntaxError): from distutils.dist import Distribution @@ -13,7 +13,7 @@ distclass=Distribution, name='mujinwebstackclient', version=version['__version__'], - packages=['mujinwebstackclient'], + packages=['mujinwebstackclient', 'mujinwebstackclient.schema'], package_dir={'mujinwebstackclient': 'python/mujinwebstackclient'}, data_files=[ # using scripts= will cause the first line of the script being modified for python2 or python3 @@ -24,6 +24,9 @@ 'bin/mujin_webstackclientpy_downloaddata.py', ]), ], + schema=[ + # 'mujinwebstackclient.schema.webstackConfigSchema', # NOTE: we don't support $refs and recursive python object + ], locale_dir='locale', license='Apache License, Version 2.0', long_description=open('README.md').read(), From 9e49824651b7e46d11724066cb16ca04a582deb6 Mon Sep 17 00:00:00 2001 From: Hanbang Wang Date: Mon, 24 Jun 2024 15:14:48 +0900 Subject: [PATCH 4/6] add webStackConfigSchema --- python/mujinwebstackclient/schema/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/mujinwebstackclient/schema/__init__.py b/python/mujinwebstackclient/schema/__init__.py index a42529c..304fbb1 100644 --- a/python/mujinwebstackclient/schema/__init__.py +++ b/python/mujinwebstackclient/schema/__init__.py @@ -30,7 +30,7 @@ } filterSchema['properties']['operands']['items'] = filterSchema -webstackConfigSchema = { +webStackConfigSchema = { 'type': 'object', 'typeName': 'WebStackConfiguration', 'description': _('WebStack specific configuration.'), From 6fc51e33d38340531b15e949676cb95581c782e9 Mon Sep 17 00:00:00 2001 From: Barkin Simsek Date: Mon, 24 Jun 2024 23:52:01 +0900 Subject: [PATCH 5/6] Update descriptions and formatting. --- CHANGELOG.md | 1 + python/mujinwebstackclient/schema/__init__.py | 6 +++--- setup.py | 8 ++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4da72d..8a6b236 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Changes - Support `GetWebStackState`. +- Add WebStack configuration schema. ## 0.7.11 (2024-06-14) diff --git a/python/mujinwebstackclient/schema/__init__.py b/python/mujinwebstackclient/schema/__init__.py index 304fbb1..c843537 100644 --- a/python/mujinwebstackclient/schema/__init__.py +++ b/python/mujinwebstackclient/schema/__init__.py @@ -30,7 +30,7 @@ } filterSchema['properties']['operands']['items'] = filterSchema -webStackConfigSchema = { +webStackConfigurationSchema = { 'type': 'object', 'typeName': 'WebStackConfiguration', 'description': _('WebStack specific configuration.'), @@ -45,7 +45,7 @@ 'items': { 'type': 'object', 'typeName': 'RemoteWebStack', - 'description': _('Remote Webstack configuration.'), + 'description': _('Remote WebStack configuration.'), 'properties': { 'url': { 'type': 'string', @@ -77,7 +77,7 @@ }, 'pullInterval': { 'type': 'string', - 'description': _('Pulling interval, disable pulling if it is not set.\nValid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y".'), + 'description': _('Pulling interval. Pulling is disabled if this field is not set.\nValid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y".'), }, 'configurationFilter': dict( filterSchema, diff --git a/setup.py b/setup.py index 50c8e81..7b6b99a 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,10 @@ distclass=Distribution, name='mujinwebstackclient', version=version['__version__'], - packages=['mujinwebstackclient', 'mujinwebstackclient.schema'], + packages=[ + 'mujinwebstackclient', + 'mujinwebstackclient.schema', + ], package_dir={'mujinwebstackclient': 'python/mujinwebstackclient'}, data_files=[ # using scripts= will cause the first line of the script being modified for python2 or python3 @@ -25,7 +28,8 @@ ]), ], schema=[ - # 'mujinwebstackclient.schema.webstackConfigSchema', # NOTE: we don't support $refs and recursive python object + # NOTE: $refs and recursive python objects are not supported right now + # 'mujinwebstackclient.schema.webStackConfigurationSchema', ], locale_dir='locale', license='Apache License, Version 2.0', From c670587203c5471e4b36998e422b62bb69428d23 Mon Sep 17 00:00:00 2001 From: Hanbang Wang Date: Tue, 25 Jun 2024 09:37:15 +0900 Subject: [PATCH 6/6] Revert "add webstackConfigSchema" This reverts commit 2c22d837bb9fe34a635bcbdac9e609ee429993d3. Revert "add webStackConfigSchema" This reverts commit 9e49824651b7e46d11724066cb16ca04a582deb6. Revert "Update descriptions and formatting." This reverts commit 6fc51e33d38340531b15e949676cb95581c782e9. --- CHANGELOG.md | 1 - python/mujinwebstackclient/schema/__init__.py | 93 ------------------- setup.py | 11 +-- 3 files changed, 2 insertions(+), 103 deletions(-) delete mode 100644 python/mujinwebstackclient/schema/__init__.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a6b236..d4da72d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,6 @@ ### Changes - Support `GetWebStackState`. -- Add WebStack configuration schema. ## 0.7.11 (2024-06-14) diff --git a/python/mujinwebstackclient/schema/__init__.py b/python/mujinwebstackclient/schema/__init__.py deleted file mode 100644 index c843537..0000000 --- a/python/mujinwebstackclient/schema/__init__.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- - -from .. import _ - -filterSchema = { - 'type': 'object', - 'properties': { - 'operation': { - 'type': 'string', - 'enum': ['constant', 'pointer', 'not', 'isNull', 'notNull', 'and', 'or', 'equal', 'notEqual', 'less', 'lessEqual', 'greater', 'greaterEqual', 'in', 'notIn', 'like', 'insensitiveLike', 'regexMatch', 'startsWith', 'insensitiveStartsWith', 'endsWith', 'insensitiveEndsWith', 'contains', 'insensitiveContains', 'plus', 'minus', 'multiply', 'divide', 'mod', 'concatenate'], - 'description': _('Operation of the filter.') - }, - 'operands': { - 'type': 'array', - 'items': {'$refs': '#'}, - 'description': _('Operands of the operation.') - }, - 'field': { - 'type': 'array', - 'items': { - 'type': ['string', 'integer'], - 'default': '', - }, - 'description': _('A path of either string or int to a (nested) field.') - }, - 'value': { - } - }, - 'required': ['operation'] -} -filterSchema['properties']['operands']['items'] = filterSchema - -webStackConfigurationSchema = { - 'type': 'object', - 'typeName': 'WebStackConfiguration', - 'description': _('WebStack specific configuration.'), - 'properties': { - 'sync': { - 'type': 'object', - 'typeName': 'SyncWebStackConfiguration', - 'description': _('The configuration for syncing resources with other controllers.'), - 'properties': { - 'remotes': { - 'type': 'array', - 'items': { - 'type': 'object', - 'typeName': 'RemoteWebStack', - 'description': _('Remote WebStack configuration.'), - 'properties': { - 'url': { - 'type': 'string', - 'description': _('URL of the remote WebStack.'), - }, - 'username': { - 'type': 'string', - 'description': _('Username of the remote WebStack.'), - }, - 'password': { - 'type': 'string', - 'description': _('Password of the remote WebStack.'), - }, - 'pullInterval': { - 'type': 'string', - 'description': _('Pulling interval for this remote, overwrites global default if set.\nValid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y".'), - }, - 'configurationFilter': dict( - filterSchema, - description=_('Configuration syncing filter for this remote, overwrites global default if set.') - ), - 'environmentFilter': dict( - filterSchema, - description=_('Environment syncing filter for this remote, overwrites global default if set.') - ), - } - }, - 'description': _('List of remote WebStacks to sync with.') - }, - 'pullInterval': { - 'type': 'string', - 'description': _('Pulling interval. Pulling is disabled if this field is not set.\nValid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y".'), - }, - 'configurationFilter': dict( - filterSchema, - description=_('Configuration syncing filter, configurations are not synced if this filter is not set.') - ), - 'environmentFilter': dict( - filterSchema, - description=_('Environment syncing filter, environments are not synced if this filter is not set.') - ), - } - } - } -} diff --git a/setup.py b/setup.py index 7b6b99a..8ae552a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ # Copyright (C) 2012-2014 MUJIN Inc from distutils.core import setup try: - from mujinbuildcommon.distributions import Distribution + from mujincommon.setuptools import Distribution except (ImportError, SyntaxError): from distutils.dist import Distribution @@ -13,10 +13,7 @@ distclass=Distribution, name='mujinwebstackclient', version=version['__version__'], - packages=[ - 'mujinwebstackclient', - 'mujinwebstackclient.schema', - ], + packages=['mujinwebstackclient'], package_dir={'mujinwebstackclient': 'python/mujinwebstackclient'}, data_files=[ # using scripts= will cause the first line of the script being modified for python2 or python3 @@ -27,10 +24,6 @@ 'bin/mujin_webstackclientpy_downloaddata.py', ]), ], - schema=[ - # NOTE: $refs and recursive python objects are not supported right now - # 'mujinwebstackclient.schema.webStackConfigurationSchema', - ], locale_dir='locale', license='Apache License, Version 2.0', long_description=open('README.md').read(),