ONE-api 2.10.1__tar.gz → 2.11.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 (44) hide show
  1. {one_api-2.10.1 → one_api-2.11.1/ONE_api.egg-info}/PKG-INFO +1 -1
  2. {one_api-2.10.1 → one_api-2.11.1}/ONE_api.egg-info/SOURCES.txt +1 -0
  3. {one_api-2.10.1/ONE_api.egg-info → one_api-2.11.1}/PKG-INFO +1 -1
  4. {one_api-2.10.1 → one_api-2.11.1}/one/__init__.py +1 -1
  5. {one_api-2.10.1 → one_api-2.11.1}/one/alf/cache.py +1 -1
  6. one_api-2.11.1/one/alf/files.py +11 -0
  7. {one_api-2.10.1 → one_api-2.11.1}/one/alf/io.py +1 -1
  8. {one_api-2.10.1 → one_api-2.11.1}/one/api.py +4 -2
  9. {one_api-2.10.1 → one_api-2.11.1}/one/converters.py +1 -1
  10. {one_api-2.10.1 → one_api-2.11.1}/one/registration.py +1 -1
  11. {one_api-2.10.1 → one_api-2.11.1}/one/remote/globus.py +1 -1
  12. {one_api-2.10.1 → one_api-2.11.1}/one/util.py +1 -1
  13. {one_api-2.10.1 → one_api-2.11.1}/one/webclient.py +8 -7
  14. {one_api-2.10.1 → one_api-2.11.1}/LICENSE +0 -0
  15. {one_api-2.10.1 → one_api-2.11.1}/MANIFEST.in +0 -0
  16. {one_api-2.10.1 → one_api-2.11.1}/ONE_api.egg-info/dependency_links.txt +0 -0
  17. {one_api-2.10.1 → one_api-2.11.1}/ONE_api.egg-info/requires.txt +0 -0
  18. {one_api-2.10.1 → one_api-2.11.1}/ONE_api.egg-info/top_level.txt +0 -0
  19. {one_api-2.10.1 → one_api-2.11.1}/README.md +0 -0
  20. {one_api-2.10.1 → one_api-2.11.1}/one/alf/__init__.py +0 -0
  21. {one_api-2.10.1 → one_api-2.11.1}/one/alf/exceptions.py +0 -0
  22. /one_api-2.10.1/one/alf/files.py → /one_api-2.11.1/one/alf/path.py +0 -0
  23. {one_api-2.10.1 → one_api-2.11.1}/one/alf/spec.py +0 -0
  24. {one_api-2.10.1 → one_api-2.11.1}/one/params.py +0 -0
  25. {one_api-2.10.1 → one_api-2.11.1}/one/remote/__init__.py +0 -0
  26. {one_api-2.10.1 → one_api-2.11.1}/one/remote/aws.py +0 -0
  27. {one_api-2.10.1 → one_api-2.11.1}/one/remote/base.py +0 -0
  28. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/datasets.pqt +0 -0
  29. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/params/.caches +0 -0
  30. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/params/.test.alyx.internationalbrainlab.org +0 -0
  31. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/1f187d80fd59677b395fcdb18e68e4401bfa1cc9 +0 -0
  32. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/3f51aa2e0baa42438467906f56a457c91a221898 +0 -0
  33. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/47893cf67c985e6361cdee009334963f49fb0746 +0 -0
  34. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/535d0e9a1e2c1efbdeba0d673b131e00361a2edb +0 -0
  35. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/5618bea3484a52cd893616f07903f0e49e023ba1 +0 -0
  36. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/6dc96f7e9bcc6ac2e7581489b9580a6cd3f28293 +0 -0
  37. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/db1731fb8df0208944ae85f76718430813a8bf50 +0 -0
  38. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/dcce48259bb929661f60a02a48563f70aa6185b3 +0 -0
  39. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/rest_responses/f530d6022f61cdc9e38cc66beb3cb71f3003c9a1 +0 -0
  40. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/sessions.pqt +0 -0
  41. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/test_dbs.json +0 -0
  42. {one_api-2.10.1 → one_api-2.11.1}/one/tests/fixtures/test_img.png +0 -0
  43. {one_api-2.10.1 → one_api-2.11.1}/setup.cfg +0 -0
  44. {one_api-2.10.1 → one_api-2.11.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ONE-api
3
- Version: 2.10.1
3
+ Version: 2.11.1
4
4
  Summary: Open Neurophysiology Environment
5
5
  Home-page: https://github.com/int-brain-lab/ONE
6
6
  Author: IBL Staff
@@ -19,6 +19,7 @@ one/alf/cache.py
19
19
  one/alf/exceptions.py
20
20
  one/alf/files.py
21
21
  one/alf/io.py
22
+ one/alf/path.py
22
23
  one/alf/spec.py
23
24
  one/remote/__init__.py
24
25
  one/remote/aws.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ONE-api
3
- Version: 2.10.1
3
+ Version: 2.11.1
4
4
  Summary: Open Neurophysiology Environment
5
5
  Home-page: https://github.com/int-brain-lab/ONE
6
6
  Author: IBL Staff
@@ -1,2 +1,2 @@
1
1
  """The Open Neurophysiology Environment (ONE) API."""
2
- __version__ = '2.10.1'
2
+ __version__ = '2.11.1'
@@ -28,7 +28,7 @@ from iblutil.io import parquet
28
28
  from iblutil.io.hashfile import md5
29
29
 
30
30
  from one.alf.io import iter_sessions, iter_datasets
31
- from one.alf.files import session_path_parts, get_alf_path
31
+ from one.alf.path import session_path_parts, get_alf_path
32
32
  from one.converters import session_record2path
33
33
  from one.util import QC_TYPE, patch_cache
34
34
 
@@ -0,0 +1,11 @@
1
+ """
2
+ (DEPRECATED) Module for identifying and parsing ALF file names.
3
+
4
+ This module has moved to :mod:`one.alf.path`.
5
+ """
6
+ import warnings
7
+
8
+ from .path import * # noqa
9
+
10
+ warnings.warn(
11
+ '`one.alf.files` will be removed in version 3.0. Use `one.alf.path` instead.', FutureWarning)
@@ -26,7 +26,7 @@ from iblutil.util import Bunch
26
26
  from iblutil.io import parquet
27
27
  from iblutil.io import jsonable
28
28
  from .exceptions import ALFObjectNotFound
29
- from . import files, spec
29
+ from . import spec, path as files
30
30
  from .spec import FILE_SPEC
31
31
 
32
32
  _logger = logging.getLogger(__name__)
@@ -25,7 +25,7 @@ from iblutil.util import Bunch, flatten, ensure_list
25
25
  import one.params
26
26
  import one.webclient as wc
27
27
  import one.alf.io as alfio
28
- import one.alf.files as alfiles
28
+ import one.alf.path as alfiles
29
29
  import one.alf.exceptions as alferr
30
30
  from .alf.cache import make_parquet_db, DATASETS_COLUMNS, SESSIONS_COLUMNS
31
31
  from .alf.spec import is_uuid_string, QC, to_alf
@@ -1855,8 +1855,10 @@ class OneAlyx(One):
1855
1855
  return self._cache['datasets'].iloc[0:0] if details else [] # Return empty
1856
1856
  assert set(datasets.index.unique('eid')) == {eid}
1857
1857
  del filters['default_revisions_only']
1858
+ if not keep_eid_index and 'eid' in datasets.index.names:
1859
+ datasets = datasets.droplevel('eid')
1858
1860
  datasets = util.filter_datasets(
1859
- datasets.droplevel('eid'), assert_unique=False, wildcards=self.wildcards, **filters)
1861
+ datasets, assert_unique=False, wildcards=self.wildcards, **filters)
1860
1862
  # Return only the relative path
