Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyI40AAS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lehrstuhl für Informations- und Automatisierungssysteme
PyI40AAS
Commits
71459e7d
Commit
71459e7d
authored
Mar 30, 2021
by
Sebastian Heppner
Browse files
Options
Downloads
Patches
Plain Diff
aas.util: Rework docstrings for sphinx
parent
5c5d952e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!77
Documentation for v2.0.1
Pipeline
#437857
passed
Mar 30, 2021
Stage: test
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
aas/util/identification.py
+17
-9
17 additions, 9 deletions
aas/util/identification.py
aas/util/traversal.py
+5
-2
5 additions, 2 deletions
aas/util/traversal.py
with
22 additions
and
11 deletions
aas/util/identification.py
+
17
−
9
View file @
71459e7d
...
@@ -6,12 +6,13 @@
...
@@ -6,12 +6,13 @@
#
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
"""
"""
This module generates
i
dentifier
s
.
This module generates
:class:`Identifiers <aas.model.base.I
dentifier
>`
.
Generate [identifier]: -> Try:
To Generate [identifier]: -> Try:
Abstract -> AbstractIdentifierGenerator
UUID -> UUIDGenerator
- Abstract -> :class:`~.AbstractIdentifierGenerator`
IRI -> NamespaceIRIGenerator
- UUID -> :class:`~.UUIDGenerator`
- IRI -> :class:`NamespaceIRIGenerator`
"""
"""
import
abc
import
abc
...
@@ -24,7 +25,8 @@ from .. import model
...
@@ -24,7 +25,8 @@ from .. import model
class
AbstractIdentifierGenerator
(
metaclass
=
abc
.
ABCMeta
):
class
AbstractIdentifierGenerator
(
metaclass
=
abc
.
ABCMeta
):
"""
"""
Abstract base class for identifier generators that generate identifiers based on an internal schema and an
Abstract base class for identifier generators that generate :class:`Identifiers <aas.model.base.Identifier>` based
on an internal schema and an
(optional) proposal.
(optional) proposal.
Different Implementations of IdentifierGenerators may generate differently formed ids, e.g. URNs, HTTP-scheme IRIs,
Different Implementations of IdentifierGenerators may generate differently formed ids, e.g. URNs, HTTP-scheme IRIs,
...
@@ -61,9 +63,15 @@ class NamespaceIRIGenerator(AbstractIdentifierGenerator):
...
@@ -61,9 +63,15 @@ class NamespaceIRIGenerator(AbstractIdentifierGenerator):
"""
"""
An IdentifierGenerator, that generates IRIs in a given namespace, checking uniqueness against a Registry.
An IdentifierGenerator, that generates IRIs in a given namespace, checking uniqueness against a Registry.
Identifiers are generated by concatenating a fixed namespace with the proposed suffix. To verify uniqueness, the
:class:`Identifiers <aas.model.base.Identifier>` are generated by concatenating a fixed namespace with the proposed
existence of the identification is checked by querying the given Registry. If a collision is detected, a number
suffix. To verify uniqueness, the
is prepended
existence of the identification is checked by querying the given Registry. If a collision
is detected, a number is prepended
:ivar namespace: The IRI Namespace to generate Identifications in. It must be a valid IRI (starting with a
scheme) and end on either #, /, or = to form a reasonable namespace.
:ivar ~.provider: An :class:`~aas.model.provider.AbstractObjectProvider` to check existence of
:class:`Identifiers <aas.model.base.Identifier>`
"""
"""
def
__init__
(
self
,
namespace
:
str
,
provider
:
model
.
AbstractObjectProvider
):
def
__init__
(
self
,
namespace
:
str
,
provider
:
model
.
AbstractObjectProvider
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
aas/util/traversal.py
+
5
−
2
View file @
71459e7d
...
@@ -17,9 +17,12 @@ from .. import model
...
@@ -17,9 +17,12 @@ from .. import model
def
walk_submodel
(
collection
:
Union
[
model
.
Submodel
,
model
.
SubmodelElementCollection
])
\
def
walk_submodel
(
collection
:
Union
[
model
.
Submodel
,
model
.
SubmodelElementCollection
])
\
->
Iterator
[
model
.
SubmodelElement
]:
->
Iterator
[
model
.
SubmodelElement
]:
"""
"""
Traverse the SubmodelElements in a Submodel or a SubmodelElementCollection recursively in post-order tree-traversal.
Traverse the :class:`SubmodelElements <aas.model.submodel.SubmodelElement>` in a
:class:`~aas.model.submodel.Submodel` or a :class:`~aas.model.submodel.SubmodelElementCollection` recursively in
post-order tree-traversal.
This is a generator function, yielding all the SubmodelElements. No SubmodelElements should be added, removed or
This is a generator function, yielding all the :class:`SubmodelElements <aas.model.submodel.SubmodelElement>`. No
:class:`SubmodelElements <aas.model.submodel.SubmodelElement>` should be added, removed or
moved while iterating, as this could result in undefined behaviour.
moved while iterating, as this could result in undefined behaviour.
"""
"""
elements
=
collection
.
submodel_element
if
isinstance
(
collection
,
model
.
Submodel
)
else
collection
.
value
elements
=
collection
.
submodel_element
if
isinstance
(
collection
,
model
.
Submodel
)
else
collection
.
value
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment