ChessAnalysisPipeline 0.0.17.dev3__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.
- CHAP/TaskManager.py +216 -0
- CHAP/__init__.py +27 -0
- CHAP/common/__init__.py +57 -0
- CHAP/common/models/__init__.py +8 -0
- CHAP/common/models/common.py +124 -0
- CHAP/common/models/integration.py +659 -0
- CHAP/common/models/map.py +1291 -0
- CHAP/common/processor.py +2869 -0
- CHAP/common/reader.py +658 -0
- CHAP/common/utils.py +110 -0
- CHAP/common/writer.py +730 -0
- CHAP/edd/__init__.py +23 -0
- CHAP/edd/models.py +876 -0
- CHAP/edd/processor.py +3069 -0
- CHAP/edd/reader.py +1023 -0
- CHAP/edd/select_material_params_gui.py +348 -0
- CHAP/edd/utils.py +1572 -0
- CHAP/edd/writer.py +26 -0
- CHAP/foxden/__init__.py +19 -0
- CHAP/foxden/models.py +71 -0
- CHAP/foxden/processor.py +124 -0
- CHAP/foxden/reader.py +224 -0
- CHAP/foxden/utils.py +80 -0
- CHAP/foxden/writer.py +168 -0
- CHAP/giwaxs/__init__.py +11 -0
- CHAP/giwaxs/models.py +491 -0
- CHAP/giwaxs/processor.py +776 -0
- CHAP/giwaxs/reader.py +8 -0
- CHAP/giwaxs/writer.py +8 -0
- CHAP/inference/__init__.py +7 -0
- CHAP/inference/processor.py +69 -0
- CHAP/inference/reader.py +8 -0
- CHAP/inference/writer.py +8 -0
- CHAP/models.py +227 -0
- CHAP/pipeline.py +479 -0
- CHAP/processor.py +125 -0
- CHAP/reader.py +124 -0
- CHAP/runner.py +277 -0
- CHAP/saxswaxs/__init__.py +7 -0
- CHAP/saxswaxs/processor.py +8 -0
- CHAP/saxswaxs/reader.py +8 -0
- CHAP/saxswaxs/writer.py +8 -0
- CHAP/server.py +125 -0
- CHAP/sin2psi/__init__.py +7 -0
- CHAP/sin2psi/processor.py +8 -0
- CHAP/sin2psi/reader.py +8 -0
- CHAP/sin2psi/writer.py +8 -0
- CHAP/tomo/__init__.py +15 -0
- CHAP/tomo/models.py +210 -0
- CHAP/tomo/processor.py +3862 -0
- CHAP/tomo/reader.py +9 -0
- CHAP/tomo/writer.py +59 -0
- CHAP/utils/__init__.py +6 -0
- CHAP/utils/converters.py +188 -0
- CHAP/utils/fit.py +2947 -0
- CHAP/utils/general.py +2655 -0
- CHAP/utils/material.py +274 -0
- CHAP/utils/models.py +595 -0
- CHAP/utils/parfile.py +224 -0
- CHAP/writer.py +122 -0
- MLaaS/__init__.py +0 -0
- MLaaS/ktrain.py +205 -0
- MLaaS/mnist_img.py +83 -0
- MLaaS/tfaas_client.py +371 -0
- chessanalysispipeline-0.0.17.dev3.dist-info/LICENSE +60 -0
- chessanalysispipeline-0.0.17.dev3.dist-info/METADATA +29 -0
- chessanalysispipeline-0.0.17.dev3.dist-info/RECORD +70 -0
- chessanalysispipeline-0.0.17.dev3.dist-info/WHEEL +5 -0
- chessanalysispipeline-0.0.17.dev3.dist-info/entry_points.txt +2 -0
- chessanalysispipeline-0.0.17.dev3.dist-info/top_level.txt +2 -0
MLaaS/tfaas_client.py
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
#-*- coding: utf-8 -*-
|
|
3
|
+
#pylint: disable=
|
|
4
|
+
"""
|
|
5
|
+
File : tfaas_client.py
|
|
6
|
+
Author : Valentin Kuznetsov <vkuznet AT gmail dot com>
|
|
7
|
+
Description: simple python client to communicate with TFaaS server
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
# system modules
|
|
11
|
+
import os
|
|
12
|
+
import sys
|
|
13
|
+
import pwd
|
|
14
|
+
import ssl
|
|
15
|
+
import json
|
|
16
|
+
import binascii
|
|
17
|
+
import argparse
|
|
18
|
+
import itertools
|
|
19
|
+
import mimetypes
|
|
20
|
+
if sys.version_info < (2, 7):
|
|
21
|
+
raise Exception("TFaaS client requires python 2.7 or greater")
|
|
22
|
+
# python 3
|
|
23
|
+
if sys.version.startswith('3.'):
|
|
24
|
+
import urllib.request as urllib2
|
|
25
|
+
import urllib.parse as urllib
|
|
26
|
+
import http.client as httplib
|
|
27
|
+
import http.cookiejar as cookielib
|
|
28
|
+
else:
|
|
29
|
+
import mimetools
|
|
30
|
+
import urllib
|
|
31
|
+
import urllib2
|
|
32
|
+
import httplib
|
|
33
|
+
import cookielib
|
|
34
|
+
|
|
35
|
+
TFAAS_CLIENT = 'tfaas-client/1.1::python/%s.%s' % sys.version_info[:2]
|
|
36
|
+
|
|
37
|
+
class OptionParser():
|
|
38
|
+
def __init__(self):
|
|
39
|
+
"User based option parser"
|
|
40
|
+
self.parser = argparse.ArgumentParser(prog='PROG')
|
|
41
|
+
self.parser.add_argument("--url", action="store",
|
|
42
|
+
dest="url", default="", help="TFaaS URL")
|
|
43
|
+
self.parser.add_argument("--upload", action="store",
|
|
44
|
+
dest="upload", default="", help="upload model to TFaaS")
|
|
45
|
+
self.parser.add_argument("--bundle", action="store",
|
|
46
|
+
dest="bundle", default="", help="upload bundle ML files to TFaaS")
|
|
47
|
+
self.parser.add_argument("--predict", action="store",
|
|
48
|
+
dest="predict", default="", help="fetch prediction from TFaaS")
|
|
49
|
+
self.parser.add_argument("--image", action="store",
|
|
50
|
+
dest="image", default="", help="fetch prediction for given image")
|
|
51
|
+
self.parser.add_argument("--model", action="store",
|
|
52
|
+
dest="model", default="", help="TF model to use")
|
|
53
|
+
self.parser.add_argument("--delete", action="store",
|
|
54
|
+
dest="delete", default="", help="delete model in TFaaS")
|
|
55
|
+
self.parser.add_argument("--models", action="store_true",
|
|
56
|
+
dest="models", default=False, help="show existing models in TFaaS")
|
|
57
|
+
self.parser.add_argument("--verbose", action="store_true",
|
|
58
|
+
dest="verbose", default=False, help="verbose output")
|
|
59
|
+
msg = 'specify private key file name, default $X509_USER_PROXY'
|
|
60
|
+
self.parser.add_argument("--key", action="store",
|
|
61
|
+
default=x509(), dest="ckey", help=msg)
|
|
62
|
+
msg = 'specify private certificate file name, default $X509_USER_PROXY'
|
|
63
|
+
self.parser.add_argument("--cert", action="store",
|
|
64
|
+
default=x509(), dest="cert", help=msg)
|
|
65
|
+
default_ca = os.environ.get("X509_CERT_DIR")
|
|
66
|
+
if not default_ca or not os.path.exists(default_ca):
|
|
67
|
+
default_ca = "/etc/grid-security/certificates"
|
|
68
|
+
if not os.path.exists(default_ca):
|
|
69
|
+
default_ca = ""
|
|
70
|
+
if default_ca:
|
|
71
|
+
msg = 'specify CA path, default currently is %s' % default_ca
|
|
72
|
+
else:
|
|
73
|
+
msg = 'specify CA path; defaults to system CAs.'
|
|
74
|
+
self.parser.add_argument("--capath", action="store",
|
|
75
|
+
default=default_ca, dest="capath", help=msg)
|
|
76
|
+
msg = 'specify number of retries upon busy DAS server message'
|
|
77
|
+
|
|
78
|
+
class HTTPSClientAuthHandler(urllib2.HTTPSHandler):
|
|
79
|
+
"""
|
|
80
|
+
Simple HTTPS client authentication class based on provided
|
|
81
|
+
key/ca information
|
|
82
|
+
"""
|
|
83
|
+
def __init__(self, key=None, cert=None, capath=None, level=0):
|
|
84
|
+
if level > 0:
|
|
85
|
+
urllib2.HTTPSHandler.__init__(self, debuglevel=1)
|
|
86
|
+
else:
|
|
87
|
+
urllib2.HTTPSHandler.__init__(self)
|
|
88
|
+
self.key = key
|
|
89
|
+
self.cert = cert
|
|
90
|
+
self.capath = capath
|
|
91
|
+
|
|
92
|
+
def https_open(self, req):
|
|
93
|
+
"""Open request method"""
|
|
94
|
+
#Rather than pass in a reference to a connection class, we pass in
|
|
95
|
+
# a reference to a function which, for all intents and purposes,
|
|
96
|
+
# will behave as a constructor
|
|
97
|
+
return self.do_open(self.get_connection, req)
|
|
98
|
+
|
|
99
|
+
def get_connection(self, host, timeout=300):
|
|
100
|
+
"""Connection method"""
|
|
101
|
+
if self.key and self.cert and not self.capath:
|
|
102
|
+
return httplib.HTTPSConnection(host, key_file=self.key,
|
|
103
|
+
cert_file=self.cert)
|
|
104
|
+
elif self.cert and self.capath:
|
|
105
|
+
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
|
|
106
|
+
context.load_verify_locations(capath=self.capath)
|
|
107
|
+
context.load_cert_chain(self.cert)
|
|
108
|
+
return httplib.HTTPSConnection(host, context=context)
|
|
109
|
+
return httplib.HTTPSConnection(host)
|
|
110
|
+
|
|
111
|
+
def x509():
|
|
112
|
+
"Helper function to get x509 either from env or tmp file"
|
|
113
|
+
proxy = os.environ.get('X509_USER_PROXY', '')
|
|
114
|
+
if not proxy:
|
|
115
|
+
proxy = '/tmp/x509up_u%s' % pwd.getpwuid( os.getuid() ).pw_uid
|
|
116
|
+
if not os.path.isfile(proxy):
|
|
117
|
+
return ''
|
|
118
|
+
return proxy
|
|
119
|
+
|
|
120
|
+
def check_auth(key):
|
|
121
|
+
"Check if user runs das_client with key/cert and warn users to switch"
|
|
122
|
+
if not key:
|
|
123
|
+
msg = "WARNING: tfaas_client is running without user credentials/X509 proxy, create proxy via 'voms-proxy-init -voms cms -rfc'"
|
|
124
|
+
print(msg)
|
|
125
|
+
|
|
126
|
+
def fullpath(path):
|
|
127
|
+
"Expand path to full path"
|
|
128
|
+
if path and path[0] == '~':
|
|
129
|
+
path = path.replace('~', '')
|
|
130
|
+
path = path[1:] if path[0] == '/' else path
|
|
131
|
+
path = os.path.join(os.environ['HOME'], path)
|
|
132
|
+
return path
|
|
133
|
+
|
|
134
|
+
def choose_boundary():
|
|
135
|
+
"""
|
|
136
|
+
Helper function to replace deprecated mimetools.choose_boundary
|
|
137
|
+
https://stackoverflow.com/questions/27099290/where-is-mimetools-choose-boundary-function-in-python3
|
|
138
|
+
https://docs.python.org/2.7/library/mimetools.html?highlight=choose_boundary#mimetools.choose_boundary
|
|
139
|
+
>>> mimetools.choose_boundary()
|
|
140
|
+
'192.168.1.191.502.42035.1678979116.376.1'
|
|
141
|
+
"""
|
|
142
|
+
# we will return any random string
|
|
143
|
+
import uuid
|
|
144
|
+
return str(uuid.uuid4())
|
|
145
|
+
|
|
146
|
+
# credit: https://pymotw.com/2/urllib2/#uploading-files
|
|
147
|
+
class MultiPartForm(object):
|
|
148
|
+
"""Accumulate the data to be used when posting a form."""
|
|
149
|
+
|
|
150
|
+
def __init__(self):
|
|
151
|
+
self.form_fields = []
|
|
152
|
+
self.files = []
|
|
153
|
+
if sys.version.startswith('3.'):
|
|
154
|
+
self.boundary = choose_boundary()
|
|
155
|
+
else:
|
|
156
|
+
self.boundary = mimetools.choose_boundary()
|
|
157
|
+
return
|
|
158
|
+
|
|
159
|
+
def get_content_type(self):
|
|
160
|
+
return 'multipart/form-data; boundary=%s' % self.boundary
|
|
161
|
+
|
|
162
|
+
def add_field(self, name, value):
|
|
163
|
+
"""Add a simple field to the form data."""
|
|
164
|
+
self.form_fields.append((name, value))
|
|
165
|
+
return
|
|
166
|
+
|
|
167
|
+
def add_file(self, fieldname, filename, fileHandle, mimetype=None):
|
|
168
|
+
"""Add a file to be uploaded."""
|
|
169
|
+
body = fileHandle.read()
|
|
170
|
+
if mimetype is None:
|
|
171
|
+
mimetype = mimetypes.guess_type(filename)[0] or 'application/octet-stream'
|
|
172
|
+
if mimetype == 'application/octet-stream':
|
|
173
|
+
body = binascii.b2a_base64(body)
|
|
174
|
+
# if isinstance(body, bytes):
|
|
175
|
+
# body = body.decode("utf-8")
|
|
176
|
+
self.files.append((fieldname, filename, mimetype, body))
|
|
177
|
+
return
|
|
178
|
+
|
|
179
|
+
def __str__(self):
|
|
180
|
+
"""Return a string representing the form data, including attached files."""
|
|
181
|
+
# Build a list of lists, each containing "lines" of the
|
|
182
|
+
# request. Each part is separated by a boundary string.
|
|
183
|
+
# Once the list is built, return a string where each
|
|
184
|
+
# line is separated by '\r\n'.
|
|
185
|
+
parts = []
|
|
186
|
+
part_boundary = '--' + self.boundary
|
|
187
|
+
|
|
188
|
+
# Add the form fields
|
|
189
|
+
parts.extend(
|
|
190
|
+
[ part_boundary,
|
|
191
|
+
'Content-Disposition: form-data; name="%s"' % name,
|
|
192
|
+
'',
|
|
193
|
+
value,
|
|
194
|
+
]
|
|
195
|
+
for name, value in self.form_fields
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
# Add the files to upload
|
|
199
|
+
# here we use form-data content disposition instead of file one
|
|
200
|
+
# since this is how we define handlers in our Go server
|
|
201
|
+
# for more info see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
|
|
202
|
+
parts.extend(
|
|
203
|
+
[ part_boundary,
|
|
204
|
+
'Content-Disposition: form-data; name="%s"; filename="%s"' % \
|
|
205
|
+
(field_name, filename),
|
|
206
|
+
'Content-Type: %s' % content_type,
|
|
207
|
+
'',
|
|
208
|
+
body,
|
|
209
|
+
]
|
|
210
|
+
for field_name, filename, content_type, body in self.files
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
# Flatten the list and add closing boundary marker,
|
|
214
|
+
# then return CR+LF separated data
|
|
215
|
+
flattened = list(itertools.chain(*parts))
|
|
216
|
+
flattened.append('--' + self.boundary + '--')
|
|
217
|
+
flattened.append('')
|
|
218
|
+
return '\r\n'.join(flattened)
|
|
219
|
+
|
|
220
|
+
def models(host, verbose=None, ckey=None, cert=None, capath=None):
|
|
221
|
+
"models API shows models from TFaaS server"
|
|
222
|
+
url = host + '/models'
|
|
223
|
+
client = '%s (%s)' % (TFAAS_CLIENT, os.environ.get('USER', ''))
|
|
224
|
+
headers = {"Accept": "application/json", "User-Agent": client}
|
|
225
|
+
if verbose:
|
|
226
|
+
print("URL : %s" % url)
|
|
227
|
+
encoded_data = json.dumps({})
|
|
228
|
+
return getdata(url, headers, encoded_data, ckey, cert, capath, verbose, 'GET')
|
|
229
|
+
|
|
230
|
+
def delete(host, model, verbose=None, ckey=None, cert=None, capath=None):
|
|
231
|
+
"delete API deletes given model in TFaaS server"
|
|
232
|
+
url = host + '/delete'
|
|
233
|
+
client = '%s (%s)' % (TFAAS_CLIENT, os.environ.get('USER', ''))
|
|
234
|
+
headers = {"User-Agent": client}
|
|
235
|
+
if verbose:
|
|
236
|
+
print("URL : %s" % url)
|
|
237
|
+
print("model : %s" % model)
|
|
238
|
+
form = MultiPartForm()
|
|
239
|
+
form.add_field('model', model)
|
|
240
|
+
edata = str(form)
|
|
241
|
+
headers['Content-length'] = len(edata)
|
|
242
|
+
headers['Content-Type'] = form.get_content_type()
|
|
243
|
+
return getdata(url, headers, edata, ckey, cert, capath, verbose, method='DELETE')
|
|
244
|
+
|
|
245
|
+
def bundle(host, ifile, verbose=None, ckey=None, cert=None, capath=None):
|
|
246
|
+
"bundle API uploads given bundle model files to TFaaS server"
|
|
247
|
+
url = host + '/upload'
|
|
248
|
+
client = '%s (%s)' % (TFAAS_CLIENT, os.environ.get('USER', ''))
|
|
249
|
+
headers = {"User-Agent": client, "Content-Encoding": "gzip", "Content-Type": "application/octet-stream"}
|
|
250
|
+
data = open(ifile, 'rb').read()
|
|
251
|
+
return getdata(url, headers, data, ckey, cert, capath, verbose)
|
|
252
|
+
|
|
253
|
+
def upload(host, ifile, verbose=None, ckey=None, cert=None, capath=None):
|
|
254
|
+
"upload API uploads given model to TFaaS server"
|
|
255
|
+
url = host + '/upload'
|
|
256
|
+
client = '%s (%s)' % (TFAAS_CLIENT, os.environ.get('USER', ''))
|
|
257
|
+
headers = {"User-Agent": client}
|
|
258
|
+
params = json.load(open(ifile))
|
|
259
|
+
if verbose:
|
|
260
|
+
print("URL : %s" % url)
|
|
261
|
+
print("ifile : %s" % ifile)
|
|
262
|
+
print("params: %s" % json.dumps(params))
|
|
263
|
+
|
|
264
|
+
form = MultiPartForm()
|
|
265
|
+
for key in params.keys():
|
|
266
|
+
if key in ['model', 'labels', 'params']:
|
|
267
|
+
flag = 'r'
|
|
268
|
+
if key == 'model':
|
|
269
|
+
flag = 'rb'
|
|
270
|
+
name = params[key]
|
|
271
|
+
form.add_file(key, name, fileHandle=open(name, flag))
|
|
272
|
+
else:
|
|
273
|
+
form.add_field(key, params[key])
|
|
274
|
+
edata = str(form)
|
|
275
|
+
headers['Content-length'] = len(edata)
|
|
276
|
+
headers['Content-Type'] = form.get_content_type()
|
|
277
|
+
headers['Content-Encoding'] = 'base64'
|
|
278
|
+
return getdata(url, headers, edata, ckey, cert, capath, verbose)
|
|
279
|
+
|
|
280
|
+
def predict(host, ifile, model, verbose=None, ckey=None, cert=None, capath=None):
|
|
281
|
+
"predict API get predictions from TFaaS server"
|
|
282
|
+
url = host + '/json'
|
|
283
|
+
client = '%s (%s)' % (TFAAS_CLIENT, os.environ.get('USER', ''))
|
|
284
|
+
headers = {"Accept": "application/json", "User-Agent": client}
|
|
285
|
+
params = json.load(open(ifile))
|
|
286
|
+
if model: # overwrite model name in given input file
|
|
287
|
+
params['model'] = model
|
|
288
|
+
if verbose:
|
|
289
|
+
print("URL : %s" % url)
|
|
290
|
+
print("ifile : %s" % ifile)
|
|
291
|
+
print("params: %s" % json.dumps(params))
|
|
292
|
+
encoded_data = json.dumps(params)
|
|
293
|
+
return getdata(url, headers, encoded_data, ckey, cert, capath, verbose)
|
|
294
|
+
|
|
295
|
+
def predictImage(host, ifile, model, verbose=None, ckey=None, cert=None, capath=None):
|
|
296
|
+
"predict API get predictions from TFaaS server"
|
|
297
|
+
url = host + '/image'
|
|
298
|
+
client = '%s (%s)' % (TFAAS_CLIENT, os.environ.get('USER', ''))
|
|
299
|
+
headers = {"Accept": "application/json", "User-Agent": client}
|
|
300
|
+
if verbose:
|
|
301
|
+
print("URL : %s" % url)
|
|
302
|
+
print("ifile : %s" % ifile)
|
|
303
|
+
print("model : %s" % model)
|
|
304
|
+
form = MultiPartForm()
|
|
305
|
+
# form.add_file('image', ifile, fileHandle=open(ifile, 'r'))
|
|
306
|
+
form.add_file('image', ifile, fileHandle=open(ifile, 'rb'))
|
|
307
|
+
form.add_field('model', model)
|
|
308
|
+
edata = str(form)
|
|
309
|
+
headers['Content-length'] = len(edata)
|
|
310
|
+
headers['Content-Type'] = form.get_content_type()
|
|
311
|
+
return getdata(url, headers, edata, ckey, cert, capath, verbose)
|
|
312
|
+
|
|
313
|
+
def getdata(url, headers, encoded_data, ckey, cert, capath, verbose=None, method='POST'):
|
|
314
|
+
"helper function to use in predict/upload APIs, it place given URL call to the server"
|
|
315
|
+
debug = 1 if verbose else 0
|
|
316
|
+
req = urllib2.Request(url=url, headers=headers, data=encoded_data)
|
|
317
|
+
if method == 'DELETE':
|
|
318
|
+
req.get_method = lambda: 'DELETE'
|
|
319
|
+
elif method == 'GET':
|
|
320
|
+
req = urllib2.Request(url=url, headers=headers)
|
|
321
|
+
if ckey and cert:
|
|
322
|
+
ckey = fullpath(ckey)
|
|
323
|
+
cert = fullpath(cert)
|
|
324
|
+
http_hdlr = HTTPSClientAuthHandler(ckey, cert, capath, debug)
|
|
325
|
+
elif cert and capath:
|
|
326
|
+
cert = fullpath(cert)
|
|
327
|
+
http_hdlr = HTTPSClientAuthHandler(ckey, cert, capath, debug)
|
|
328
|
+
else:
|
|
329
|
+
http_hdlr = urllib2.HTTPHandler(debuglevel=debug)
|
|
330
|
+
proxy_handler = urllib2.ProxyHandler({})
|
|
331
|
+
cookie_jar = cookielib.CookieJar()
|
|
332
|
+
cookie_handler = urllib2.HTTPCookieProcessor(cookie_jar)
|
|
333
|
+
data = {}
|
|
334
|
+
try:
|
|
335
|
+
opener = urllib2.build_opener(http_hdlr, proxy_handler, cookie_handler)
|
|
336
|
+
fdesc = opener.open(req)
|
|
337
|
+
if url.endswith('json'):
|
|
338
|
+
data = json.load(fdesc)
|
|
339
|
+
else:
|
|
340
|
+
data = fdesc.read()
|
|
341
|
+
fdesc.close()
|
|
342
|
+
except urllib2.HTTPError as error:
|
|
343
|
+
print(error.read())
|
|
344
|
+
sys.exit(1)
|
|
345
|
+
if url.endswith('json'):
|
|
346
|
+
return json.dumps(data)
|
|
347
|
+
return data
|
|
348
|
+
|
|
349
|
+
def main():
|
|
350
|
+
"Main function"
|
|
351
|
+
optmgr = OptionParser()
|
|
352
|
+
opts = optmgr.parser.parse_args()
|
|
353
|
+
check_auth(opts.ckey)
|
|
354
|
+
res = ''
|
|
355
|
+
if opts.upload:
|
|
356
|
+
res = upload(opts.url, opts.upload, opts.verbose, opts.ckey, opts.cert, opts.capath)
|
|
357
|
+
if opts.bundle:
|
|
358
|
+
res = bundle(opts.url, opts.bundle, opts.verbose, opts.ckey, opts.cert, opts.capath)
|
|
359
|
+
elif opts.delete:
|
|
360
|
+
res = delete(opts.url, opts.delete, opts.verbose, opts.ckey, opts.cert, opts.capath)
|
|
361
|
+
elif opts.models:
|
|
362
|
+
res = models(opts.url, opts.verbose, opts.ckey, opts.cert, opts.capath)
|
|
363
|
+
elif opts.predict:
|
|
364
|
+
res = predict(opts.url, opts.predict, opts.model, opts.verbose, opts.ckey, opts.cert, opts.capath)
|
|
365
|
+
elif opts.image:
|
|
366
|
+
res = predictImage(opts.url, opts.image, opts.model, opts.verbose, opts.ckey, opts.cert, opts.capath)
|
|
367
|
+
if res:
|
|
368
|
+
print(res)
|
|
369
|
+
|
|
370
|
+
if __name__ == '__main__':
|
|
371
|
+
main()
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Valentin Kuznetsov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Some code in CHAP.utils has been based or taken from the lmfit library whose
|
|
25
|
+
licence is below.
|
|
26
|
+
|
|
27
|
+
Copyright 2022 Matthew Newville, The University of Chicago
|
|
28
|
+
Renee Otten, Brandeis University
|
|
29
|
+
Till Stensitzki, Freie Universitat Berlin
|
|
30
|
+
A. R. J. Nelson, Australian Nuclear Science and Technology Organisation
|
|
31
|
+
Antonino Ingargiola, University of California, Los Angeles
|
|
32
|
+
Daniel B. Allen, Johns Hopkins University
|
|
33
|
+
Michal Rawlik, Eidgenossische Technische Hochschule, Zurich
|
|
34
|
+
|
|
35
|
+
Redistribution and use in source and binary forms, with or without
|
|
36
|
+
modification, are permitted provided that the following conditions are met:
|
|
37
|
+
|
|
38
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
39
|
+
this list of conditions and the following disclaimer.
|
|
40
|
+
|
|
41
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
42
|
+
notice, this list of conditions and the following disclaimer in the
|
|
43
|
+
documentation and/or other materials provided with the distribution.
|
|
44
|
+
|
|
45
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
46
|
+
contributors may be used to endorse or promote products derived from this
|
|
47
|
+
software without specific prior written permission.
|
|
48
|
+
|
|
49
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
50
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
51
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
52
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
53
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
54
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
55
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
56
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
57
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
58
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
59
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
60
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: ChessAnalysisPipeline
|
|
3
|
+
Version: 0.0.17.dev3
|
|
4
|
+
Summary: CHESS analysis pipeline framework
|
|
5
|
+
Home-page: https://github.com/CHESSComputing/ChessAnalysisPipeline
|
|
6
|
+
Author: Keara Soloway, Rolf Verberg, Valentin Kuznetsov
|
|
7
|
+
Author-email:
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: numpy ==1.26.4
|
|
15
|
+
Requires-Dist: pydantic ==2.7.3
|
|
16
|
+
Requires-Dist: pyyaml ==6.0.3
|
|
17
|
+
|
|
18
|
+
[](https://zenodo.org/badge/latestdoi/600053436)
|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
# ChessAnalysisPipeline (CHAP)
|
|
23
|
+
CHAP is a package that provides a framework for executing data anlaysis pipelines. The package can be found on PyPI and conda-forge.
|
|
24
|
+
|
|
25
|
+
## Subpackages
|
|
26
|
+
There are several subpackages within CHAP that contain specialized items to handle specific types of data processing in the CHAP framework. Dependencies for these subpackages can be found in `CHAP/<subpackage_name>/environment.yml`.
|
|
27
|
+
|
|
28
|
+
## Documentation
|
|
29
|
+
Documentation for the latest version can be found on [this project's github pages site](https://chesscomputing.github.io/ChessAnalysisPipeline/).
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
CHAP/TaskManager.py,sha256=Q9YImn3_G4OcVG5w7wIWFvs1tEWl4pcYtrqI_i1v05A,6922
|
|
2
|
+
CHAP/__init__.py,sha256=KPu0wIjr5W3riVVX1Gv-ECkBJAoyvbsnOmUN0oYdqiY,1137
|
|
3
|
+
CHAP/models.py,sha256=KKD5w41OALabHiGP06fsDHJRwgkM_uOKtsApYGkioOY,7823
|
|
4
|
+
CHAP/pipeline.py,sha256=CplvxHKKObZSCbUIf4XgaDtU8R9rgUoCsLTmgLeyMmo,19125
|
|
5
|
+
CHAP/processor.py,sha256=1TQyUIQGNmwdueuokasiNJRlXoP9x_tvqVlXEaPgw8U,4151
|
|
6
|
+
CHAP/reader.py,sha256=FzRTeA11v5SLEsJF7SLqrDlv6vcvoO8lWdbTL5xb_40,3828
|
|
7
|
+
CHAP/runner.py,sha256=gagp0FENfFGUDJ8nYP_NIJccy5m7oI_WM8EJlO8_004,9790
|
|
8
|
+
CHAP/server.py,sha256=XqTt0srQO-K245hfbGEV2qPnSgAfQhSto0wtBGHyovw,3580
|
|
9
|
+
CHAP/writer.py,sha256=JvTaigNAVKG8CVOTSRSqE0nK_Vt9xZnLcVpSBe-1ywI,4006
|
|
10
|
+
CHAP/common/__init__.py,sha256=Dqr3v_IKJC8-FLhIQ8R9G1iFUylK4KU4-ZKPU_LPXUU,1341
|
|
11
|
+
CHAP/common/processor.py,sha256=eBdoH8JgCYy5lRsrV5FLgpCBY2YodnkiL02X-sXAYSo,116994
|
|
12
|
+
CHAP/common/reader.py,sha256=oOEyLe2VgMomQ7GPn5lYirkycIkD-yyakqHpRz-nPO4,24112
|
|
13
|
+
CHAP/common/utils.py,sha256=KIueutUN8tZfHIyrgHYvU8E-ogoP9lIz3lOXc9f0ek0,3797
|
|
14
|
+
CHAP/common/writer.py,sha256=MDfke80ZpwQs4i9lumTzP-vFIDZQdkPqgjJXoS4EyB8,25931
|
|
15
|
+
CHAP/common/models/__init__.py,sha256=_RoPRdLX85OYR0Zx8th4dscjUnyziRLe77NkJgy8Oss,195
|
|
16
|
+
CHAP/common/models/common.py,sha256=pFYmr1kIhQT6qB7m7odfZHgEDaxiQP6lZBcttQSZw_U,4795
|
|
17
|
+
CHAP/common/models/integration.py,sha256=8iOutRr6JJHydjK6gYv9i3FeHTksYaUIpVO6UiJwsBM,26576
|
|
18
|
+
CHAP/common/models/map.py,sha256=pMjIY0g2LSlxSiEpTMarnDm2oHns51DhCp1JQF3vbwE,51586
|
|
19
|
+
CHAP/edd/__init__.py,sha256=GupeOcncxnyfA2hZQ-iNc4-BhuhVCtstZ3MqAego_lc,549
|
|
20
|
+
CHAP/edd/models.py,sha256=KN_OgiECxqHFFT0rEMGVqnkCYKAS3GbOmjDMHNhKr68,35270
|
|
21
|
+
CHAP/edd/processor.py,sha256=e3wliyMVuK77AqjCokjh0B8e3LKSP3_jahQj_y6EXcI,134193
|
|
22
|
+
CHAP/edd/reader.py,sha256=99E9SXmQ2JG6MFRusHgBaLEzWzCC-xha-Ktf6RaNkM8,42092
|
|
23
|
+
CHAP/edd/select_material_params_gui.py,sha256=JB0TzAhHOZhm94U_evac-eRaSFSbObNiT2MCyhBS9eQ,13405
|
|
24
|
+
CHAP/edd/utils.py,sha256=mMwOY_X-ZjpOXUy6V7Fq8oOY0X3l-JDoaU6c29XdUUw,64020
|
|
25
|
+
CHAP/edd/writer.py,sha256=BVYG2yZ4vPIriNXQkbSFOoAq17sHbeApPIi2U2B5DOg,622
|
|
26
|
+
CHAP/foxden/__init__.py,sha256=l-kw9kbL3PsYCZFgGvX-y61EANmAb5h9Lu_2N-PHO-Y,442
|
|
27
|
+
CHAP/foxden/models.py,sha256=fdbeJJof4uvCH3k2PYBOtQMX7sMgt1wKTRlrHA_F0zs,2289
|
|
28
|
+
CHAP/foxden/processor.py,sha256=HT8Irc-NoiniZjo5AYejcATwwW00Re7S8eEz1_ctO30,4070
|
|
29
|
+
CHAP/foxden/reader.py,sha256=el8jG20uhaVolppU1xs0oEMKwrsBRVFcDfLQ5jPqaEY,8636
|
|
30
|
+
CHAP/foxden/utils.py,sha256=lvBY9yR-Uy2Tc47JHVxVClgC95em41OpbSGu3INdD1Y,2570
|
|
31
|
+
CHAP/foxden/writer.py,sha256=92rnrzOz0kq69KNg_IipWs2rOjeljiA_EH-KeX1-ttE,6505
|
|
32
|
+
CHAP/giwaxs/__init__.py,sha256=P1nKo-ljnakVCDoaDnLjYV2R6-hgtJdQ1KexJsAZfgk,314
|
|
33
|
+
CHAP/giwaxs/models.py,sha256=gCNEWGP5K3hn2Wa3IAgRVlasjm3inv6NGsR5Nk8I3Ek,18870
|
|
34
|
+
CHAP/giwaxs/processor.py,sha256=V-l3iY2HyhFCuIHoaHadcv6HO8vCNZwc2VWL5Qnf7s8,34157
|
|
35
|
+
CHAP/giwaxs/reader.py,sha256=LheuHyLw0ycqBrSxDhcvRnKYKPbagM5ZJzgvNrY4m84,149
|
|
36
|
+
CHAP/giwaxs/writer.py,sha256=VXcKxsCmjpYeX7pxra62f6MJ6PAAQ9Me3sa0zcmPPOc,149
|
|
37
|
+
CHAP/inference/__init__.py,sha256=eQrNno8-ZoI4DTpNrzUufCXYyCBqqgSbFcq5UJfyEd4,263
|
|
38
|
+
CHAP/inference/processor.py,sha256=m4kLjxsaC9x165VBVVQBmm92I81diKBfD80UvWbR_gM,2052
|
|
39
|
+
CHAP/inference/reader.py,sha256=x6WEbnVv0d6a3BOlrXQLQ5YvTk6XB7OCeSVllNTmGOA,152
|
|
40
|
+
CHAP/inference/writer.py,sha256=w2ZYHj2Kchx_-IUatTI-75nSRwNQ4nuLLacxUlfyprE,152
|
|
41
|
+
CHAP/saxswaxs/__init__.py,sha256=lssttzcofT3ccMUhYccyNgvNi0I2ciGcbaPy6jxDWMA,203
|
|
42
|
+
CHAP/saxswaxs/processor.py,sha256=pdnuFBxx0wEU3dXY18v5gJO1TDuTq6J1PBxHpiIkXFQ,170
|
|
43
|
+
CHAP/saxswaxs/reader.py,sha256=kMMZ1vH84m9K96De022LXFwZv4MwxX8B1Ccrd3VhU9A,151
|
|
44
|
+
CHAP/saxswaxs/writer.py,sha256=7cLlrFfD5bhj_x6Q49ftOQebALndTjfasqP5Yp0OjMs,151
|
|
45
|
+
CHAP/sin2psi/__init__.py,sha256=zIJedTskbkJj2PNqXEFJOlQ8lJvKZfg23J1ThhCYcE8,199
|
|
46
|
+
CHAP/sin2psi/processor.py,sha256=gbD-BaZhCAWjdRCbP5w4D6UCAGdLLiV8cjBCSePJOn0,169
|
|
47
|
+
CHAP/sin2psi/reader.py,sha256=ghnnGbxHWs2JP_0VBWz7tJ2GK1QKyqWJM9O8OxlU42Q,150
|
|
48
|
+
CHAP/sin2psi/writer.py,sha256=e5-Knaspe0MGoCOROtkYgqU7w9b2pjQQ_uS0e4bMaAg,150
|
|
49
|
+
CHAP/tomo/__init__.py,sha256=Z55CbDXHNW-nbWJwmqUx4VjgVrIwm3LUOQXvWO-HyRU,389
|
|
50
|
+
CHAP/tomo/models.py,sha256=bmH-ubu6DUGle31z-yYbRgx6N6VGQTNQYiGdtnlo7io,8725
|
|
51
|
+
CHAP/tomo/processor.py,sha256=pKACSvgjkDl0dxhy0wdT5-2ZF88HwLFO6XnjhERcHnw,168246
|
|
52
|
+
CHAP/tomo/reader.py,sha256=Of5ngLiM7ffj9xifNyZwiymfcbAYcoYHw3LX5qfNML4,150
|
|
53
|
+
CHAP/tomo/writer.py,sha256=_BuYDoGpOkfDD4zeZjZtUP39DjpXTBKDh0_AwjJI0IQ,1877
|
|
54
|
+
CHAP/utils/__init__.py,sha256=6u5bqrUILO0WIAIrefPsy8OwfDA_XmRyBJ7XQ5IYfIQ,224
|
|
55
|
+
CHAP/utils/converters.py,sha256=nbshRcplmHiyDbd7y7IRgSQsY24mmgA8FZkNoWICXBg,6870
|
|
56
|
+
CHAP/utils/fit.py,sha256=ahojLyyperlT2otTcCkb_uL61E-xM1-saS5ZzNfnx1c,123496
|
|
57
|
+
CHAP/utils/general.py,sha256=Uq0DvvnVh6tPWSZFhgfncu3-9v76nMkXJtafC4B1-ac,97286
|
|
58
|
+
CHAP/utils/material.py,sha256=9M9ieSznhj3VXXbFua9tASRpCiTpiClAw0G6wwy1Nlo,11854
|
|
59
|
+
CHAP/utils/models.py,sha256=pMc10djFt5olo0K47_Q6Sqisc6tBGxnvWfckV7yR5d4,20205
|
|
60
|
+
CHAP/utils/parfile.py,sha256=PIGWSmWeaDzY9N_gyGYQ7Vs_05P7F89pUoCWvyhDDqI,8935
|
|
61
|
+
MLaaS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
+
MLaaS/ktrain.py,sha256=SPDUOQgjBDSx7sI8vZNXog9orvSyKmzpe6TdGHol9qM,7467
|
|
63
|
+
MLaaS/mnist_img.py,sha256=ppDtlo6yrNQy0oIhFZVOnLvHJrR3ZPZ3PjZTtJY8l0E,2738
|
|
64
|
+
MLaaS/tfaas_client.py,sha256=zpZ201wwcQBW1XkzDakD9Kl_NRSESAUdbnN6k6Ey15A,14889
|
|
65
|
+
chessanalysispipeline-0.0.17.dev3.dist-info/LICENSE,sha256=IbeOUUh4pqaZbUvtbkPFMfTH2YYFlRUNtRKr0TQeUpg,3076
|
|
66
|
+
chessanalysispipeline-0.0.17.dev3.dist-info/METADATA,sha256=Z-NuUUqvEGF2B0uu4dPlSyvsiT9WsvjuFUw2vyoOusw,1473
|
|
67
|
+
chessanalysispipeline-0.0.17.dev3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
68
|
+
chessanalysispipeline-0.0.17.dev3.dist-info/entry_points.txt,sha256=w-KIKdUjmj5GCobrFC4_jexCsFB4yMXYjrsMWrhI6Co,42
|
|
69
|
+
chessanalysispipeline-0.0.17.dev3.dist-info/top_level.txt,sha256=BKhggOWLb9dD6oQm1RXrkJPnXm-zJxVzQef1iXYtt2k,11
|
|
70
|
+
chessanalysispipeline-0.0.17.dev3.dist-info/RECORD,,
|