-
Notifications
You must be signed in to change notification settings - Fork 1
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
Unexpected result with cf.wi and cf.cellwi #30
Comments
Hi Bryan, ...
Bounds range [[1950-01-01 06:00:00, 1950-02-01 00:00:00]] 360_day [[2014-12-01 06:00:00, 2015-01-01 00:00:00]] 360_day
Subspacing using cellwi to 1950-01-01 06:00:00 360_day 1970-12-10 00:00:00 360_day
Bounds range [[1950-01-01 06:00:00, 1950-02-01 00:00:00]] 360_day [[1970-11-01 06:00:00, 1970-12-01 00:00:00]] 360_day
... But this looks right to me ... You asked for cells that lie completely inside If you inspect the query you see that it's just a convenience function for creating a mode complicated >>> print(cf.cellwi(start_date, end_date))
<CF Query: [lower_bounds(ge 1950-01-01 06:00:00) & upper_bounds(le 1970-12-10 00:00:00)]> We can create a new "cell overlaps" query as follows, that should do what you want (edited): >>> q1 = cf.ge(start_date, attr='upper_bounds')
>>> q2 = cf.le(end_date, attr='lower_bounds')
>>> cell_overlaps = q1 & q2
>>> cell_overlaps
<CF Query: [upper_bounds(ge 1950-01-01 06:00:00) & lower_bounds(le 1970-12-10 00:00:00)]> and then quark = fld.subspace(time=cell_overlaps(start_date, end_date)) I shall create this as a new |
|
Great. For the moment I have stuffed an explicit version into my code, and will replace it when the new CF comes out. The explicit version passes my tests! |
I am trying to subset a manifest file using the bounds that are stored in the database.
The particular test that is manifesting the issue will fail with the
pytest -s -x tests/realistic
in the within branch.The code which is causing the error can be found in
cfs/db/cfa_tools.py
This code, when run in the test yields this output (before failing the assertion in the error below):
We are expected it to grab the next cell.
The relevant test failure is this one:
which occurs because it's not getting to the next cell where that fragment file should have been present.
The text was updated successfully, but these errors were encountered: