Description
The cachehitrate
parameter in RequestedFiles_HitrateBased
is currently used as a boolean despite being an integer.
lapis.caching/lapis/caching/files.py
Lines 86 to 98 in 8f4f614
Since the meaning of a rate implies a percentage, this either needs a renaming or checking if the application of cachehitrate
in terms of a rate does not change expectation, e.g. in the HitrateStorage
and FileBasedHitrateStorage
implementation.
Here the cachehitrate
is used in two different ways,
- as a boolean in the
transfer
method forFileBasedHitrateStorage
lapis.caching/lapis/caching/storageelement.py
Lines 361 to 367 in 8f4f614
- as a multiplicative factor in the
find
method forFileBasedHitrateStorage
lapis.caching/lapis/caching/storageelement.py
Line 377 in 8f4f614
- as a multiplicative factor in
transfer
forHitrateStorage
(however, this class is out of date already)
lapis.caching/lapis/caching/storageelement.py
Line 285 in 8f4f614
As the current implementation already ensures correct functioning also with rates, I would propose to actually interpret it as it is named already. This means the following should be done:
- adaptation of docstrings to remove mentioning of interpretation as a flag
- adaptation of typehints
- unit tests to ensure that everything works as expected