flywheel-sdk 20.4.0rc1__py2.py3-none-any.whl → 20.5.0__py2.py3-none-any.whl
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.
- flywheel/__init__.py +2 -0
- flywheel/api/acquisitions_api.py +116 -0
- flywheel/api/sessions_api.py +3 -3
- flywheel/api/subjects_api.py +116 -0
- flywheel/api_client.py +1 -1
- flywheel/configuration.py +2 -2
- flywheel/drone_login.py +2 -1
- flywheel/finder.py +11 -12
- flywheel/flywheel.py +28 -2
- flywheel/gear_context.py +6 -17
- flywheel/models/__init__.py +3 -1
- flywheel/models/acquisition_container_output.py +1 -0
- flywheel/models/acquisition_copy_input.py +221 -0
- flywheel/models/acquisition_list_output.py +32 -4
- flywheel/models/acquisition_node.py +1 -0
- flywheel/models/acquisition_output.py +32 -4
- flywheel/models/acquisition_upsert_input.py +31 -4
- flywheel/models/cvat_info.py +31 -4
- flywheel/models/features.py +28 -28
- flywheel/models/gear_invocation.py +1 -0
- flywheel/models/gear_mixin.py +4 -16
- flywheel/models/mixins.py +25 -76
- flywheel/models/search_parent_acquisition.py +1 -0
- flywheel/models/session_upsert_input.py +31 -4
- flywheel/models/subject.py +8 -0
- flywheel/models/subject_copy_input.py +221 -0
- flywheel/models/subject_upsert_input.py +31 -4
- flywheel/models/work_in_progress_features.py +30 -1
- flywheel/util.py +6 -8
- flywheel/view_builder.py +14 -40
- {flywheel_sdk-20.4.0rc1.dist-info → flywheel_sdk-20.5.0.dist-info}/METADATA +1 -1
- {flywheel_sdk-20.4.0rc1.dist-info → flywheel_sdk-20.5.0.dist-info}/RECORD +35 -33
- {flywheel_sdk-20.4.0rc1.dist-info → flywheel_sdk-20.5.0.dist-info}/WHEEL +0 -0
- {flywheel_sdk-20.4.0rc1.dist-info → flywheel_sdk-20.5.0.dist-info}/licenses/LICENSE.txt +0 -0
- {flywheel_sdk-20.4.0rc1.dist-info → flywheel_sdk-20.5.0.dist-info}/top_level.txt +0 -0
flywheel/__init__.py
CHANGED
|
@@ -75,6 +75,7 @@ from flywheel.models.access_type import AccessType
|
|
|
75
75
|
from flywheel.models.accumulator import Accumulator
|
|
76
76
|
from flywheel.models.acquisition import Acquisition
|
|
77
77
|
from flywheel.models.acquisition_container_output import AcquisitionContainerOutput
|
|
78
|
+
from flywheel.models.acquisition_copy_input import AcquisitionCopyInput
|
|
78
79
|
from flywheel.models.acquisition_input import AcquisitionInput
|
|
79
80
|
from flywheel.models.acquisition_list_output import AcquisitionListOutput
|
|
80
81
|
from flywheel.models.acquisition_modify_input import AcquisitionModifyInput
|
|
@@ -669,6 +670,7 @@ from flywheel.models.structured_query_suggestions import StructuredQuerySuggesti
|
|
|
669
670
|
from flywheel.models.structured_query_value_suggestion import StructuredQueryValueSuggestion
|
|
670
671
|
from flywheel.models.subject import Subject
|
|
671
672
|
from flywheel.models.subject_container_output import SubjectContainerOutput
|
|
673
|
+
from flywheel.models.subject_copy_input import SubjectCopyInput
|
|
672
674
|
from flywheel.models.subject_input import SubjectInput
|
|
673
675
|
from flywheel.models.subject_modify import SubjectModify
|
|
674
676
|
from flywheel.models.subject_node import SubjectNode
|
flywheel/api/acquisitions_api.py
CHANGED
|
@@ -31,6 +31,122 @@ class AcquisitionsApi(object):
|
|
|
31
31
|
api_client = ApiClient()
|
|
32
32
|
self.api_client = api_client
|
|
33
33
|
|
|
34
|
+
def acquisition_copy(self, acquisition_id, body, **kwargs): # noqa: E501
|
|
35
|
+
"""Smart copy an acquisition
|
|
36
|
+
|
|
37
|
+
Smart copy an acquisition
|
|
38
|
+
This method makes a synchronous HTTP request by default.
|
|
39
|
+
|
|
40
|
+
:param str acquisition_id: (required)
|
|
41
|
+
:param AcquisitionCopyInput body: (required)
|
|
42
|
+
:param bool async_: Perform the request asynchronously
|
|
43
|
+
:return: Acquisition
|
|
44
|
+
"""
|
|
45
|
+
ignore_simplified_return_value = kwargs.pop('_ignore_simplified_return_value', False)
|
|
46
|
+
kwargs['_return_http_data_only'] = True
|
|
47
|
+
|
|
48
|
+
if kwargs.get('async_'):
|
|
49
|
+
return self.acquisition_copy_with_http_info(acquisition_id, body, **kwargs) # noqa: E501
|
|
50
|
+
else:
|
|
51
|
+
(data) = self.acquisition_copy_with_http_info(acquisition_id, body, **kwargs) # noqa: E501
|
|
52
|
+
if (
|
|
53
|
+
data
|
|
54
|
+
and hasattr(data, 'return_value')
|
|
55
|
+
and not ignore_simplified_return_value
|
|
56
|
+
):
|
|
57
|
+
return data.return_value()
|
|
58
|
+
return data
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def acquisition_copy_with_http_info(self, acquisition_id, body, **kwargs): # noqa: E501
|
|
62
|
+
"""Smart copy an acquisition
|
|
63
|
+
|
|
64
|
+
Smart copy an acquisition
|
|
65
|
+
This method makes a synchronous HTTP request by default.
|
|
66
|
+
|
|
67
|
+
:param str acquisition_id: (required)
|
|
68
|
+
:param AcquisitionCopyInput body: (required)
|
|
69
|
+
:param bool async_: Perform the request asynchronously
|
|
70
|
+
:return: Acquisition
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
all_params = ['acquisition_id','body',] # noqa: E501
|
|
74
|
+
all_params.append('async_')
|
|
75
|
+
all_params.append('_return_http_data_only')
|
|
76
|
+
all_params.append('_preload_content')
|
|
77
|
+
all_params.append('_request_timeout')
|
|
78
|
+
all_params.append('_request_out')
|
|
79
|
+
|
|
80
|
+
params = locals()
|
|
81
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
82
|
+
if key not in all_params:
|
|
83
|
+
raise TypeError(
|
|
84
|
+
"Got an unexpected keyword argument '%s'"
|
|
85
|
+
" to method acquisition_copy" % key
|
|
86
|
+
)
|
|
87
|
+
params[key] = val
|
|
88
|
+
del params['kwargs']
|
|
89
|
+
# verify the required parameter 'acquisition_id' is set
|
|
90
|
+
if ('acquisition_id' not in params or
|
|
91
|
+
params['acquisition_id'] is None):
|
|
92
|
+
raise ValueError("Missing the required parameter `acquisition_id` when calling `acquisition_copy`") # noqa: E501
|
|
93
|
+
# verify the required parameter 'body' is set
|
|
94
|
+
if ('body' not in params or
|
|
95
|
+
params['body'] is None):
|
|
96
|
+
raise ValueError("Missing the required parameter `body` when calling `acquisition_copy`") # noqa: E501
|
|
97
|
+
check_filename_params(params)
|
|
98
|
+
|
|
99
|
+
collection_formats = {}
|
|
100
|
+
|
|
101
|
+
path_params = {}
|
|
102
|
+
if 'acquisition_id' in params:
|
|
103
|
+
path_params['acquisition_id'] = params['acquisition_id'] # noqa: E501
|
|
104
|
+
|
|
105
|
+
query_params = []
|
|
106
|
+
|
|
107
|
+
header_params = {}
|
|
108
|
+
|
|
109
|
+
form_params = []
|
|
110
|
+
local_var_files = {}
|
|
111
|
+
|
|
112
|
+
body_params = None
|
|
113
|
+
if 'body' in params:
|
|
114
|
+
if 'AcquisitionCopyInput'.startswith('union'):
|
|
115
|
+
body_type = type(params['body'])
|
|
116
|
+
if getattr(body_type, 'positional_to_model', None):
|
|
117
|
+
body_params = body_type.positional_to_model(params['body'])
|
|
118
|
+
else:
|
|
119
|
+
body_params = params['body']
|
|
120
|
+
else:
|
|
121
|
+
body_params = flywheel.models.AcquisitionCopyInput.positional_to_model(params['body'])
|
|
122
|
+
# HTTP header `Accept`
|
|
123
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
124
|
+
['application/json']) # noqa: E501
|
|
125
|
+
|
|
126
|
+
# HTTP header `Content-Type`
|
|
127
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
128
|
+
['application/json']) # noqa: E501
|
|
129
|
+
|
|
130
|
+
# Authentication setting
|
|
131
|
+
auth_settings = ['ApiKey'] # noqa: E501
|
|
132
|
+
|
|
133
|
+
return self.api_client.call_api(
|
|
134
|
+
'/acquisitions/{acquisition_id}/copy', 'POST',
|
|
135
|
+
path_params,
|
|
136
|
+
query_params,
|
|
137
|
+
header_params,
|
|
138
|
+
body=body_params,
|
|
139
|
+
post_params=form_params,
|
|
140
|
+
files=local_var_files,
|
|
141
|
+
response_type='Acquisition', # noqa: E501
|
|
142
|
+
auth_settings=auth_settings,
|
|
143
|
+
async_=params.get('async_'),
|
|
144
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
145
|
+
_preload_content=params.get('_preload_content', True),
|
|
146
|
+
_request_timeout=params.get('_request_timeout'),
|
|
147
|
+
_request_out=params.get('_request_out'),
|
|
148
|
+
collection_formats=collection_formats)
|
|
149
|
+
|
|
34
150
|
def add_acquisition(self, body, **kwargs): # noqa: E501
|
|
35
151
|
"""Create a new acquisition
|
|
36
152
|
|
flywheel/api/sessions_api.py
CHANGED
|
@@ -5014,7 +5014,7 @@ class SessionsApi(object):
|
|
|
5014
5014
|
:param str session_id: (required)
|
|
5015
5015
|
:param SessionCopyInput body: (required)
|
|
5016
5016
|
:param bool async_: Perform the request asynchronously
|
|
5017
|
-
:return:
|
|
5017
|
+
:return: Session
|
|
5018
5018
|
"""
|
|
5019
5019
|
ignore_simplified_return_value = kwargs.pop('_ignore_simplified_return_value', False)
|
|
5020
5020
|
kwargs['_return_http_data_only'] = True
|
|
@@ -5041,7 +5041,7 @@ class SessionsApi(object):
|
|
|
5041
5041
|
:param str session_id: (required)
|
|
5042
5042
|
:param SessionCopyInput body: (required)
|
|
5043
5043
|
:param bool async_: Perform the request asynchronously
|
|
5044
|
-
:return:
|
|
5044
|
+
:return: Session
|
|
5045
5045
|
"""
|
|
5046
5046
|
|
|
5047
5047
|
all_params = ['session_id','body',] # noqa: E501
|
|
@@ -5112,7 +5112,7 @@ class SessionsApi(object):
|
|
|
5112
5112
|
body=body_params,
|
|
5113
5113
|
post_params=form_params,
|
|
5114
5114
|
files=local_var_files,
|
|
5115
|
-
response_type=
|
|
5115
|
+
response_type='Session', # noqa: E501
|
|
5116
5116
|
auth_settings=auth_settings,
|
|
5117
5117
|
async_=params.get('async_'),
|
|
5118
5118
|
_return_http_data_only=params.get('_return_http_data_only'),
|
flywheel/api/subjects_api.py
CHANGED
|
@@ -4961,6 +4961,122 @@ class SubjectsApi(object):
|
|
|
4961
4961
|
_request_out=params.get('_request_out'),
|
|
4962
4962
|
collection_formats=collection_formats)
|
|
4963
4963
|
|
|
4964
|
+
def subject_copy(self, subject_id, body, **kwargs): # noqa: E501
|
|
4965
|
+
"""Smart copy a subject
|
|
4966
|
+
|
|
4967
|
+
Smart copy a subject
|
|
4968
|
+
This method makes a synchronous HTTP request by default.
|
|
4969
|
+
|
|
4970
|
+
:param str subject_id: (required)
|
|
4971
|
+
:param SubjectCopyInput body: (required)
|
|
4972
|
+
:param bool async_: Perform the request asynchronously
|
|
4973
|
+
:return: Subject
|
|
4974
|
+
"""
|
|
4975
|
+
ignore_simplified_return_value = kwargs.pop('_ignore_simplified_return_value', False)
|
|
4976
|
+
kwargs['_return_http_data_only'] = True
|
|
4977
|
+
|
|
4978
|
+
if kwargs.get('async_'):
|
|
4979
|
+
return self.subject_copy_with_http_info(subject_id, body, **kwargs) # noqa: E501
|
|
4980
|
+
else:
|
|
4981
|
+
(data) = self.subject_copy_with_http_info(subject_id, body, **kwargs) # noqa: E501
|
|
4982
|
+
if (
|
|
4983
|
+
data
|
|
4984
|
+
and hasattr(data, 'return_value')
|
|
4985
|
+
and not ignore_simplified_return_value
|
|
4986
|
+
):
|
|
4987
|
+
return data.return_value()
|
|
4988
|
+
return data
|
|
4989
|
+
|
|
4990
|
+
|
|
4991
|
+
def subject_copy_with_http_info(self, subject_id, body, **kwargs): # noqa: E501
|
|
4992
|
+
"""Smart copy a subject
|
|
4993
|
+
|
|
4994
|
+
Smart copy a subject
|
|
4995
|
+
This method makes a synchronous HTTP request by default.
|
|
4996
|
+
|
|
4997
|
+
:param str subject_id: (required)
|
|
4998
|
+
:param SubjectCopyInput body: (required)
|
|
4999
|
+
:param bool async_: Perform the request asynchronously
|
|
5000
|
+
:return: Subject
|
|
5001
|
+
"""
|
|
5002
|
+
|
|
5003
|
+
all_params = ['subject_id','body',] # noqa: E501
|
|
5004
|
+
all_params.append('async_')
|
|
5005
|
+
all_params.append('_return_http_data_only')
|
|
5006
|
+
all_params.append('_preload_content')
|
|
5007
|
+
all_params.append('_request_timeout')
|
|
5008
|
+
all_params.append('_request_out')
|
|
5009
|
+
|
|
5010
|
+
params = locals()
|
|
5011
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
5012
|
+
if key not in all_params:
|
|
5013
|
+
raise TypeError(
|
|
5014
|
+
"Got an unexpected keyword argument '%s'"
|
|
5015
|
+
" to method subject_copy" % key
|
|
5016
|
+
)
|
|
5017
|
+
params[key] = val
|
|
5018
|
+
del params['kwargs']
|
|
5019
|
+
# verify the required parameter 'subject_id' is set
|
|
5020
|
+
if ('subject_id' not in params or
|
|
5021
|
+
params['subject_id'] is None):
|
|
5022
|
+
raise ValueError("Missing the required parameter `subject_id` when calling `subject_copy`") # noqa: E501
|
|
5023
|
+
# verify the required parameter 'body' is set
|
|
5024
|
+
if ('body' not in params or
|
|
5025
|
+
params['body'] is None):
|
|
5026
|
+
raise ValueError("Missing the required parameter `body` when calling `subject_copy`") # noqa: E501
|
|
5027
|
+
check_filename_params(params)
|
|
5028
|
+
|
|
5029
|
+
collection_formats = {}
|
|
5030
|
+
|
|
5031
|
+
path_params = {}
|
|
5032
|
+
if 'subject_id' in params:
|
|
5033
|
+
path_params['subject_id'] = params['subject_id'] # noqa: E501
|
|
5034
|
+
|
|
5035
|
+
query_params = []
|
|
5036
|
+
|
|
5037
|
+
header_params = {}
|
|
5038
|
+
|
|
5039
|
+
form_params = []
|
|
5040
|
+
local_var_files = {}
|
|
5041
|
+
|
|
5042
|
+
body_params = None
|
|
5043
|
+
if 'body' in params:
|
|
5044
|
+
if 'SubjectCopyInput'.startswith('union'):
|
|
5045
|
+
body_type = type(params['body'])
|
|
5046
|
+
if getattr(body_type, 'positional_to_model', None):
|
|
5047
|
+
body_params = body_type.positional_to_model(params['body'])
|
|
5048
|
+
else:
|
|
5049
|
+
body_params = params['body']
|
|
5050
|
+
else:
|
|
5051
|
+
body_params = flywheel.models.SubjectCopyInput.positional_to_model(params['body'])
|
|
5052
|
+
# HTTP header `Accept`
|
|
5053
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
5054
|
+
['application/json']) # noqa: E501
|
|
5055
|
+
|
|
5056
|
+
# HTTP header `Content-Type`
|
|
5057
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
5058
|
+
['application/json']) # noqa: E501
|
|
5059
|
+
|
|
5060
|
+
# Authentication setting
|
|
5061
|
+
auth_settings = ['ApiKey'] # noqa: E501
|
|
5062
|
+
|
|
5063
|
+
return self.api_client.call_api(
|
|
5064
|
+
'/subjects/{subject_id}/copy', 'POST',
|
|
5065
|
+
path_params,
|
|
5066
|
+
query_params,
|
|
5067
|
+
header_params,
|
|
5068
|
+
body=body_params,
|
|
5069
|
+
post_params=form_params,
|
|
5070
|
+
files=local_var_files,
|
|
5071
|
+
response_type='Subject', # noqa: E501
|
|
5072
|
+
auth_settings=auth_settings,
|
|
5073
|
+
async_=params.get('async_'),
|
|
5074
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
5075
|
+
_preload_content=params.get('_preload_content', True),
|
|
5076
|
+
_request_timeout=params.get('_request_timeout'),
|
|
5077
|
+
_request_out=params.get('_request_out'),
|
|
5078
|
+
collection_formats=collection_formats)
|
|
5079
|
+
|
|
4964
5080
|
def upload_file_to_subject(self, container_id, file, **kwargs): # noqa: E501
|
|
4965
5081
|
"""Upload a file to a(n) subject.
|
|
4966
5082
|
|
flywheel/api_client.py
CHANGED
|
@@ -84,7 +84,7 @@ class ApiClient(object):
|
|
|
84
84
|
self.default_query_params = []
|
|
85
85
|
self.cookie = cookie
|
|
86
86
|
# Set default User-Agent.
|
|
87
|
-
self.user_agent = 'Swagger-Codegen/20.
|
|
87
|
+
self.user_agent = 'Swagger-Codegen/20.5.0/python'
|
|
88
88
|
self.last_response = None
|
|
89
89
|
self._version_check_fn = None
|
|
90
90
|
self._context = context
|
flywheel/configuration.py
CHANGED
|
@@ -253,8 +253,8 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
|
|
253
253
|
return "Python SDK Debug Report:\n"\
|
|
254
254
|
"OS: {env}\n"\
|
|
255
255
|
"Python Version: {pyversion}\n"\
|
|
256
|
-
"Version of the API: 20.
|
|
257
|
-
"SDK Package Version: 20.
|
|
256
|
+
"Version of the API: 20.5.0\n"\
|
|
257
|
+
"SDK Package Version: 20.5.0".\
|
|
258
258
|
format(env=sys.platform, pyversion=sys.version)
|
|
259
259
|
|
|
260
260
|
def enable_message_cutoff(self, message_cutoff):
|
flywheel/drone_login.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Provides Drone-based login credentials"""
|
|
2
|
+
|
|
2
3
|
import requests
|
|
3
4
|
from .rest import ApiException
|
|
4
5
|
from .client import Client
|
|
@@ -21,7 +22,7 @@ def create_drone_client(host, secret, method, name, port=443, **kwargs):
|
|
|
21
22
|
util.set_verify_ssl(session)
|
|
22
23
|
|
|
23
24
|
# Get auth status to determine device id
|
|
24
|
-
force_insecure = kwargs.pop("_force_insecure", False)
|
|
25
|
+
force_insecure = kwargs.pop("_force_insecure", False) is True
|
|
25
26
|
if force_insecure:
|
|
26
27
|
base_uri = "http://{}:{}/api".format(host, port)
|
|
27
28
|
else:
|
flywheel/finder.py
CHANGED
|
@@ -89,15 +89,15 @@ class Finder(object):
|
|
|
89
89
|
|
|
90
90
|
while True:
|
|
91
91
|
results = self._func(*self._args, **kwargs)
|
|
92
|
-
if
|
|
93
|
-
results = results.get(
|
|
92
|
+
if "results" in results:
|
|
93
|
+
results = results.get("results", [])
|
|
94
94
|
|
|
95
95
|
if not results:
|
|
96
96
|
break
|
|
97
97
|
|
|
98
98
|
for item in results:
|
|
99
99
|
yield item
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
if "file_id" in results[-1]:
|
|
102
102
|
kwargs["after_id"] = results[-1].file_id
|
|
103
103
|
else:
|
|
@@ -110,8 +110,8 @@ class Finder(object):
|
|
|
110
110
|
|
|
111
111
|
while True:
|
|
112
112
|
results = self._func(*self._args, **kwargs)
|
|
113
|
-
if
|
|
114
|
-
results = results.get(
|
|
113
|
+
if "results" in results:
|
|
114
|
+
results = results.get("results", [])
|
|
115
115
|
|
|
116
116
|
if not results:
|
|
117
117
|
break
|
|
@@ -128,15 +128,14 @@ class Finder(object):
|
|
|
128
128
|
return self._fn
|
|
129
129
|
|
|
130
130
|
def __find(self, filters, kwargs, find_first=False, find_one=False):
|
|
131
|
-
|
|
132
131
|
if filters:
|
|
133
132
|
kwargs["filter"] = ",".join(filters)
|
|
134
133
|
|
|
135
134
|
if find_one:
|
|
136
135
|
kwargs["limit"] = 2 # We only need one some get at most 2 for error case
|
|
137
136
|
results = self._func(*self._args, **kwargs)
|
|
138
|
-
if
|
|
139
|
-
results = results.get(
|
|
137
|
+
if "results" in results:
|
|
138
|
+
results = results.get("results", [])
|
|
140
139
|
if len(results) > 1:
|
|
141
140
|
raise ValueError("Found more results than 1!")
|
|
142
141
|
if len(results) == 0:
|
|
@@ -146,8 +145,8 @@ class Finder(object):
|
|
|
146
145
|
if find_first:
|
|
147
146
|
kwargs["limit"] = 1 # always return first so no need for more
|
|
148
147
|
results = self._func(*self._args, **kwargs)
|
|
149
|
-
if
|
|
150
|
-
results = results.get(
|
|
148
|
+
if "results" in results:
|
|
149
|
+
results = results.get("results", [])
|
|
151
150
|
if results:
|
|
152
151
|
return results[0]
|
|
153
152
|
return None
|
|
@@ -164,6 +163,6 @@ class Finder(object):
|
|
|
164
163
|
# This will pull it to memory though so we should enforce a max limit
|
|
165
164
|
# or deprecate this in favor of iter find
|
|
166
165
|
results = self._func(*self._args, **kwargs)
|
|
167
|
-
if
|
|
168
|
-
results = results.get(
|
|
166
|
+
if "results" in results:
|
|
167
|
+
results = results.get("results", [])
|
|
169
168
|
return results
|
flywheel/flywheel.py
CHANGED
|
@@ -40,7 +40,7 @@ from flywheel.view_builder import ViewBuilder
|
|
|
40
40
|
from flywheel.finder import Finder
|
|
41
41
|
import flywheel.api
|
|
42
42
|
|
|
43
|
-
SDK_VERSION = "20.
|
|
43
|
+
SDK_VERSION = "20.5.0"
|
|
44
44
|
|
|
45
45
|
def config_from_api_key(api_key):
|
|
46
46
|
parts = api_key.split(':')
|
|
@@ -206,6 +206,19 @@ class Flywheel:
|
|
|
206
206
|
self.api_client.configuration.disable_message_cutoff()
|
|
207
207
|
|
|
208
208
|
|
|
209
|
+
def acquisition_copy(self, acquisition_id, body, **kwargs): # noqa: E501
|
|
210
|
+
"""Smart copy an acquisition
|
|
211
|
+
|
|
212
|
+
Smart copy an acquisition
|
|
213
|
+
|
|
214
|
+
:param str acquisition_id: (required)
|
|
215
|
+
:param AcquisitionCopyInput body: (required)
|
|
216
|
+
:param bool async_: Perform the request asynchronously
|
|
217
|
+
:return: Acquisition
|
|
218
|
+
"""
|
|
219
|
+
return self.acquisitions_api.acquisition_copy(acquisition_id, body, **kwargs)
|
|
220
|
+
|
|
221
|
+
|
|
209
222
|
def add_acquisition(self, body, **kwargs): # noqa: E501
|
|
210
223
|
"""Create a new acquisition
|
|
211
224
|
|
|
@@ -6301,7 +6314,7 @@ class Flywheel:
|
|
|
6301
6314
|
:param str session_id: (required)
|
|
6302
6315
|
:param SessionCopyInput body: (required)
|
|
6303
6316
|
:param bool async_: Perform the request asynchronously
|
|
6304
|
-
:return:
|
|
6317
|
+
:return: Session
|
|
6305
6318
|
"""
|
|
6306
6319
|
return self.sessions_api.session_copy(session_id, body, **kwargs)
|
|
6307
6320
|
|
|
@@ -7177,6 +7190,19 @@ class Flywheel:
|
|
|
7177
7190
|
return self.subjects_api.rename_subject_tag(cid, value, body, **kwargs)
|
|
7178
7191
|
|
|
7179
7192
|
|
|
7193
|
+
def subject_copy(self, subject_id, body, **kwargs): # noqa: E501
|
|
7194
|
+
"""Smart copy a subject
|
|
7195
|
+
|
|
7196
|
+
Smart copy a subject
|
|
7197
|
+
|
|
7198
|
+
:param str subject_id: (required)
|
|
7199
|
+
:param SubjectCopyInput body: (required)
|
|
7200
|
+
:param bool async_: Perform the request asynchronously
|
|
7201
|
+
:return: Subject
|
|
7202
|
+
"""
|
|
7203
|
+
return self.subjects_api.subject_copy(subject_id, body, **kwargs)
|
|
7204
|
+
|
|
7205
|
+
|
|
7180
7206
|
def upload_file_to_subject(self, container_id, file, signed=True, **kwargs): # noqa: E501
|
|
7181
7207
|
"""Upload a file to a(n) subject.
|
|
7182
7208
|
|
flywheel/gear_context.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Provides gear helper functions"""
|
|
2
|
+
|
|
2
3
|
import copy
|
|
3
4
|
import json
|
|
4
5
|
import logging
|
|
@@ -23,7 +24,7 @@ class GearContext(object):
|
|
|
23
24
|
def __init__(self, gear_path=None):
|
|
24
25
|
warnings.warn(
|
|
25
26
|
"Please use the Flywheel Gear Toolkit instead: https://flywheel-io.gitlab.io/public/gear-toolkit/index.html",
|
|
26
|
-
DeprecationWarning
|
|
27
|
+
DeprecationWarning,
|
|
27
28
|
)
|
|
28
29
|
self._path = os.path.abspath(gear_path or DEFAULT_GEAR_PATH)
|
|
29
30
|
self._client = None
|
|
@@ -198,9 +199,7 @@ class GearContext(object):
|
|
|
198
199
|
if not inp:
|
|
199
200
|
return None
|
|
200
201
|
if inp["base"] != "context":
|
|
201
|
-
raise ValueError(
|
|
202
|
-
"The specified input {} is not a context input".format(name)
|
|
203
|
-
)
|
|
202
|
+
raise ValueError("The specified input {} is not a context input".format(name))
|
|
204
203
|
return inp.get("value")
|
|
205
204
|
|
|
206
205
|
def update_container_metadata(self, container_type, *args, **kwargs):
|
|
@@ -257,9 +256,7 @@ class GearContext(object):
|
|
|
257
256
|
with self.open_output(".metadata.json") as f:
|
|
258
257
|
json.dump(self._metadata, f, indent=2)
|
|
259
258
|
|
|
260
|
-
def download_session_bids(
|
|
261
|
-
self, target_dir="work/bids", src_data=False, folders=None, **kwargs
|
|
262
|
-
):
|
|
259
|
+
def download_session_bids(self, target_dir="work/bids", src_data=False, folders=None, **kwargs):
|
|
263
260
|
"""Download the session in bids format to target_dir.
|
|
264
261
|
|
|
265
262
|
:param str target_dir: The destination directory (otherwise work/bids will be used)
|
|
@@ -274,13 +271,7 @@ class GearContext(object):
|
|
|
274
271
|
return self._download_bids("session", target_dir, kwargs)
|
|
275
272
|
|
|
276
273
|
def download_project_bids(
|
|
277
|
-
self,
|
|
278
|
-
target_dir="work/bids",
|
|
279
|
-
src_data=False,
|
|
280
|
-
subjects=None,
|
|
281
|
-
sessions=None,
|
|
282
|
-
folders=None,
|
|
283
|
-
**kwargs
|
|
274
|
+
self, target_dir="work/bids", src_data=False, subjects=None, sessions=None, folders=None, **kwargs
|
|
284
275
|
):
|
|
285
276
|
"""Download the project in bids format to target_dir.
|
|
286
277
|
|
|
@@ -343,9 +334,7 @@ class GearContext(object):
|
|
|
343
334
|
except ImportError:
|
|
344
335
|
self.log.error("Cannot load flywheel-bids package.")
|
|
345
336
|
self.log.error('Make sure it is installed with "pip install flywheel-bids"')
|
|
346
|
-
raise RuntimeError(
|
|
347
|
-
"Unable to load flywheel-bids package, make sure it is installed!"
|
|
348
|
-
)
|
|
337
|
+
raise RuntimeError("Unable to load flywheel-bids package, make sure it is installed!")
|
|
349
338
|
|
|
350
339
|
def _get_invocation(self):
|
|
351
340
|
"""Load the invocation"""
|
flywheel/models/__init__.py
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Flywheel: API for data import, automated curation, image processing, machine learning workflows, and secure collaboration. # noqa: E501
|
|
8
8
|
|
|
9
|
-
OpenAPI spec version: 20.
|
|
9
|
+
OpenAPI spec version: 20.5.0
|
|
10
10
|
|
|
11
11
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
12
12
|
"""
|
|
@@ -22,6 +22,7 @@ from flywheel.models.access_type import AccessType
|
|
|
22
22
|
from flywheel.models.accumulator import Accumulator
|
|
23
23
|
from flywheel.models.acquisition import Acquisition
|
|
24
24
|
from flywheel.models.acquisition_container_output import AcquisitionContainerOutput
|
|
25
|
+
from flywheel.models.acquisition_copy_input import AcquisitionCopyInput
|
|
25
26
|
from flywheel.models.acquisition_input import AcquisitionInput
|
|
26
27
|
from flywheel.models.acquisition_list_output import AcquisitionListOutput
|
|
27
28
|
from flywheel.models.acquisition_modify_input import AcquisitionModifyInput
|
|
@@ -616,6 +617,7 @@ from flywheel.models.structured_query_suggestions import StructuredQuerySuggesti
|
|
|
616
617
|
from flywheel.models.structured_query_value_suggestion import StructuredQueryValueSuggestion
|
|
617
618
|
from flywheel.models.subject import Subject
|
|
618
619
|
from flywheel.models.subject_container_output import SubjectContainerOutput
|
|
620
|
+
from flywheel.models.subject_copy_input import SubjectCopyInput
|
|
619
621
|
from flywheel.models.subject_input import SubjectInput
|
|
620
622
|
from flywheel.models.subject_modify import SubjectModify
|
|
621
623
|
from flywheel.models.subject_node import SubjectNode
|
|
@@ -19,6 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import six
|
|
20
20
|
|
|
21
21
|
from flywheel.models.acquisition_parents import AcquisitionParents # noqa: F401,E501
|
|
22
|
+
from flywheel.models.copy_status import CopyStatus # noqa: F401,E501
|
|
22
23
|
from flywheel.models.file_output import FileOutput # noqa: F401,E501
|
|
23
24
|
from flywheel.models.join_origins import JoinOrigins # noqa: F401,E501
|
|
24
25
|
from flywheel.models.note import Note # noqa: F401,E501
|