ONE-api 3.4.0__tar.gz → 3.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {one_api-3.4.0 → one_api-3.4.1/ONE_api.egg-info}/PKG-INFO +1 -1
  2. {one_api-3.4.0/ONE_api.egg-info → one_api-3.4.1}/PKG-INFO +1 -1
  3. {one_api-3.4.0 → one_api-3.4.1}/one/__init__.py +1 -1
  4. {one_api-3.4.0 → one_api-3.4.1}/one/webclient.py +11 -5
  5. {one_api-3.4.0 → one_api-3.4.1}/LICENSE +0 -0
  6. {one_api-3.4.0 → one_api-3.4.1}/MANIFEST.in +0 -0
  7. {one_api-3.4.0 → one_api-3.4.1}/ONE_api.egg-info/SOURCES.txt +0 -0
  8. {one_api-3.4.0 → one_api-3.4.1}/ONE_api.egg-info/dependency_links.txt +0 -0
  9. {one_api-3.4.0 → one_api-3.4.1}/ONE_api.egg-info/requires.txt +0 -0
  10. {one_api-3.4.0 → one_api-3.4.1}/ONE_api.egg-info/top_level.txt +0 -0
  11. {one_api-3.4.0 → one_api-3.4.1}/README.md +0 -0
  12. {one_api-3.4.0 → one_api-3.4.1}/one/alf/__init__.py +0 -0
  13. {one_api-3.4.0 → one_api-3.4.1}/one/alf/cache.py +0 -0
  14. {one_api-3.4.0 → one_api-3.4.1}/one/alf/exceptions.py +0 -0
  15. {one_api-3.4.0 → one_api-3.4.1}/one/alf/io.py +0 -0
  16. {one_api-3.4.0 → one_api-3.4.1}/one/alf/path.py +0 -0
  17. {one_api-3.4.0 → one_api-3.4.1}/one/alf/spec.py +0 -0
  18. {one_api-3.4.0 → one_api-3.4.1}/one/api.py +0 -0
  19. {one_api-3.4.0 → one_api-3.4.1}/one/converters.py +0 -0
  20. {one_api-3.4.0 → one_api-3.4.1}/one/params.py +0 -0
  21. {one_api-3.4.0 → one_api-3.4.1}/one/registration.py +0 -0
  22. {one_api-3.4.0 → one_api-3.4.1}/one/remote/__init__.py +0 -0
  23. {one_api-3.4.0 → one_api-3.4.1}/one/remote/aws.py +0 -0
  24. {one_api-3.4.0 → one_api-3.4.1}/one/remote/base.py +0 -0
  25. {one_api-3.4.0 → one_api-3.4.1}/one/remote/globus.py +0 -0
  26. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/datasets.pqt +0 -0
  27. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/params/.caches +0 -0
  28. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/params/.test.alyx.internationalbrainlab.org +0 -0
  29. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/1f187d80fd59677b395fcdb18e68e4401bfa1cc9 +0 -0
  30. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/3f51aa2e0baa42438467906f56a457c91a221898 +0 -0
  31. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/47893cf67c985e6361cdee009334963f49fb0746 +0 -0
  32. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/535d0e9a1e2c1efbdeba0d673b131e00361a2edb +0 -0
  33. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/5618bea3484a52cd893616f07903f0e49e023ba1 +0 -0
  34. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/6dc96f7e9bcc6ac2e7581489b9580a6cd3f28293 +0 -0
  35. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/coreapi.json +0 -0
  36. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/db1731fb8df0208944ae85f76718430813a8bf50 +0 -0
  37. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/dcce48259bb929661f60a02a48563f70aa6185b3 +0 -0
  38. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/f530d6022f61cdc9e38cc66beb3cb71f3003c9a1 +0 -0
  39. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/rest_responses/openapiv3.json +0 -0
  40. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/sessions.pqt +0 -0
  41. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/test_dbs.json +0 -0
  42. {one_api-3.4.0 → one_api-3.4.1}/one/tests/fixtures/test_img.png +0 -0
  43. {one_api-3.4.0 → one_api-3.4.1}/one/util.py +0 -0
  44. {one_api-3.4.0 → one_api-3.4.1}/pyproject.toml +0 -0
  45. {one_api-3.4.0 → one_api-3.4.1}/requirements.txt +0 -0
  46. {one_api-3.4.0 → one_api-3.4.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ONE-api
3
- Version: 3.4.0
3
+ Version: 3.4.1
4
4
  Summary: Open Neurophysiology Environment
5
5
  Author: IBL Staff
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ONE-api
3
- Version: 3.4.0
3
+ Version: 3.4.1
4
4
  Summary: Open Neurophysiology Environment
5
5
  Author: IBL Staff
6
6
  License: MIT
@@ -1,2 +1,2 @@
1
1
  """The Open Neurophysiology Environment (ONE) API."""
2
- __version__ = '3.4.0'
2
+ __version__ = '3.4.1'
@@ -134,12 +134,16 @@ def _cache_response(method):
134
134
  # Reversible but length may exceed 255 chars
135
135
  # name = base64.urlsafe_b64encode(args[2].encode('UTF-8')).decode('UTF-8')
136
136
  files = list(rest_cache.glob(name))
137
- cached = None
137
+ cached, when = None, None
138
138
  if len(files) == 1 and not clobber:
139
139
  _logger.debug('loading REST response from cache')
140
- with open(files[0], 'r') as f:
141
- cached, when = json.load(f)
142
- if datetime.fromisoformat(when) > datetime.now():
140
+ try:
141
+ with open(files[0], 'r') as f:
142
+ cached, when = json.load(f)
143
+ except json.JSONDecodeError as e:
144
+ _logger.debug(f'corrupted cache file {name}: {e}')
145
+ files[0].unlink() # delete corrupted cache file
146
+ if cached and datetime.fromisoformat(when) > datetime.now():
143
147
  return cached
144
148
  try:
145
149
  response = method(alyx_client, *args, **kwargs)
@@ -1502,7 +1506,9 @@ class AlyxClient:
1502
1506
  if len(set(kwargs.keys()) - set(self.rest_schemes.field_names(endpoint, action))):
1503
1507
  missing = set(kwargs.keys()) - set(
1504
1508
  self.rest_schemes.field_names(endpoint, action))
1505
- raise ValueError(f"Error: Unsupported fields '{missing}' in query parameters.")
1509
+ warnings.warn(
1510
+ f"Error: Unsupported fields '{missing}' in query parameters"
1511
+ f" for endpoint {endpoint}.")
1506
1512
  query_params = {k: ','.join(map(str, ensure_list(v))) for k, v in kwargs.items()}
1507
1513
  url = update_url_params(url, query_params)
1508
1514
  return self.get('/' + url, **cache_args)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes