aiidateam / disk-objectstore

An implementation of an efficient "object store" (actually, a key-value store) writing files on disk and not requiring a running server
https://disk-objectstore.readthedocs.io
MIT License
16 stars 8 forks source link

✨ Add the concept of a (unique) container ID #97

Closed giovannipizzi closed 4 years ago

giovannipizzi commented 4 years ago

This fixes #11 I also fixed a bug I discovered, where config values that were cached but the cache was not cleared when re-initialising the container. To reduce the risk of such a problem, I am now only caching the whole configuration dictionary (and not each value), and I don't need to implement caching anymore for each single config value; and I just need to clear one variable self._config rather than each newly-defined configuration.

In addition, I add a test to check that re-initialising the container creates a new container ID (container.container_id).

giovannipizzi commented 4 years ago

This is a draft PR and is blocked because it builds upon the commits of #96 and can be merged only after #96 is merged

codecov[bot] commented 4 years ago

Codecov Report

Merging #97 into develop will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop       #97   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines         1502      1502           
=========================================
  Hits          1502      1502           
Impacted Files Coverage Δ
disk_objectstore/container.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 64326c7...aaa4f73. Read the comment docs.