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
…21)

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 committed Mar 13, 2024
1 parent 0d39dd8 commit 73c2205
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 42 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 @@ -30,8 +30,8 @@
packages=find_packages(exclude=["tests", "continuous_integration", "dev_scripts"]),
install_requires=[
"icontract>=2.6.1,<3",
"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/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ function constructMatchesXsDate(): RegExp {
const monthFrag = "((0[1-9])|(1[0-2]))";
const dayFrag = `((0[1-9])|([12]${digit})|(3[01]))`;
const minuteFrag = `[0-5]${digit}`;
const timezoneFrag = `(Z|(\\+|-)(0${digit}|1[0-3]):${minuteFrag}|14:00)`;
const timezoneFrag = `(Z|(\\+|-)((0${digit}|1[0-3]):${minuteFrag}|14:00))`;
const dateLexicalRep = `${yearFrag}-${monthFrag}-${dayFrag}${timezoneFrag}?`;
const pattern = `^${dateLexicalRep}$`;

Expand Down Expand Up @@ -568,7 +568,7 @@ function constructMatchesXsDateTime(): RegExp {
const minuteFrag = `[0-5]${digit}`;
const secondFrag = `([0-5]${digit})(\\.${digit}+)?`;
const endOfDayFrag = "24:00:00(\\.0+)?";
const timezoneFrag = `(Z|(\\+|-)(0${digit}|1[0-3]):${minuteFrag}|14:00)`;
const timezoneFrag = `(Z|(\\+|-)((0${digit}|1[0-3]):${minuteFrag}|14:00))`;
const dateTimeLexicalRep = `${yearFrag}-${monthFrag}-${dayFrag}T((${hourFrag}:${minuteFrag}:${secondFrag})|${endOfDayFrag})${timezoneFrag}?`;
const 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

0 comments on commit 73c2205

Please sign in to comment.