1861
1863
  return datasets if details else datasets['rel_path'].sort_values().values.tolist()
1862
1864
 
@@ -19,7 +19,7 @@ import pandas as pd
19
19
  from iblutil.util import Bunch
20
20
 
21
21
  from one.alf.spec import is_session_path, is_uuid_string
22
- from one.alf.files import get_session_path, add_uuid_string, session_path_parts, get_alf_path
22
+ from one.alf.path import get_session_path, add_uuid_string, session_path_parts, get_alf_path
23
23
  from .util import Listable
24
24
 
25
25
 
@@ -26,7 +26,7 @@ from iblutil.io import hashfile
26
26
  from iblutil.util import Bunch, ensure_list
27
27
 
28
28
  import one.alf.io as alfio
29
- from one.alf.files import session_path_parts, get_session_path, folder_parts, filename_parts
29
+ from one.alf.path import session_path_parts, get_session_path, folder_parts, filename_parts
30
30
  from one.alf.spec import is_valid
31
31
  import one.alf.exceptions as alferr
32
32
  from one.api import ONE
@@ -100,7 +100,7 @@ from iblutil.io import params as iopar
100
100
  from iblutil.util import ensure_list
101
101
 
102
102
  from one.alf.spec import is_uuid
103
- from one.alf.files import remove_uuid_string
103
+ from one.alf.path import remove_uuid_string
104
104
  import one.params
