Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
jkhsjdhjs committed Dec 21, 2023
1 parent 63b3d7c commit ca11e90
Show file tree
Hide file tree
Showing 45 changed files with 270 additions and 237 deletions.
12 changes: 6 additions & 6 deletions basyx/aas/adapter/aasx.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Functionality for reading and writing AASX files according to "Details of the Asset Administration Shell Part 1 V2.0",
section 7.
The AASX file format is built upon the Open Packaging Conventions (OPC; ECMA 376-2). We use the `pyecma376_2` library
The AASX file format is built upon the Open Packaging Conventions (OPC; ECMA 376-2). We use the ``pyecma376_2`` library
for low level OPC reading and writing. It currently supports all required features except for embedded digital
signatures.
Expand Down Expand Up @@ -92,7 +92,7 @@ def get_thumbnail(self) -> Optional[bytes]:
Retrieve the packages thumbnail image
The thumbnail image file is read into memory and returned as bytes object. You may use some python image library
for further processing or conversion, e.g. `pillow`:
for further processing or conversion, e.g. ``pillow``:
.. code-block:: python
Expand All @@ -119,18 +119,18 @@ 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 <basyx.aas.model.submodel.SubmodelElement>` for
``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
files. The referenced supplementary files are added to the given ``file_store`` and the
: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.
``file_store`` later.
:param object_store: An :class:`ObjectStore <aas.model.provider.AbstractObjectStore>` to add the AAS objects
from the AASX file to
: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
:param override_existing: If ``True``, existing objects in the object store are overridden with objects from the
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 <basyx.aas.model.base.Identifier>` of all
Expand Down
2 changes: 1 addition & 1 deletion basyx/aas/compliance_tool/state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Step:
A step represents a single test stage in a test protocol of a :class:`~.ComplianceToolStateManager`
:ivar name: Name of the step
:ivar ~.status: Status of the step from type Status
:ivar status: Status of the step from type Status
:ivar log_list: List of `logging.LogRecords` which belong to this step
"""
def __init__(self, name: str, status: Status, log_list: List[logging.LogRecord]):
Expand Down
2 changes: 1 addition & 1 deletion basyx/aas/examples/tutorial_aasx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Tutorial for exporting Asset Administration Shells with related objects and auxiliary files to AASX package files, using
the aas.adapter.aasx module from the Eclipse BaSyx Python SDK.
.. warning:
.. warning::
This tutorial is only valid for the current main branch of the Eclipse BaSyx Python SDK. With version 3.0 of
*Details of the Asset Administration Shell* some specifications of AASX files will change, resulting in changes of
the `AASXWriter` interface.
Expand Down
23 changes: 1 addition & 22 deletions basyx/aas/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,7 @@
.. code-block:: python
from aas.model import AssetAdministrationShell, Submodel, Property
The different modules are:
aas.py
The main module, implementing high-level structures, such as AssetAdministrationShell and ConceptDictionary.
base.py
Basic structures of the model, including all abstract classes and enumerations. This provides inheritance for the
higher level structures.
concept.py
:class:`~basyx.aas.model.concept.ConceptDescription` from the AAS meta model
as well as specialized :class:`ConceptDescriptions <basyx.aas.model.concept.ConceptDescription>` like
:class:`~aas.model.concept.IEC61360ConceptDescription`
provider.py
Providers for AAS objects, in order to store and retrieve :class:`~basyx.aas.model.base.Identifiable` objects by their
:class:`~basyx.aas.model.base.Identifier`.
submodel.py
Meta-model of the submodels and events.
from basyx.aas.model import AssetAdministrationShell, Submodel, Property
"""

