• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eclipse-aascw / aas-core-codegen / 35243962401
90%

Build:
DEFAULT BRANCH: main
Ran 17 Sep 2026 04:07PM UTC
Jobs 3
Files 264
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Sep 2026 04:01PM UTC coverage: 85.63% (-0.006%) from 85.636%
35243962401

push

github

web-flow
Compose the Python JSON de-serialization (#706)

Five sixths of the generated ``jsonization.py`` was de-serialization,
and a class cost four constructs there: a ``_SetterFor<Cls>`` class, a
field on it per property, a twelve-line ``set_<prop>_from_jsonable``
method whose body was a single assignment, and a
``_SETTER_MAP_FOR_<CLS>`` of bound methods. Every
``<cls>_from_jsonable`` then re-emitted the same framing around the
property loop, and every dispatching function was the same twenty lines
with two tokens substituted in. The property loop now assigns straight
into the locals which the constructor is called with, the way the C#, Go
and Java generators already do:

    def blob_from_jsonable(jsonable):
        mapping = _as_mapping(jsonable)

        model_type = mapping.get('modelType', None)
        if model_type != 'Blob':
            raise DeserializationException(
                f"Expected modelType to be 'Blob', "
                f"but got: {model_type!r}"
            )

        the_value: Optional[bytes] = None
        the_content_type: Optional[str] = None
        ...

        try:
            for key, jsonable_value in mapping.items():
                if key == 'modelType':
                    # The model type has already been checked above.
                    pass
                elif key == 'value':
                    the_value = _bytes_from_jsonable(jsonable_value)
                ...
                else:
                    raise DeserializationException(
                        f"Unexpected property: {key}"
                    )
        except DeserializationException as exception:
            exception.path._prepend(PropertySegment(mapping, key))
            raise

The rationale and the design:

* The loop is generated per class because a shared one cannot write its
  caller's locals. That is the only reason ``_SetterFor<Cls>`` existed,
  and it cost an object allocated for every instance, a field
  initialised for every property, ... (continued)

215 of 230 new or added lines in 3 files covered. (93.48%)

2 existing lines in 1 file now uncovered.

34215 of 39957 relevant lines covered (85.63%)

2.57 hits per line

Uncovered Changes

Lines Coverage ∆ File
14
94.01
-1.52% aas_core_codegen/python/lib/_generate_jsonization.py
1
79.9
2.93% aas_core_codegen/python/common.py

Coverage Regressions

Lines Coverage ∆ File
2
89.8
-4.08% aas_core_codegen/python/naming.py
Jobs
ID Job ID Ran Files Coverage
1 3.11 - 35243962401.1 17 Sep 2026 04:09PM UTC 264
85.63
GitHub Action Run
2 3.10 - 35243962401.2 17 Sep 2026 04:09PM UTC 264
85.63
GitHub Action Run
3 3.12 - 35243962401.3 17 Sep 2026 04:09PM UTC 264
85.63
GitHub Action Run
Source Files on build 35243962401
  • Tree
  • List 264
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8874e4c9 on github
  • Prev Build on main (#35242364759)
  • Next Build on main (#35246730356)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc