Skip to content

Commit

Permalink
fixed half the broken doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
Frosty2500 authored and jkhsjdhjs committed Dec 20, 2023
1 parent f7a1d20 commit 63b3d7c
Show file tree
Hide file tree
Showing 24 changed files with 451 additions and 451 deletions.
60 changes: 30 additions & 30 deletions basyx/aas/adapter/aasx.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def read_into(self, object_store: model.AbstractObjectStore,
This function does the main job of reading the AASX file's contents. It traverses the relationships within the
package to find AAS JSON or XML parts, parses them and adds the contained AAS objects into the provided
`object_store`. While doing so, it searches all parsed :class:`Submodels <aas.model.submodel.Submodel>` for
:class:`~aas.model.submodel.File` objects to extract the supplementary
`object_store`. While doing so, it searches all parsed :class:`Submodels <basyx.aas.model.submodel.SubmodelElement>` for
:class:`~basyx.aas.model.submodel.File` objects to extract the supplementary
files. The referenced supplementary files are added to the given `file_store` and the
:class:`~aas.model.submodel.File` objects' values are updated with the absolute name of the supplementary file
:class:`~basyx.aas.model.submodel.File` objects' values are updated with the absolute name of the supplementary file
to allow for robust resolution the file within the
`file_store` later.
Expand All @@ -131,10 +131,10 @@ def read_into(self, object_store: model.AbstractObjectStore,
:param file_store: A :class:`SupplementaryFileContainer <.AbstractSupplementaryFileContainer>` to add the
embedded supplementary files to
:param override_existing: If `True`, existing objects in the object store are overridden with objects from the
AASX that have the same :class:`~aas.model.base.Identifier`. Default behavior is to skip those objects from
AASX that have the same :class:`~basyx.aas.model.base.Identifier`. Default behavior is to skip those objects from
the AASX.
:return: A set of the :class:`Identifiers <aas.model.base.Identifier>` of all
:class:`~aas.model.base.Identifiable` objects parsed from the AASX file
:return: A set of the :class:`Identifiers <basyx.aas.model.base.Identifier>` of all
:class:`~basyx.aas.model.base.Identifiable` objects parsed from the AASX file
"""
# Find AASX-Origin part
core_rels = self.reader.get_related_parts_by_type()
Expand Down Expand Up @@ -323,18 +323,18 @@ def write_aas(self,
write_json: bool = False) -> None:
"""
Convenience method to write one or more
:class:`AssetAdministrationShells <aas.model.aas.AssetAdministrationShell>` with all included and referenced
:class:`AssetAdministrationShells <basyx.aas.model.aas.AssetAdministrationShell>` with all included and referenced
objects to the AASX package according to the part name conventions from DotAAS.
This method takes the AASs' :class:`Identifiers <aas.model.base.Identifier>` (as `aas_ids`) to retrieve the
This method takes the AASs' :class:`Identifiers <basyx.aas.model.base.Identifier>` (as `aas_ids`) to retrieve the
AASs from the given object_store.
:class:`References <aas.model.base.Reference>` to :class:`Submodels <aas.model.submodel.Submodel>` and
:class:`ConceptDescriptions <aas.model.concept.ConceptDescription>` (via semanticId attributes) are also
:class:`References <basyx.aas.model.base.Reference>` to :class:`Submodels <basyx.aas.model.submodel.SubmodelElement>` and
:class:`ConceptDescriptions <basyx.aas.model.concept.ConceptDescription>` (via semanticId attributes) are also
resolved using the
`object_store`. All of these objects are written to an aas-spec part `/aasx/data.xml` or `/aasx/data.json` in
the AASX package, compliant to the convention presented in "Details of the Asset Administration Shell".
Supplementary files which are referenced by a :class:`~aas.model.submodel.File` object in any of the
:class:`Submodels <aas.model.submodel.Submodel>` are also added to the AASX
Supplementary files which are referenced by a :class:`~basyx.aas.model.submodel.File` object in any of the
:class:`Submodels <basyx.aas.model.submodel.SubmodelElement>` are also added to the AASX
package.
This method uses `write_all_aas_objects()` to write the AASX part.
Expand All @@ -348,21 +348,21 @@ def write_aas(self,
To write multiple Asset Administration Shells to a single AASX package file, call this method once, passing
a list of AAS Identifiers to the `aas_ids` parameter.
:param aas_ids: :class:`~aas.model.base.Identifier` or Iterable of
:class:`Identifiers <aas.model.base.Identifier>` of the AAS(s) to be written to the AASX file
:param aas_ids: :class:`~basyx.aas.model.base.Identifier` or Iterable of
:class:`Identifiers <basyx.aas.model.base.Identifier>` of the AAS(s) to be written to the AASX file
:param object_store: :class:`ObjectStore <aas.model.provider.AbstractObjectStore>` to retrieve the
:class:`~aas.model.base.Identifiable` AAS objects (:class:`~aas.model.aas.AssetAdministrationShell`,
:class:`~aas.model.concept.ConceptDescription` and :class:`~aas.model.submodel.Submodel`) from
:class:`~basyx.aas.model.base.Identifiable` AAS objects (:class:`~basyx.aas.model.aas.AssetAdministrationShell`,
:class:`~basyx.aas.model.concept.ConceptDescription` and :class:`~basyx.aas.model.submodel.SubmodelElement`) from
:param file_store: :class:`SupplementaryFileContainer <~.AbstractSupplementaryFileContainer>` to retrieve
supplementary files from, which are referenced by :class:`~aas.model.submodel.File` objects
:param write_json: If `True`, JSON parts are created for the AAS and each :class:`~aas.model.submodel.Submodel`
supplementary files from, which are referenced by :class:`~basyx.aas.model.submodel.File` objects
:param write_json: If `True`, JSON parts are created for the AAS and each :class:`~basyx.aas.model.submodel.SubmodelElement`
in the AASX package file instead of XML parts. Defaults to `False`.
:raises KeyError: If one of the AAS could not be retrieved from the object store (unresolvable
:class:`Submodels <aas.model.submodel.Submodel>` and
:class:`ConceptDescriptions <aas.model.concept.ConceptDescription>` are skipped, logging a warning/info
:class:`Submodels <basyx.aas.model.submodel.SubmodelElement>` and
:class:`ConceptDescriptions <basyx.aas.model.concept.ConceptDescription>` are skipped, logging a warning/info
message)
:raises TypeError: If one of the given AAS ids does not resolve to an AAS (but another
:class:`~aas.model.base.Identifiable` object)
:class:`~basyx.aas.model.base.Identifiable` object)
"""
if isinstance(aas_ids, model.Identifier):
aas_ids = (aas_ids,)
Expand Down Expand Up @@ -428,10 +428,10 @@ def write_aas_objects(self,
"""
A thin wrapper around :meth:`write_all_aas_objects` to ensure downwards compatibility
This method takes the AAS's :class:`~aas.model.base.Identifier` (as `aas_id`) to retrieve it from the given
This method takes the AAS's :class:`~basyx.aas.model.base.Identifier` (as `aas_id`) to retrieve it from the given
object_store. If the list
of written objects includes :class:`aas.model.submodel.Submodel` objects, Supplementary files which are
referenced by :class:`~aas.model.submodel.File` objects within
referenced by :class:`~basyx.aas.model.submodel.File` objects within
those submodels, are also added to the AASX package.
.. attention::
Expand All @@ -442,12 +442,12 @@ def write_aas_objects(self,
:param part_name: Name of the Part within the AASX package to write the files to. Must be a valid ECMA376-2
part name and unique within the package. The extension of the part should match the data format (i.e.
'.json' if `write_json` else '.xml').
:param object_ids: A list of :class:`Identifiers <aas.model.base.Identifier>` of the objects to be written to
the AASX package. Only these :class:`~aas.model.base.Identifiable` objects (and included
:class:`~aas.model.base.Referable` objects) are written to the package.
:param object_store: The objects store to retrieve the :class:`~aas.model.base.Identifiable` objects from
:param object_ids: A list of :class:`Identifiers <basyx.aas.model.base.Identifier>` of the objects to be written to
the AASX package. Only these :class:`~basyx.aas.model.base.Identifiable` objects (and included
:class:`~basyx.aas.model.base.Referable` objects) are written to the package.
:param object_store: The objects store to retrieve the :class:`~basyx.aas.model.base.Identifiable` objects from
:param file_store: The :class:`SupplementaryFileContainer <aas.adapter.aasx.AbstractSupplementaryFileContainer>`
to retrieve supplementary files from (if there are any :class:`~aas.model.submodel.File`
to retrieve supplementary files from (if there are any :class:`~basyx.aas.model.submodel.File`
objects within the written objects.
:param write_json: If `True`, the part is written as a JSON file instead of an XML file. Defaults to `False`.
:param split_part: If `True`, no aas-spec relationship is added from the aasx-origin to this part. You must make
Expand Down Expand Up @@ -486,7 +486,7 @@ def write_all_aas_objects(self,
This method takes an :class:`ObjectStore <aas.model.provider.AbstractObjectStore>` and writes all contained
objects into an "aas_env" part in the AASX package. If
the ObjectStore includes :class:`~aas.model.submodel.Submodel` objects, supplementary files which are
referenced by :class:`~aas.model.submodel.File` objects
referenced by :class:`~basyx.aas.model.submodel.File` objects
within those Submodels, are fetched from the `file_store` and added to the AASX package.
.. attention::
Expand Down Expand Up @@ -712,7 +712,7 @@ class AbstractSupplementaryFileContainer(metaclass=abc.ABCMeta):
Supplementary files may be PDF files or other binary or textual files, referenced in a File object of an AAS by
their name. They are used to provide associated documents without embedding their contents (as
:class:`~aas.model.submodel.Blob` object) in the AAS.
:class:`~basyx.aas.model.submodel.Blob` object) in the AAS.
A SupplementaryFileContainer keeps track of the name and content_type (MIME type) for each file. Additionally it
allows to resolve name conflicts by comparing the files' contents and providing an alternative name for a dissimilar
Expand Down
10 changes: 5 additions & 5 deletions basyx/aas/adapter/json/json_deserialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
complete AAS JSON file, reads its contents and stores the objects in the provided
:class:`~aas.model.provider.AbstractObjectStore`. :meth:`~aas.adapter.json.json_deserialization.read_aas_json_file` is
a wrapper for this function. Instead of storing the objects in a given :class:`~aas.model.provider.AbstractObjectStore`,
it returns a :class:`~aas.model.provider.DictObjectStore` containing parsed objects.
it returns a :class:`~basyx.aas.model.provider.DictObjectStore` containing parsed objects.
The deserialization is performed in a bottom-up approach: The `object_hook()` method gets called for every parsed JSON
object (as dict) and checks for existence of the `modelType` attribute. If it is present, the `AAS_CLASS_PARSERS` dict
Expand Down Expand Up @@ -367,7 +367,7 @@ def _construct_administrative_information(
def _construct_operation_variable(cls, dct: Dict[str, object]) -> model.SubmodelElement:
"""
Since we don't implement `OperationVariable`, this constructor discards the wrapping `OperationVariable` object
and just returns the contained :class:`~aas.model.submodel.SubmodelElement`.
and just returns the contained :class:`~basyx.aas.model.submodel.SubmodelElement`.
"""
# TODO: remove the following type: ignore comments when mypy supports abstract types for Type[T]
# see https://github.com/python/mypy/issues/5374
Expand Down Expand Up @@ -814,7 +814,7 @@ def read_aas_json_file_into(object_store: model.AbstractObjectStore, file: IO, r
See https://git.rwth-aachen.de/acplt/pyi40aas/-/issues/91
This parameter is ignored if a decoder class is specified.
:param decoder: The decoder class used to decode the JSON objects
:return: A set of :class:`Identifiers <aas.model.base.Identifier>` that were added to object_store
:return: A set of :class:`Identifiers <basyx.aas.model.base.Identifier>` that were added to object_store
"""
ret: Set[model.Identifier] = set()
decoder_ = _select_decoder(failsafe, stripped, decoder)
Expand Down Expand Up @@ -867,12 +867,12 @@ def read_aas_json_file_into(object_store: model.AbstractObjectStore, file: IO, r
def read_aas_json_file(file: IO, **kwargs) -> model.DictObjectStore[model.Identifiable]:
"""
A wrapper of :meth:`~aas.adapter.json.json_deserialization.read_aas_json_file_into`, that reads all objects in an
empty :class:`~aas.model.provider.DictObjectStore`. This function supports the same keyword arguments as
empty :class:`~basyx.aas.model.provider.DictObjectStore`. This function supports the same keyword arguments as
:meth:`~aas.adapter.json.json_deserialization.read_aas_json_file_into`.
:param file: A filename or file-like object to read the JSON-serialized data from
:param kwargs: Keyword arguments passed to :meth:`~aas.adapter.json.json_deserialization.read_aas_json_file_into`
:return: A :class:`~aas.model.provider.DictObjectStore` containing all AAS objects from the JSON file
:return: A :class:`~basyx.aas.model.provider.DictObjectStore` containing all AAS objects from the JSON file
"""
object_store: model.DictObjectStore[model.Identifiable] = model.DictObjectStore()
read_aas_json_file_into(object_store, file, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion basyx/aas/adapter/json/json_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def _operation_variable_to_json(cls, obj: model.SubmodelElement) -> Dict[str, ob
"""
serialization of an object from class SubmodelElement to a json OperationVariable representation
Since we don't implement the `OperationVariable` class, which is just a wrapper for a single
:class:`~aas.model.submodel.SubmodelElement`, elements are serialized as the `value` attribute of an
:class:`~basyx.aas.model.submodel.SubmodelElement`, elements are serialized as the `value` attribute of an
`operationVariable` object.
:param obj: object of class `SubmodelElement`
Expand Down
12 changes: 6 additions & 6 deletions basyx/aas/adapter/xml/xml_deserialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file_into` constructs all elements of an XML document and
stores them in a given :class:`ObjectStore <aas.model.provider.AbstractObjectStore>`
- :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file` constructs all elements of an XML document and returns
them in a :class:`~aas.model.provider.DictObjectStore`
them in a :class:`~basyx.aas.model.provider.DictObjectStore`
These functions take a decoder class as keyword argument, which allows parsing in failsafe (default) or non-failsafe
mode. Parsing stripped elements - used in the HTTP adapter - is also possible. It is also possible to subclass the
Expand Down Expand Up @@ -543,7 +543,7 @@ def _construct_referable_reference(cls, element: etree.Element, **kwargs: Any) \
def _construct_operation_variable(cls, element: etree.Element, **kwargs: Any) -> model.SubmodelElement:
"""
Since we don't implement `OperationVariable`, this constructor discards the wrapping `aas:operationVariable`
and `aas:value` and just returns the contained :class:`~aas.model.submodel.SubmodelElement`.
and `aas:value` and just returns the contained :class:`~basyx.aas.model.submodel.SubmodelElement`.
"""
value = _get_child_mandatory(element, NS_AAS + "value")
if len(value) == 0:
Expand Down Expand Up @@ -1407,7 +1407,7 @@ def read_aas_xml_file_into(object_store: model.AbstractObjectStore[model.Identif
into a given :class:`ObjectStore <aas.model.provider.AbstractObjectStore>`.
:param object_store: The :class:`ObjectStore <aas.model.provider.AbstractObjectStore>` in which the
:class:`~aas.model.base.Identifiable` objects should be stored
:class:`~basyx.aas.model.base.Identifiable` objects should be stored
:param file: A filename or file-like object to read the XML-serialized data from
:param replace_existing: Whether to replace existing objects with the same identifier in the object store or not
:param ignore_existing: Whether to ignore existing objects (e.g. log a message) or raise an error.
Expand All @@ -1420,7 +1420,7 @@ def read_aas_xml_file_into(object_store: model.AbstractObjectStore[model.Identif
This parameter is ignored if a decoder class is specified.
:param decoder: The decoder class used to decode the XML elements
:param parser_kwargs: Keyword arguments passed to the XMLParser constructor
:return: A set of :class:`Identifiers <aas.model.base.Identifier>` that were added to object_store
:return: A set of :class:`Identifiers <basyx.aas.model.base.Identifier>` that were added to object_store
"""
ret: Set[model.Identifier] = set()

Expand Down Expand Up @@ -1474,12 +1474,12 @@ def read_aas_xml_file_into(object_store: model.AbstractObjectStore[model.Identif
def read_aas_xml_file(file: IO, **kwargs: Any) -> model.DictObjectStore[model.Identifiable]:
"""
A wrapper of :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file_into`, that reads all objects in an
empty :class:`~aas.model.provider.DictObjectStore`. This function supports
empty :class:`~basyx.aas.model.provider.DictObjectStore`. This function supports
the same keyword arguments as :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file_into`.
:param file: A filename or file-like object to read the XML-serialized data from
:param kwargs: Keyword arguments passed to :meth:`~aas.adapter.xml.xml_deserialization.read_aas_xml_file_into`
:return: A :class:`~aas.model.provider.DictObjectStore` containing all AAS objects from the XML file
:return: A :class:`~basyx.aas.model.provider.DictObjectStore` containing all AAS objects from the XML file
"""
object_store: model.DictObjectStore[model.Identifiable] = model.DictObjectStore()
read_aas_xml_file_into(object_store, file, **kwargs)
Expand Down
Loading

0 comments on commit 63b3d7c

Please sign in to comment.