Closed sandorkertesz closed 1 year ago
Patch coverage: 87.93
% and project coverage change: -0.33
:warning:
Comparison is base (
b77c1cd
) 95.46% compared to head (7c70ea4
) 95.14%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
That's wonderful @sandorkertesz! I've just run the code on an interactive node of our HPC and it takes 7m39s, a fantastic improvement from 41 minutes!
Fixes #53
The problem in #53 was caused by calling the following code too many times to determine whether a BUFR key is a coordinate:
This PR improves the performance by caching the
is_coord
values within a given message and providing access to them via the newly addedBufrMessage.is_coord()
method. To make it work for messages defined as a mapping (e.g. dict) the message wrapper had to be modified. Please note that the coordinate test in the code snippet above was also optimised and implemented roughly like this:The results are encouraging. For the full BUFR file from #53 this code:
runs in 8 min 24 sec on my MacBook.
As a reference, iterating through the messages with eccodes and unpacking each with the code below takes 7:26.