sintel-dev / Zephyr

https://dtail.gitbook.io/zephyr/
MIT License
9 stars 2 forks source link

Display summary of loaded entities #12

Open sarahmish opened 1 year ago

sarahmish commented 1 year ago

Currently the validation function in Zephyr shows an error when loading an entityset does not conform to the expected metadata. For example, if turbines entity is missing COD_ELEMENT the following error will be displayed

ValueError: Turbines index column "COD_ELEMENT" missing from data for turbines entity

Rather than erroring out, the validation function should display an entire summary for each entity:

This will look something like unittesting print

Name                                                                      Pass   Fail  Cover
---------------------------------------------------------------------------------------------
turbines                                                                   x      1     90%
work_orders                                                                x      1     95%
notifications                                                              x      1     92%
stoppages                                                                  ✓            100%
alarms                                                                     ✓            100%
pidata                                                                     ✓            100%
---------------------------------------------------------------------------------------------
TOTAL                                                                      6      3     96%

turbines
ValueError: Turbines index column "COD_ELEMENT" missing from data for turbines entity

work_orders
ValueError: Expected index column "COD_ORDER" of work_orders entity is not unique

notifications
ValueError: Missing time index column "DAT_POSTING" from notifications entity

To use Zephyr, the validation above must all pass with 100%.