Skip to content

Commit

Permalink
Update to aas-core-meta, codegen, testgen 79314c6, 94399e1, e1087880 (#…
Browse files Browse the repository at this point in the history
…29)

We update the development requirements to and re-generate everything
with:
* [aas-core-meta 79314c6],
* [aas-core-codegen 94399e1] and
* [aas-core3.0-testgen e1087880].

Notably, we fix the patterns for date and date-times with zone offset
`14:00` which previously allowed for a concatenation without a plus
sign.

In addition, we fix the test data for defects which were detected while
testing with the generated C++ SDK. This concerns the examples of
doubles which overflowed in C++, but where silently accepted otherwise.

[aas-core-meta 79314c6]: aas-core-works/aas-core-meta@79314c6
[aas-core-codegen 94399e1]: aas-core-works/aas-core-codegen@94399e1
[aas-core3.0-testgen e1087880]: aas-core-works/aas-core3.0-testgen@e1087880
  • Loading branch information
mristin authored Mar 13, 2024
1 parent 0cb7de7 commit b8966cb
Show file tree
Hide file tree
Showing 37 changed files with 72 additions and 62 deletions.
2 changes: 1 addition & 1 deletion dev_scripts/aas_core3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This copy is necessary so that we can decouple from ``aas-core*-python`` repository.
The revision of aas-core-codegen was: 256cc8a
The revision of aas-core-codegen was: 94399e1
"""
4 changes: 2 additions & 2 deletions dev_scripts/aas_core3/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def _construct_matches_xs_date() -> Pattern[str]:
month_frag = '((0[1-9])|(1[0-2]))'
day_frag = f'((0[1-9])|([12]{digit})|(3[01]))'
minute_frag = f'[0-5]{digit}'
timezone_frag = f'(Z|(\\+|-)(0{digit}|1[0-3]):{minute_frag}|14:00)'
timezone_frag = f'(Z|(\\+|-)((0{digit}|1[0-3]):{minute_frag}|14:00))'
date_lexical_rep = f'{year_frag}-{month_frag}-{day_frag}{timezone_frag}?'
pattern = f'^{date_lexical_rep}$'

Expand Down Expand Up @@ -557,7 +557,7 @@ def _construct_matches_xs_date_time() -> Pattern[str]:
minute_frag = f'[0-5]{digit}'
second_frag = f'([0-5]{digit})(\\.{digit}+)?'
end_of_day_frag = '24:00:00(\\.0+)?'
timezone_frag = f'(Z|(\\+|-)(0{digit}|1[0-3]):{minute_frag}|14:00)'
timezone_frag = f'(Z|(\\+|-)((0{digit}|1[0-3]):{minute_frag}|14:00))'
date_time_lexical_rep = f'{year_frag}-{month_frag}-{day_frag}T(({hour_frag}:{minute_frag}:{second_frag})|{end_of_day_frag}){timezone_frag}?'
pattern = f'^{date_time_lexical_rep}$'

Expand Down
40 changes: 25 additions & 15 deletions dev_scripts/aas_core3/xmlization.py
Original file line number Diff line number Diff line change
Expand Up @@ -10261,7 +10261,7 @@ def _raise_if_has_tail_or_attrib(
def _read_end_element(
element: Element,
iterator: Iterator[Tuple[str, Element]]
) -> None:
) -> Element:
"""
Read the end element corresponding to the start :paramref:`element`
from :paramref:`iterator`.
Expand Down Expand Up @@ -10289,6 +10289,8 @@ def _read_end_element(

_raise_if_has_tail_or_attrib(next_element)

return next_element


def _read_text_from_element(
element: Element,
Expand All @@ -10310,18 +10312,21 @@ def _read_text_from_element(
"""
_raise_if_has_tail_or_attrib(element)

if element.text is None:
raise DeserializationException(
"Expected an element with text, but got an element with no text."
)

text = element.text

_read_end_element(
end_element = _read_end_element(
element,
iterator
iterator,
)

if text is None:
if end_element.text is None:
raise DeserializationException(
"Expected an element with text, but got an element with no text."
)

text = end_element.text

return text


Expand Down Expand Up @@ -10461,18 +10466,23 @@ def _read_str_from_element_text(
# the ``element`` to contain *some* text. In contrast, this function
# can also deal with empty text, in which case it returns an empty string.

_raise_if_has_tail_or_attrib(element)
result = (
element.text
if element.text is not None
else ""
)
text = element.text

_read_end_element(
end_element = _read_end_element(
element,
iterator
)

if text is None:
text = end_element.text

_raise_if_has_tail_or_attrib(element)
result = (
text
if text is not None
else ""
)

return result


Expand Down
4 changes: 2 additions & 2 deletions dev_scripts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
keywords="asset administration shell code generation industry 4.0 industrie i4.0",
packages=find_packages(exclude=["tests", "continuous_integration", "dev_scripts"]),
install_requires=[
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@c9692bc#egg=aas-core-meta",
"aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@256cc8a#egg=aas-core-codegen",
"aas-core-meta@git+https://github.com/aas-core-works/aas-core-meta@79314c6#egg=aas-core-meta",
"aas-core-codegen@git+https://github.com/aas-core-works/aas-core-codegen@94399e1#egg=aas-core-codegen",
],
py_modules=["test_codegen"],
)
4 changes: 2 additions & 2 deletions src/AasCore.Aas3_0/verification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ private static Regex _constructMatchesXsDate()
var monthFrag = "((0[1-9])|(1[0-2]))";
var dayFrag = $"((0[1-9])|([12]{digit})|(3[01]))";
var minuteFrag = $"[0-5]{digit}";
var timezoneFrag = $"(Z|(\\+|-)(0{digit}|1[0-3]):{minuteFrag}|14:00)";
var timezoneFrag = $"(Z|(\\+|-)((0{digit}|1[0-3]):{minuteFrag}|14:00))";
var dateLexicalRep = $"{yearFrag}-{monthFrag}-{dayFrag}{timezoneFrag}?";
var pattern = $"^{dateLexicalRep}$";

Expand Down Expand Up @@ -538,7 +538,7 @@ private static Regex _constructMatchesXsDateTime()
var minuteFrag = $"[0-5]{digit}";
var secondFrag = $"([0-5]{digit})(\\.{digit}+)?";
var endOfDayFrag = "24:00:00(\\.0+)?";
var timezoneFrag = $"(Z|(\\+|-)(0{digit}|1[0-3]):{minuteFrag}|14:00)";
var timezoneFrag = $"(Z|(\\+|-)((0{digit}|1[0-3]):{minuteFrag}|14:00))";
var dateTimeLexicalRep = $"{yearFrag}-{monthFrag}-{dayFrag}T(({hourFrag}:{minuteFrag}:{secondFrag})|{endOfDayFrag}){timezoneFrag}?";
var pattern = $"^{dateTimeLexicalRep}$";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"extensions": [
{
"name": "something_aae6caf4",
"value": "0705-04-1014:00",
"value": "0705-04-10+14:00",
"valueType": "xs:date"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"extensions": [
{
"name": "something_aae6caf4",
"value": "0532-09-07T18:47:5214:00",
"value": "0532-09-07T18:47:52+14:00",
"valueType": "xs:dateTime"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"extensions": [
{
"name": "something_aae6caf4",
"value": "+7626E-86876716",
"value": "+76E-86",
"valueType": "xs:double"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"extensions": [
{
"name": "something_aae6caf4",
"value": "-.66E-452289",
"value": "-.66E-45",
"valueType": "xs:double"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"idShort": "something3fdd3eb4",
"modelType": "Property",
"value": "0705-04-1014:00",
"value": "0705-04-10+14:00",
"valueType": "xs:date"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"idShort": "something3fdd3eb4",
"modelType": "Property",
"value": "0532-09-07T18:47:5214:00",
"value": "0532-09-07T18:47:52+14:00",
"valueType": "xs:dateTime"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"idShort": "something3fdd3eb4",
"modelType": "Property",
"value": "+7626E-86876716",
"value": "+76E-86",
"valueType": "xs:double"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"idShort": "something3fdd3eb4",
"modelType": "Property",
"value": "-.66E-452289",
"value": "-.66E-45",
"valueType": "xs:double"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"qualifiers": [
{
"type": "something_5964ab43",
"value": "0705-04-1014:00",
"value": "0705-04-10+14:00",
"valueType": "xs:date"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"qualifiers": [
{
"type": "something_5964ab43",
"value": "0532-09-07T18:47:5214:00",
"value": "0532-09-07T18:47:52+14:00",
"valueType": "xs:dateTime"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"qualifiers": [
{
"type": "something_5964ab43",
"value": "+7626E-86876716",
"value": "+76E-86",
"valueType": "xs:double"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"qualifiers": [
{
"type": "something_5964ab43",
"value": "-.66E-452289",
"value": "-.66E-45",
"valueType": "xs:double"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"submodelElements": [
{
"idShort": "something3fdd3eb4",
"max": "0705-04-1014:00",
"min": "0705-04-1014:00",
"max": "0705-04-10+14:00",
"min": "0705-04-10+14:00",
"modelType": "Range",
"valueType": "xs:date"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"submodelElements": [
{
"idShort": "something3fdd3eb4",
"max": "0532-09-07T18:47:5214:00",
"min": "0532-09-07T18:47:5214:00",
"max": "0532-09-07T18:47:52+14:00",
"min": "0532-09-07T18:47:52+14:00",
"modelType": "Range",
"valueType": "xs:dateTime"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"submodelElements": [
{
"idShort": "something3fdd3eb4",
"max": "+7626E-86876716",
"min": "+7626E-86876716",
"max": "+76E-86",
"min": "+76E-86",
"modelType": "Range",
"valueType": "xs:double"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"submodelElements": [
{
"idShort": "something3fdd3eb4",
"max": "-.66E-452289",
"min": "-.66E-452289",
"max": "-.66E-45",
"min": "-.66E-45",
"modelType": "Range",
"valueType": "xs:double"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<extension>
<name>something_aae6caf4</name>
<valueType>xs:date</valueType>
<value>0705-04-1014:00</value>
<value>0705-04-10+14:00</value>
</extension>
</extensions>
<id>something_142922d6</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<extension>
<name>something_aae6caf4</name>
<valueType>xs:dateTime</valueType>
<value>0532-09-07T18:47:5214:00</value>
<value>0532-09-07T18:47:52+14:00</value>
</extension>
</extensions>
<id>something_142922d6</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<extension>
<name>something_aae6caf4</name>
<valueType>xs:double</valueType>
<value>+7626E-86876716</value>
<value>+76E-86</value>
</extension>
</extensions>
<id>something_142922d6</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<extension>
<name>something_aae6caf4</name>
<valueType>xs:double</valueType>
<value>-.66E-452289</value>
<value>-.66E-45</value>
</extension>
</extensions>
<id>something_142922d6</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<property>
<idShort>something3fdd3eb4</idShort>
<valueType>xs:date</valueType>
<value>0705-04-1014:00</value>
<value>0705-04-10+14:00</value>
</property>
</submodelElements>
</submodel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<property>
<idShort>something3fdd3eb4</idShort>
<valueType>xs:dateTime</valueType>
<value>0532-09-07T18:47:5214:00</value>
<value>0532-09-07T18:47:52+14:00</value>
</property>
</submodelElements>
</submodel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<property>
<idShort>something3fdd3eb4</idShort>
<valueType>xs:double</valueType>
<value>+7626E-86876716</value>
<value>+76E-86</value>
</property>
</submodelElements>
</submodel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<property>
<idShort>something3fdd3eb4</idShort>
<valueType>xs:double</valueType>
<value>-.66E-452289</value>
<value>-.66E-45</value>
</property>
</submodelElements>
</submodel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<qualifier>
<type>something_5964ab43</type>
<valueType>xs:date</valueType>
<value>0705-04-1014:00</value>
<value>0705-04-10+14:00</value>
</qualifier>
</qualifiers>
</submodel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<qualifier>
<type>something_5964ab43</type>
<valueType>xs:dateTime</valueType>
<value>0532-09-07T18:47:5214:00</value>
<value>0532-09-07T18:47:52+14:00</value>
</qualifier>
</qualifiers>
</submodel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<qualifier>
<type>something_5964ab43</type>
<valueType>xs:double</valueType>
<value>+7626E-86876716</value>
<value>+76E-86</value>
</qualifier>
</qualifiers>
</submodel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<qualifier>
<type>something_5964ab43</type>
<valueType>xs:double</valueType>
<value>-.66E-452289</value>
<value>-.66E-45</value>
</qualifier>
</qualifiers>
</submodel>
Expand Down
Loading

0 comments on commit b8966cb

Please sign in to comment.