Rework with pydantic + svg images in documentation#380
Conversation
example BO is Geschaeftsobjekt
- ♻refactor Models and data validation - 🚧refactor tests - important note: Now e.g. "2.4" would be accepted as Decimal if the string is parsable (and it will be parsed!) -> a field with e.g. Decimal type hint will always be Decimal. But it can be set/initialized through e.g. a string if the string is parsable into a Decimal. -> change of some test logic is needed
|
This pull request introduces 111 alerts when merging 384358a into 8afe110 - view on LGTM.com new alerts:
|
- tests, coverage and linting now run without any issues - type_check fails at the moment -> does not find pydantic - next step: Update documentary
Added diagrams for `Geschaeftsobjekt` and `COM`
- python 3.10 ist needed (because of NoneType in test-files) - switch from marschmallow + attr to pydantic
Some notes to the PR:
|
|
|
||
| All COMponents inherit from `bo4e.com.COM`. | ||
| All Business Objects inherit from `bo4e.bo.Geschaeftsobjekt`. | ||
| All COMponents inherit from `bo4e.com.com.COM`. |
There was a problem hiding this comment.
| All COMponents inherit from `bo4e.com.com.COM`. | |
| All COMponents inherit from `bo4e.com.COM`. |
There was a problem hiding this comment.
Der Namenspace der Klasse COM ist aber
bo4e.<package>.<module>.<class>
D.h.
bo4e.com.com.COM
There was a problem hiding this comment.
vll wäre sowas wie base_com sinnvoll
There was a problem hiding this comment.
Meinste? Ich find com com COM ja großartig 😁
Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>
Das wird schwierig. Ich kann mal versuchen, ob die verschiedenen Layout-Algorithmen irgendwas besser machen, aber manuell etwas zu setzen würde nur gehen, wenn man sich einen eigenen Layout-Algorithmus definiert. Wobei ich auch nichtmal sicher bin, ob man den dann so einfach integrieren kann.
Kann gut sein, dass das geht, ich schau mal.
Das geht auf jeden Fall - sogar mit verhältnismäßig wenig Aufwand. |
Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>
Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>
Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>
Added back python versions 3.8 and 3.9 to github CI workflow because `typingx.NoneType` is unnecessary.
Since some things changed, an updated list of important things:
|
hf-kklein
left a comment
There was a problem hiding this comment.
Nur noch ein paar kleinigkeiten :) Sonst siehts gut aus. Bitte vor dem squashen dem PR/bzw. dem entstehenden Commit auf main noch einen aussagekräftigen Namen geben (also sinngemäß nicht mehr mwe sondern eher: gesamt-umbau+doku)
The cache functionality of the network is now clearer and better. Also some minor enhancements, see PR.
Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>
Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>

This draft PR should just show an example, how the pydantic approach could look like.
To avoid breaking unit tests I just copied the BO (Business Object)
Geschaeftsobjektand the COM (component)Externe Referenzas well as their unit tests and added the prefixpydantic_to the file/module names.Fixes #374