Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/BaSyxCore/main' into BaSyxCore/main
Browse files Browse the repository at this point in the history
  • Loading branch information
s-heppner committed Feb 1, 2024
2 parents ed0ccb8 + 6ce76f3 commit a25c2cc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions basyx/aas/adapter/json/json_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def object_store_to_json(data: model.AbstractObjectStore, **kwargs) -> str:
the AAS meta model which should be serialized to a JSON file
:param kwargs: Additional keyword arguments to be passed to :func:`json.dumps`
"""
environment = data.get_environment()
environment = data.as_environment()
# Serialize to a JSON-able mapping
jsonable = jsonization.to_jsonable(environment)

Expand All @@ -45,7 +45,7 @@ def write_aas_json_file(file: IO, data: model.AbstractObjectStore, **kwargs) ->
the AAS meta model which should be serialized to a JSON file
:param kwargs: Additional keyword arguments to be passed to `json.dump()`
"""
environment = data.get_environment()
environment = data.as_environment()
# Serialize to a JSON-able mapping
jsonable = jsonization.to_jsonable(environment)

Expand Down
2 changes: 1 addition & 1 deletion basyx/aas/adapter/xml/xml_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def write_aas_xml_file(file: IO,
the AAS meta model which should be serialized to an XML file
"""

file.write(xmlization.to_str(data.get_environment()))
file.write(xmlization.to_str(data.as_environment()))
2 changes: 1 addition & 1 deletion basyx/aas/backend/couchdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def add(self, x: model.Identifiable) -> None:
"""
logger.debug("Adding object %s to CouchDB database ...", repr(x))
# Serialize data
data = jsonization.to_jsonable(self.get_environment())
data = jsonization.to_jsonable(self.as_environment())

# Create and issue HTTP request (raises HTTPError on status != 200)

Expand Down
5 changes: 3 additions & 2 deletions basyx/aas/model/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def update(self, other: Iterable[_IT]) -> None:
for x in other:
self.add(x)

def get_environment(self) -> Environment:
@abc.abstractmethod
def as_environment(self) -> Environment:
pass


Expand All @@ -97,7 +98,7 @@ def __init__(self, objects: Iterable[_IT] = ()) -> None:
def get_identifiable(self, identifier: Identifier) -> _IT:
return self._backend[identifier]

def get_environment(self) -> Environment:
def as_environment(self) -> Environment:
asset_administration_shells: List[AssetAdministrationShell] = []
submodels: List[Submodel] = []
concept_descriptions: List[ConceptDescription] = []
Expand Down

0 comments on commit a25c2cc

Please sign in to comment.