Comments (10)
I think that most of our tests work one level down at the WSGI level and skip HTTP altogether. This is quite a bit faster and then avoids any problems with the network stack that you don't really want your tests to rely on..
We do this by passing a WSGI app object into WebOb.request.blank (IIRC). Would something like that work for you?
from pydap.
We do this by passing a WSGI app object into WebOb.request.blank (IIRC). Would something like that work for you?
Sure, though I would prefer to be able to use a utility function from pydap rather than constructing such objects myself. WSGI and WebOb feel like implementation details that I would rather not leak into the xarray test suite.
from pydap.
@shoyer, @jameshiebert
I have actually been working on this at the end of last week. It's in merging/handlers.csv.
To get this branch together, I wanted to clean-up the CSV handler so that I could have a real sever test. In that branch, the test server is in the file test_devel_server.py
.
I've also been working on a netcdf4
handler merging/handlers.netcdf to test more complex use cases.
I was thinking that I could also code an xarray
-based handler. It would then make it possible to create a suite of unittests for xarray
-pydap
integration. Would that be something you would be interested in @shoyer ?
from pydap.
I was thinking that I could also code an xarray-based handler. It would then make it possible to create a suite of unittests for xarray-pydap integration. Would that be something you would be interested in @shoyer ?
Indeed, an xarray based handler seems like a natural addition. I can see xarray (especially with dask) being a nice way to setup a pydap server, e.g., as a more flexible substitute for pydap.handlers.nca. This isn't something I would use personally (I would be more likely to just launch a remote dask-distributed server), but you should build it if you would find it useful.
For a comprehensive integration test (like the tests we run in xarray/test/test_backends.py
), I think we would indeed want to use lower level integration to avoid relying on HTTP stack -- several seconds to launch a server per test case and the inability to drop into a debugger could be painfully slow to debug. For what it's worth, I'm pretty sure that if you did set this up you would expose bugs in pydap (or at least the xarray integration) for some edge cases -- this is true for basically every new backend I've run the full backends suite against.
from pydap.
WSGI and WebOb feel like implementation details that I would rather not leak into the xarray test suite.
Ah yes, that's a good point. I can see your motivation there.
I think we would indeed want to use lower level integration to avoid relying on HTTP stack -- several seconds to launch a server per test case and the inability to drop into a debugger could be painfully slow to debug.
Indeed. I believe that there are some tests in Pydap that do use a local server and, you're right, if anything goes wrong in the test from the client side, you're basically unable to debug it from the server side.
For what it's worth, I'm pretty sure that if you did set this up you would expose bugs in pydap (or at least the xarray integration) for some edge cases -- this is true for basically every new backend I've run the full backends suite against.
Hrm, can you explain that a bit more? What kind of bugs in Pydap have you been seeing? Do you mind posting issues about them?
from pydap.
I can only guess but the way I understood this question was that @shoyer meant that if one was to implement an xarray
handler and essentially tests xarray
onto that pydap-xarray
handler then one would fairly easily uncover edge cases bugs, in both the OPeNDAP integration within xarray
and within the DAPHandler
of pydap
. It would be some work but it seems like it could greatly improve the stability of pydap
...
from pydap.
@jameshiebert Yes, I didn't mean that I know about bugs in pydap -- just that in my experience there are lots of weird edge cases (indexing operations, different dtypes, scalar or size 0 arrays, bytes vs unicode, fill values, Python 2 vs 3, ...) that are easy to miss. Maybe pydap is better tested than projects like netcdf4-python but certainly our test suite turned up plenty of issues there.
from pydap.
from pydap.
@shoyer
I've revisited #34 and it turns out that one can drop any delay after the sever has been set-up, resulting in just a small overhead to testing through the simple_server
. So while it should probably not be used for pydap
tests, it could certainly be used for a subset of xarray
-pydap
tests.
from pydap.
With #92 merged, I think that we can safely close this issue. Feel free to reopen if I missed anything.
from pydap.
Related Issues (20)
- require that CI pass before merge to master is permitted HOT 1
- Add python 3.10 run to GitHub CI HOT 1
- Many warnings like: Unknown pytest.mark.auth - is this a typo? due to unregistered custom pytest marks.
- Remove travis (was: Get travis working) HOT 3
- enable infinity for float attributes
- documentation build fails HOT 2
- add macOS to GitHub actions CI build
- pydap tests fail on macos for python >= 3.8 HOT 5
- Add trace mechanism so we can see network/http accesses
- ValueError when trying to access data from thredds.met.no HOT 3
- pydap fails with Python 3.10 HOT 2
- collections.Iterable not found HOT 2
- release new version to pypi? HOT 3
- Input timeout value in dap.py not properly propagated down to BaseProxy and SequenceProxy HOT 1
- ValueError: buffer size must be a multiple of element size HOT 1
- AttributeError: '<class 'pydap.model.DatasetType'>' object has no attribute 'decode'
- Documentation for proxy use HOT 2
- namespace_packages deprecated HOT 1
- "This is redirect error" when accessing NASA OPeNDAP HDF5 files (3.3.0) HOT 7
- Pydap handlers not found during installation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydap.