Open and half-open intervals for `wi` queries
Close #740, where we have come to realise that it might not be a good idea to support the feature for wo queries since there is the potential for a lot of confusion, namely I started to document and implement the following behaviour:
open_lower:
bool, optional If True, open the interval at the lower bound so that value0 is excluded from the range and therefore included in the set of values outside of the range captured by "wo". By default the interval is closed so that value0 is included in the range and not captured by "wo".
and @davidhassell and I decided it might be too confusing when applied to "outside a range" as opposed to "inside a range", where it is quite intuitive. So I will update the Issue description accordingly.
Opening as a draft since I am still deciding on how best to implement this for compound queries. Currently the tests I wrote (first) are failing on the first test which checks the open/closedness of intervals within a compound query:
$ test_Query.py ─╯
Run date: 2024-03-27 16:53:21.494423
Platform: Linux-6.5.13-7-MANJARO-x86_64-with-glibc2.39
HDF5 library: 1.14.2
netcdf library: 4.9.2
udunits2 library: /home/slb93/miniconda3/envs/cf-env-312/lib/libudunits2.so.0
esmpy/ESMF: 8.4.2 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/esmpy/__init__.py
Python: 3.12.0 /home/slb93/miniconda3/envs/cf-env-312/bin/python
dask: 2024.3.1 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/dask/__init__.py
netCDF4: 1.6.4 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/netCDF4/__init__.py
psutil: 5.9.5 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/psutil/__init__.py
packaging: 23.2 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/packaging/__init__.py
numpy: 1.26.3 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/numpy/__init__.py
scipy: 1.11.3 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/scipy/__init__.py
matplotlib: 3.8.0 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/matplotlib/__init__.py
cftime: 1.6.2 /home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/cftime/__init__.py
cfunits: 3.3.6 /home/slb93/git-repos/cfunits/cfunits/__init__.py
cfplot: 3.3.0 /home/slb93/git-repos/cf-plot/cfplot/__init__.py
cfdm: 1.11.1.0 /home/slb93/git-repos/cfdm/cfdm/__init__.py
cf: 3.16.1 /home/slb93/git-repos/cf-python/cf/__init__.py
test_Query (__main__.QueryTest.test_Query) ... ok
test_Query_Units (__main__.QueryTest.test_Query_Units) ... ok
test_Query__and__ (__main__.QueryTest.test_Query__and__) ... ok
test_Query__dask_tokenize__ (__main__.QueryTest.test_Query__dask_tokenize__) ... ok
test_Query__or__ (__main__.QueryTest.test_Query__or__) ... ok
test_Query_as_where_condition (__main__.QueryTest.test_Query_as_where_condition)
Check queries work correctly as conditions in 'where' ... ok
test_Query_atol (__main__.QueryTest.test_Query_atol) ... ok
test_Query_contains (__main__.QueryTest.test_Query_contains) ... ok
test_Query_datetime1 (__main__.QueryTest.test_Query_datetime1) ... ok
test_Query_dteq_dtne_dtge_dtgt_dtle_dtlt (__main__.QueryTest.test_Query_dteq_dtne_dtge_dtgt_dtle_dtlt) ... ok
test_Query_evaluate (__main__.QueryTest.test_Query_evaluate) ... FAIL
test_Query_isclose (__main__.QueryTest.test_Query_isclose) ... ok
test_Query_iscontains (__main__.QueryTest.test_Query_iscontains) ... ok
test_Query_object_units (__main__.QueryTest.test_Query_object_units)
Check units are processed correctly in and from queries. ... ok
test_Query_rtol (__main__.QueryTest.test_Query_rtol) ... ok
test_Query_set_condition_units (__main__.QueryTest.test_Query_set_condition_units) ... ok
test_Query_setdefault (__main__.QueryTest.test_Query_setdefault) ... ok
test_Query_year_month_day_hour_minute_second (__main__.QueryTest.test_Query_year_month_day_hour_minute_second) ... ok
======================================================================
FAIL: test_Query_evaluate (__main__.QueryTest.test_Query_evaluate)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/slb93/git-repos/cf-python/cf/test/test_Query.py", line 542, in test_Query_evaluate
self.assertFalse(e2.evaluate(2))
AssertionError: True is not false
----------------------------------------------------------------------
Ran 18 tests in 0.599s
FAILED (failures=1)