spine-tools / Spine-Database-API

Database interface to Spine generic data model
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
6 stars 5 forks source link

Improve time stamp parsing performance #388

Closed soininen closed 5 months ago

soininen commented 5 months ago

We now try parsing time stamps with datetime.fromisoformat() before falling back to dateutil.parser.parse() which makes e.g. parsing DateTime objects from database ~x10 faster.

Resolves #385

Checklist before merging

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 20.00000% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 78.22%. Comparing base (ade116a) to head (b219ceb). Report is 2 commits behind head on 0.8-dev.

Files Patch % Lines
spinedb_api/parameter_value.py 20.00% 16 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## 0.8-dev #388 +/- ## =========================================== - Coverage 78.32% 78.22% -0.10% =========================================== Files 75 75 Lines 9504 9516 +12 Branches 2015 2015 =========================================== Hits 7444 7444 - Misses 1727 1739 +12 Partials 333 333 ```

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