entropy-lab / entropy

BSD 3-Clause "New" or "Revised" License
30 stars 13 forks source link

Refactored InProcessParamStore to inherit from Munch #172

Closed urig closed 2 years ago

urig commented 2 years ago

This PR introduces a refactoring of the implementation of InProcessParamStore. A reduction in number of lines of code is achieved through inheriting from Munch instead of from MutableMapping. This includes switching the mutex lock from Lock to RLock.

There are no functional changes to the implementation of InProcessParamStore with only 3 minor exceptions:

  1. InProcessParamStore can now be used as a context manager. When it exits the tinydb file is closed.
  2. Trying to set a param with a key starting with underscore (_) is now allowed. This previously raised a KeyError.
  3. Keys that start with duner (__) are not considered params and are not persisted to the DB because they might hide private attributes.
github-actions[bot] commented 2 years ago

Unit Test Results

    1 files      1 suites   51s :stopwatch: 192 tests 188 :heavy_check_mark: 4 :zzz: 0 :x:

Results for commit 3c9854b8.

:recycle: This comment has been updated with latest results.