Skip to content

Commit

Permalink
Merge pull request #139 from rwth-iat/fix/id_short
Browse files Browse the repository at this point in the history
Set `id_short` of `Identifiables` to optional
  • Loading branch information
s-heppner authored Oct 19, 2023
2 parents 9dbea12 + c44bbc9 commit 7c21edf
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion basyx/aas/model/aas.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class AssetAdministrationShell(base.Identifiable, base.UniqueIdShortNamespace, b
def __init__(self,
asset_information: AssetInformation,
id_: base.Identifier,
id_short: base.NameType = "NotSet",
id_short: Optional[base.NameType] = None,
display_name: Optional[base.MultiLanguageNameType] = None,
category: Optional[base.NameType] = None,
description: Optional[base.MultiLanguageTextType] = None,
Expand Down
2 changes: 1 addition & 1 deletion basyx/aas/model/concept.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ConceptDescription(base.Identifiable, base.HasDataSpecification):
def __init__(self,
id_: base.Identifier,
is_case_of: Optional[Set[base.Reference]] = None,
id_short: base.NameType = "NotSet",
id_short: Optional[base.NameType] = None,
display_name: Optional[base.MultiLanguageNameType] = None,
category: Optional[base.NameType] = None,
description: Optional[base.MultiLanguageTextType] = None,
Expand Down
2 changes: 1 addition & 1 deletion basyx/aas/model/submodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Submodel(base.Identifiable, base.HasSemantics, base.HasKind, base.Qualifia
def __init__(self,
id_: base.Identifier,
submodel_element: Iterable[SubmodelElement] = (),
id_short: base.NameType = "NotSet",
id_short: Optional[base.NameType] = None,
display_name: Optional[base.MultiLanguageNameType] = None,
category: Optional[base.NameType] = None,
description: Optional[base.MultiLanguageTextType] = None,
Expand Down
2 changes: 0 additions & 2 deletions test/adapter/xml/test_xml_deserialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ def test_duplicate_identifier(self) -> None:
<aas:assetAdministrationShells>
<aas:assetAdministrationShell>
<aas:id>http://acplt.org/test_aas</aas:id>
<aas:idShort>NotSet</aas:idShort>
<aas:assetInformation>
<aas:assetKind>Instance</aas:assetKind>
</aas:assetInformation>
Expand All @@ -267,7 +266,6 @@ def test_duplicate_identifier(self) -> None:
<aas:submodels>
<aas:submodel>
<aas:id>http://acplt.org/test_aas</aas:id>
<aas:idShort>NotSet</aas:idShort>
</aas:submodel>
</aas:submodels>
""")
Expand Down
5 changes: 0 additions & 5 deletions test/compliance_tool/files/test_demo_full_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "AssetAdministrationShell",
"id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory",
"assetInformation": {
Expand Down Expand Up @@ -254,7 +253,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "AssetAdministrationShell",
"id": "https://acplt.org/Test_AssetAdministrationShell2_Mandatory",
"assetInformation": {
Expand Down Expand Up @@ -1655,7 +1653,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "Submodel",
"id": "https://acplt.org/Test_Submodel_Mandatory",
"submodelElements": [
Expand Down Expand Up @@ -1805,7 +1802,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "Submodel",
"id": "https://acplt.org/Test_Submodel2_Mandatory"
},
Expand Down Expand Up @@ -3202,7 +3198,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "ConceptDescription",
"id": "https://acplt.org/Test_ConceptDescription_Mandatory"
},
Expand Down
5 changes: 0 additions & 5 deletions test/compliance_tool/files/test_demo_full_example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
</aas:submodels>
</aas:assetAdministrationShell>
<aas:assetAdministrationShell>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_AssetAdministrationShell_Mandatory</aas:id>
<aas:assetInformation>
<aas:assetKind>Instance</aas:assetKind>
Expand Down Expand Up @@ -243,7 +242,6 @@
</aas:submodels>
</aas:assetAdministrationShell>
<aas:assetAdministrationShell>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_AssetAdministrationShell2_Mandatory</aas:id>
<aas:assetInformation>
<aas:assetKind>Instance</aas:assetKind>
Expand Down Expand Up @@ -1527,7 +1525,6 @@
</aas:submodelElements>
</aas:submodel>
<aas:submodel>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_Submodel_Mandatory</aas:id>
<aas:kind>Instance</aas:kind>
<aas:submodelElements>
Expand Down Expand Up @@ -1672,7 +1669,6 @@
</aas:submodelElements>
</aas:submodel>
<aas:submodel>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_Submodel2_Mandatory</aas:id>
<aas:kind>Instance</aas:kind>
</aas:submodel>
Expand Down Expand Up @@ -3041,7 +3037,6 @@
</aas:isCaseOf>
</aas:conceptDescription>
<aas:conceptDescription>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_ConceptDescription_Mandatory</aas:id>
</aas:conceptDescription>
<aas:conceptDescription>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "AssetAdministrationShell",
"id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory",
"assetInformation": {
Expand Down Expand Up @@ -254,7 +253,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "AssetAdministrationShell",
"id": "https://acplt.org/Test_AssetAdministrationShell2_Mandatory",
"assetInformation": {
Expand Down Expand Up @@ -1655,7 +1653,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "Submodel",
"id": "https://acplt.org/Test_Submodel_Mandatory",
"submodelElements": [
Expand Down Expand Up @@ -1805,7 +1802,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "Submodel",
"id": "https://acplt.org/Test_Submodel2_Mandatory"
},
Expand Down Expand Up @@ -3202,7 +3198,6 @@
]
},
{
"idShort": "NotSet",
"modelType": "ConceptDescription",
"id": "https://acplt.org/Test_ConceptDescription_Mandatory"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
</aas:submodels>
</aas:assetAdministrationShell>
<aas:assetAdministrationShell>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_AssetAdministrationShell_Mandatory</aas:id>
<aas:assetInformation>
<aas:assetKind>Instance</aas:assetKind>
Expand Down Expand Up @@ -243,7 +242,6 @@
</aas:submodels>
</aas:assetAdministrationShell>
<aas:assetAdministrationShell>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_AssetAdministrationShell2_Mandatory</aas:id>
<aas:assetInformation>
<aas:assetKind>Instance</aas:assetKind>
Expand Down Expand Up @@ -1527,7 +1525,6 @@
</aas:submodelElements>
</aas:submodel>
<aas:submodel>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_Submodel_Mandatory</aas:id>
<aas:kind>Instance</aas:kind>
<aas:submodelElements>
Expand Down Expand Up @@ -1672,7 +1669,6 @@
</aas:submodelElements>
</aas:submodel>
<aas:submodel>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_Submodel2_Mandatory</aas:id>
<aas:kind>Instance</aas:kind>
</aas:submodel>
Expand Down Expand Up @@ -3041,7 +3037,6 @@
</aas:isCaseOf>
</aas:conceptDescription>
<aas:conceptDescription>
<aas:idShort>NotSet</aas:idShort>
<aas:id>https://acplt.org/Test_ConceptDescription_Mandatory</aas:id>
</aas:conceptDescription>
<aas:conceptDescription>
Expand Down

0 comments on commit 7c21edf

Please sign in to comment.