kirillseva / cacher

In memory cache interface for R
4 stars 4 forks source link

Allow cache size to be specified in terms of memory (*bytes) #2

Closed elainexmas closed 8 years ago

elainexmas commented 8 years ago

cacher parses the argument; if it's a string it should describe a size, e.g. "100 MB" otherwise it should be an integer describing the number of entries the cache can accommodate.

If cacher is initialized with a disk space size, it should perform caching with respect to the sizes of objects getting added, not quantity of objects.

elainexmas commented 8 years ago

I'm aware the as.integer(as.character(...)) way of getting object sizes into byte form is inelegant. :(

Also, the reference for 1KB = 1000B

codecov-io commented 8 years ago

Current coverage is 100.00%

Merging #2 into master will not affect coverage as of 03a35ce

@@            master      #2   diff @@
======================================
  Files            1       1       
  Stmts            1       1       
  Branches         0       0       
  Methods          0       0       
======================================
  Hit              1       1       
  Partial          0       0       
  Missed           0       0       

Review entire Coverage Diff as of 03a35ce

Powered by Codecov. Updated on successful CI builds.

kirillseva commented 8 years ago

Thanks @codecov-io

elainexmas commented 8 years ago

@kirillseva should pryr be getting imported into the namespace? I realized I had done it but maybe it's safer to leave it out (or only import the object_size function).

kirillseva commented 8 years ago

I do not have a strong opinion on how to import. But make sure you run 'document' to update the namespace file depending on your choice