-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix data_returned and data_available #93
Conversation
data_returned is defined as the total number of data that can be returned using the passed parameters. data_available is defined as the total number of data available of a certain type at any time. data_available is saved "lazily", i.e., when the first request has been made, and then it is stored as a property for the specific collection instance. Tests have been slightly updated to account for the fix. Perhaps the expected data_returned value should be hardcoded?
Codecov Report
@@ Coverage Diff @@
## master #93 +/- ##
==========================================
+ Coverage 85.06% 85.06% +<.01%
==========================================
Files 38 38
Lines 2209 2210 +1
==========================================
+ Hits 1879 1880 +1
Misses 330 330
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clearing this up @CasperWA, I guess we all read the spec the same way.
I'm happy to approve at this stage, but have a minor comment. In the Mongo case, collection.count()
will already use a cached value if no insertions/deletions have occurred, but obviously our value will become "out of date" if any have occurred. I guess this is just one of those implementation dependent things again, but calling count() explicitly every time makes sense to me as the number will always be correct if the number of documents has changed, and it shouldn't be much slower than the python cached version when it hasn't changed.
Ah, didn't know this. And maybe it is just easier to actually use the implemented methods. I will remove the local "cache". |
See the OPTiMaDe spec issue here.
data_returned
is defined as the total number of data that can be returned using the passed parameters.data_available
is defined as the total number of data available of a certain type at any time.data_available
is saved "lazily", i.e., when the first request has been made, and then it is stored as a property for the specific collection instance.Tests have been slightly updated to account for the fix.
Perhaps the expected
data_returned
value should be hard-coded?