alan-turing-institute / DTBase

A starting point from which digital twins can be developed.
MIT License
11 stars 4 forks source link

Rework models code to use the backend, and other improvements to it #172

Closed mhauru closed 8 months ago

mhauru commented 8 months ago

This removes all the bits from both the Arima and HODMD model codes that directly read from/wrote to the database, and replaces them with calls to the backend API. While I was at it and learning my way around the code I also made other small changes.

The diff can be made nicer once #175 has been merged.

Closes #82

codecov-commenter commented 8 months ago

Codecov Report

Attention: 31 lines in your changes are missing coverage. Please review.

Comparison is base (6cff24b) 88.40% compared to head (6ba98b6) 89.12%. Report is 5 commits behind head on main.

:exclamation: Current head 6ba98b6 differs from pull request most recent head e726f78. Consider uploading reports for the commit e726f78 to get more accurate results

Files Patch % Lines
dtbase/core/db.py 58.62% 12 Missing :warning:
dtbase/core/utils.py 76.47% 4 Missing :warning:
dtbase/backend/api/sensor/routes.py 70.00% 3 Missing :warning:
dtbase/backend/api/model/routes.py 88.23% 2 Missing :warning:
dtbase/core/models.py 92.00% 2 Missing :warning:
dtbase/models/utils/backend_call.py 88.88% 2 Missing :warning:
dtbase/webapp/user.py 60.00% 2 Missing :warning:
dtbase/core/db_docker.py 66.66% 1 Missing :warning:
dtbase/models/utils/dataprocessor/get_data.py 92.85% 1 Missing :warning:
dtbase/tests/conftest.py 91.66% 1 Missing :warning:
... and 1 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #172 +/- ## ========================================== + Coverage 88.40% 89.12% +0.71% ========================================== Files 71 71 Lines 4864 4855 -9 ========================================== + Hits 4300 4327 +27 + Misses 564 528 -36 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mhauru commented 8 months ago

Moved the login and auth_backend_call functions to core, as discussed on a call.