from .aas import *
Expand Down
41 changes: 24 additions & 17 deletions basyx/aas/model/_string_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,26 @@
#
# SPDX-License-Identifier: MIT
"""
This module implements constraint functions for the listed constrained string types and is meant for internal use only.
.. warning::
This module is meant for internal use only.
This module implements constraint functions for the listed constrained string types.
All types are constrained in length (min and max), RevisionType and VersionType are additionally constrained
by a regular expression. The following types aliased in the base module are constrained:
- ContentType
- Identifier
- LabelType
- MessageTopicType
- NameType
- PathType
- RevisionType
- ShortNameType
- QualifierType
- VersionType
by a regular expression.
The following types aliased in the :mod:`~basyx.aas.model.base` module are constrained:
- :class:`~basyx.aas.model.base.ContentType`
- :class:`~basyx.aas.model.base.Identifier`
- :class:`~basyx.aas.model.base.LabelType`
- :class:`~basyx.aas.model.base.MessageTopicType`
- :class:`~basyx.aas.model.base.NameType`
- :class:`~basyx.aas.model.base.PathType`
- :class:`~basyx.aas.model.base.RevisionType`
- :class:`~basyx.aas.model.base.ShortNameType`
- :class:`~basyx.aas.model.base.QualifierType`
- :class:`~basyx.aas.model.base.VersionType`
- :class:`~basyx.aas.model.base.ValueTypeIEC61360`
"""

import re
Expand Down Expand Up @@ -103,14 +110,14 @@ def check_version_type(value: str, type_name: str = "VersionType") -> None:
def create_check_function(min_length: int = 0, max_length: Optional[int] = None, pattern: Optional[re.Pattern] = None) \
-> Callable[[str, str], None]:
"""
Returns a new `check_type` function with mandatory `type_name` for the given min_length, max_length and pattern
Returns a new ``check_type`` function with mandatory ``type_name`` for the given min_length, max_length and pattern
constraints.
This is the type-independent alternative to :func:`~.check_content_type`, :func:`~.check_identifier`, etc.
It is used for the definition of the :class:`ConstrainedLangStringSets <aas.model.base.ConstrainedLangStringSet>`,
as a "Basic" constrained string type only exists for :class:`~aas.model.base.MultiLanguageNameType`, where all
values are :class:`ShortNames <aas.model.base.ShortNameType>`. All other
:class:`:class:`ConstrainedLangStringSets <aas.model.base.ConstrainedLangStringSet>` use custom constraints.
It is used for the definition of the :class:`ConstrainedLangStringSets <basyx.aas.model.base.ConstrainedLangStringSet>`,
as a "Basic" constrained string type only exists for :class:`~basyx.aas.model.base.MultiLanguageNameType`, where all
values are :class:`ShortNames <basyx.aas.model.base.ShortNameType>`. All other
:class:`:class:`ConstrainedLangStringSets <basyx.aas.model.base.ConstrainedLangStringSet>` use custom constraints.
"""
def check_fn(value: str, type_name: str) -> None:
return check(value, type_name, min_length, max_length, pattern)
Expand Down
4 changes: 2 additions & 2 deletions basyx/aas/model/aas.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class AssetAdministrationShell(base.Identifiable, base.UniqueIdShortNamespace, b
An Asset Administration Shell
:ivar asset_information: :class:`~.AssetInformation` of the asset this AssetAdministrationShell is representing
:ivar ~.id: The globally unique id (:class:`~basyx.aas.model.base.Identifier`) of the element.
:ivar id: The globally unique id (:class:`~basyx.aas.model.base.Identifier`) of the element.
(inherited from :class:`~basyx.aas.model.base.Identifiable`)
:ivar id_short: Identifying string of the element within its name space. (inherited from
:class:`~basyx.aas.model.base.Referable`)
Expand All @@ -139,7 +139,7 @@ class AssetAdministrationShell(base.Identifiable, base.UniqueIdShortNamespace, b
:ivar administration: :class:`~basyx.aas.model.base.AdministrativeInformation` of an
:class:`~.basyx.aas.model.base.Identifiable` element. (inherited from
:class:`~basyx.aas.model.base.Identifiable`)
:ivar ~.submodel: Unordered list of :class:`submodels <basyx.aas.model.submodel.SubmodelElement>` to describe typically the asset
:ivar submodel: Unordered list of :class:`submodels <basyx.aas.model.submodel.SubmodelElement>` to describe typically the asset
of an AAS. (Initialization-parameter: `submodel_`)
:ivar derived_from: The :class:`reference <basyx.aas.model.base.ModelReference>` to the AAS the AAs was derived from
:ivar embedded_data_specifications: List of Embedded data specification.
Expand Down
Loading

0 comments on commit ca11e90

Please sign in to comment.