105
105
  from one.webclient import AlyxClient
106
106
  from .base import DownloadClient, load_client_params, save_client_params
@@ -16,7 +16,7 @@ import numpy as np
16
16
  from packaging import version
17
17
 
18
18
  import one.alf.exceptions as alferr
19
- from one.alf.files import rel_path_parts, get_session_path, get_alf_path, remove_uuid_string
19
+ from one.alf.path import rel_path_parts, get_session_path, get_alf_path, remove_uuid_string
20
20
  from one.alf.spec import QC, FILE_SPEC, regex as alf_regex
21
21
 
22
22
  logger = logging.getLogger(__name__)
@@ -589,7 +589,7 @@ class AlyxClient:
589
589
  rest_query = rest_query.replace(self.base_url, '')
590
590
  if not rest_query.startswith('/'):
591
591
  rest_query = '/' + rest_query
592
- _logger.debug(f"{self.base_url + rest_query}, headers: {self._headers}")
592
+ _logger.debug(f'{self.base_url + rest_query}, headers: {self._headers}')
593
593
  headers = self._headers.copy()
594
594
  if files is None:
595
595
  data = json.dumps(data) if isinstance(data, dict) or isinstance(data, list) else data
@@ -678,8 +678,8 @@ class AlyxClient:
678
678
  rep = requests.post(self.base_url + '/auth-token', data=credentials)
679
679
  except requests.exceptions.ConnectionError:
680
680
  raise ConnectionError(
681
- f"Can't connect to {self.base_url}.\n" +
682
- "Check your internet connections and Alyx database firewall"
681
+ f'Can\'t connect to {self.base_url}.\n' +
682
+ 'Check your internet connections and Alyx database firewall'
683
683
  )
684
684
  # Assign token or raise exception on auth error
685
685
  if rep.ok:
@@ -839,6 +839,7 @@ class AlyxClient:
839
839
 
840
840
  def _validate_file_url(self, url):
841
841
  """Asserts that URL matches HTTP_DATA_SERVER parameter.
842
+
842
843
  Currently only one remote HTTP server is supported for a given AlyxClient instance. If
843
844
  the URL contains only the relative path part, the full URL is returned.
844
845
 
@@ -1069,7 +1070,7 @@ class AlyxClient:
1069
1070
  if 'django' in kwargs.keys():
1070
1071
  kwargs['django'] = kwargs['django'] + ','
1071
1072
  else:
1072
- kwargs['django'] = ""
1073
+ kwargs['django'] = ''
1073
1074
  kwargs['django'] = f"{kwargs['django']}pk,{id}"
1074
1075
  # otherwise, look for a dictionary of filter terms
1075
1076
  if kwargs:
@@ -1135,7 +1136,7 @@ class AlyxClient:
1135
1136
  # Prepare data to patch
1136
1137
  patch_dict = {field_name: data}
1137
1138
  # Upload new extended_qc to session
1138
- ret = self.rest(endpoint, "partial_update", id=uuid, data=patch_dict)
1139
+ ret = self.rest(endpoint, 'partial_update', id=uuid, data=patch_dict)
1139
1140
  return ret[field_name]
1140
1141
 
1141
1142
  def json_field_update(
@@ -1181,7 +1182,7 @@ class AlyxClient:
1181
1182
 
1182
1183
  if not isinstance(current, dict):
1183
1184
  _logger.warning(
1184
- f'Current json field {field_name} does not contains a dict, aborting update'
1185
+ f'Current json field "{field_name}" does not contains a dict, aborting update'
1185
1186
  )
1186
1187
  return current
1187
1188
 
@@ -1236,7 +1237,7 @@ class AlyxClient:
1236
1237
  f'{key}: Key not found in endpoint {endpoint} field {field_name}'
1237
1238
  )
1238
1239
  return current
1239
- _logger.info(f"Removing key from dict: '{key}'")
1240
+ _logger.info(f'Removing key from dict: "{key}"')
1240
1241
  current.pop(key)
1241
1242
  # Re-write contents without removed key
1242
1243
  written = self.json_field_write(
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