webmo 1.3.2__tar.gz → 1.3.3__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.
- {webmo-1.3.2/webmo.egg-info → webmo-1.3.3}/PKG-INFO +3 -2
- {webmo-1.3.2 → webmo-1.3.3}/setup.py +2 -1
- {webmo-1.3.2 → webmo-1.3.3}/webmo/__init__.py +1 -1
- {webmo-1.3.2 → webmo-1.3.3}/webmo/webmo_rest.py +10 -9
- {webmo-1.3.2 → webmo-1.3.3/webmo.egg-info}/PKG-INFO +3 -2
- {webmo-1.3.2 → webmo-1.3.3}/webmo.egg-info/requires.txt +6 -0
- {webmo-1.3.2 → webmo-1.3.3}/LICENSE +0 -0
- {webmo-1.3.2 → webmo-1.3.3}/README.md +0 -0
- {webmo-1.3.2 → webmo-1.3.3}/setup.cfg +0 -0
- {webmo-1.3.2 → webmo-1.3.3}/webmo/gui.py +0 -0
- {webmo-1.3.2 → webmo-1.3.3}/webmo/spectrum.py +0 -0
- {webmo-1.3.2 → webmo-1.3.3}/webmo/util.py +0 -0
- {webmo-1.3.2 → webmo-1.3.3}/webmo.egg-info/SOURCES.txt +0 -0
- {webmo-1.3.2 → webmo-1.3.3}/webmo.egg-info/dependency_links.txt +0 -0
- {webmo-1.3.2 → webmo-1.3.3}/webmo.egg-info/top_level.txt +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webmo
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.3
|
|
4
4
|
Summary: A Python-based interface to WebMO
|
|
5
5
|
Home-page: https://github.com/jrschmidt2/webmo-python
|
|
6
|
-
Download-URL: https://github.com/jrschmidt2/webmo-python/archive/refs/tags/1.3.
|
|
6
|
+
Download-URL: https://github.com/jrschmidt2/webmo-python/archive/refs/tags/1.3.3.tar.gz
|
|
7
7
|
Author: J.R. Schmidt
|
|
8
8
|
Author-email: schmidt@webmo.net
|
|
9
9
|
License: MIT
|
|
@@ -11,4 +11,5 @@ Keywords: WEBMO,REST,API
|
|
|
11
11
|
Provides-Extra: spectrum
|
|
12
12
|
Provides-Extra: util
|
|
13
13
|
Provides-Extra: gui
|
|
14
|
+
Provides-Extra: all
|
|
14
15
|
License-File: LICENSE
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
from .webmo_rest import WebMOREST
|
|
2
|
-
__version__ = "1.3.
|
|
2
|
+
__version__ = "1.3.3"
|
|
@@ -16,7 +16,7 @@ class WebMOREST:
|
|
|
16
16
|
creation/destruction.
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
|
-
def __init__(self, base_url, username, password=""):
|
|
19
|
+
def __init__(self, base_url, username, password="", expiration=24):
|
|
20
20
|
"""Constructor for WebMOREST
|
|
21
21
|
|
|
22
22
|
This constructor generates a WebMOREST object and also generates and stores a newly
|
|
@@ -26,6 +26,7 @@ class WebMOREST:
|
|
|
26
26
|
base_url(str): The base URL (ending in rest.cgi) of the WeBMO rest endpoint
|
|
27
27
|
username(str): The WebMO username
|
|
28
28
|
password(str, optional): The WebMO password; if omitted, this is supplied interactively
|
|
29
|
+
expiration(int, optional): The expiration time (in hours) of the REST session token
|
|
29
30
|
|
|
30
31
|
Returns:
|
|
31
32
|
object: The newly constructed WebMO object
|
|
@@ -36,7 +37,7 @@ class WebMOREST:
|
|
|
36
37
|
if not password:
|
|
37
38
|
password=getpass(prompt="Enter WebMO password for user %s:" % username)
|
|
38
39
|
#obtain a REST token using the specified credentials
|
|
39
|
-
login={'username' : username, 'password' : password
|
|
40
|
+
login={'username' : username, 'password' : password, 'expiration' : expiration}
|
|
40
41
|
r = requests.post(base_url + '/sessions', data=login)
|
|
41
42
|
r.raise_for_status() #raise an exception if there is a problem with the request
|
|
42
43
|
|
|
@@ -315,7 +316,7 @@ class WebMOREST:
|
|
|
315
316
|
r = requests.delete(self._base_url + "/jobs/%d" % job_number, params=self._auth)
|
|
316
317
|
r.raise_for_status()
|
|
317
318
|
|
|
318
|
-
def import_job(self, job_name,
|
|
319
|
+
def import_job(self, job_name, output_filename, engine):
|
|
319
320
|
"""Imports an existing output file into WebMO
|
|
320
321
|
|
|
321
322
|
This call imports an existing computational output file, parsing the output and creating a newly
|
|
@@ -323,7 +324,7 @@ class WebMOREST:
|
|
|
323
324
|
|
|
324
325
|
Arguments:
|
|
325
326
|
job_name(str): The name of the new WebMO job
|
|
326
|
-
|
|
327
|
+
output_filename(str): The filename (full path) of an existing output file to import
|
|
327
328
|
engine(str): The name of the computational engine
|
|
328
329
|
|
|
329
330
|
Returns:
|
|
@@ -332,12 +333,12 @@ class WebMOREST:
|
|
|
332
333
|
|
|
333
334
|
params = self._auth.copy()
|
|
334
335
|
params.update({'jobName' : job_name, 'engine' : engine})
|
|
335
|
-
output_file = {'outputFile' : ('output.log', open(
|
|
336
|
+
output_file = {'outputFile' : ('output.log', open(output_filename, 'rb'), 'text/plain')}
|
|
336
337
|
r = requests.post(self._base_url + '/jobs', data=params, files=output_file)
|
|
337
338
|
r.raise_for_status()
|
|
338
339
|
return r.json()["jobNumber"]
|
|
339
340
|
|
|
340
|
-
def submit_job(self, job_name,
|
|
341
|
+
def submit_job(self, job_name, input_contents, engine, queue=None, nodes=1, ppn=1, **kwargs):
|
|
341
342
|
"""Submits and executes a new WebMO job
|
|
342
343
|
|
|
343
344
|
This call submits and executes a new job to a computational engine, generating a new WebMO job,
|
|
@@ -345,7 +346,7 @@ class WebMOREST:
|
|
|
345
346
|
|
|
346
347
|
Arguments:
|
|
347
348
|
job_name(str): The name of the new WebMO job
|
|
348
|
-
|
|
349
|
+
input_contents(str): The valid input for submission to the computational engine as its input file
|
|
349
350
|
engine(str): The name of the computational engine
|
|
350
351
|
queue(str, optional): The name of the queue in which to submit the job_name (required for external queues)
|
|
351
352
|
nodes(int, optional): The number of nodes to use; defaults to 1
|
|
@@ -358,7 +359,7 @@ class WebMOREST:
|
|
|
358
359
|
"""
|
|
359
360
|
|
|
360
361
|
params = self._auth.copy()
|
|
361
|
-
params.update({'jobName' : job_name, 'engine' : engine, 'inputFile':
|
|
362
|
+
params.update({'jobName' : job_name, 'engine' : engine, 'inputFile': input_contents,
|
|
362
363
|
'queue': queue, 'nodes': nodes, 'ppn': ppn, **kwargs})
|
|
363
364
|
r = requests.post(self._base_url + '/jobs', data=params)
|
|
364
365
|
r.raise_for_status()
|
|
@@ -415,7 +416,7 @@ class WebMOREST:
|
|
|
415
416
|
# Engines resource
|
|
416
417
|
#
|
|
417
418
|
def get_engines(self, target_user=""):
|
|
418
|
-
"""Fetches a list of
|
|
419
|
+
"""Fetches a list of computational engines available to the current user or specified target user
|
|
419
420
|
|
|
420
421
|
This call returns a JSON-formatted list of available engines and associated queues.
|
|
421
422
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: webmo
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.3
|
|
4
4
|
Summary: A Python-based interface to WebMO
|
|
5
5
|
Home-page: https://github.com/jrschmidt2/webmo-python
|
|
6
|
-
Download-URL: https://github.com/jrschmidt2/webmo-python/archive/refs/tags/1.3.
|
|
6
|
+
Download-URL: https://github.com/jrschmidt2/webmo-python/archive/refs/tags/1.3.3.tar.gz
|
|
7
7
|
Author: J.R. Schmidt
|
|
8
8
|
Author-email: schmidt@webmo.net
|
|
9
9
|
License: MIT
|
|
@@ -11,4 +11,5 @@ Keywords: WEBMO,REST,API
|
|
|
11
11
|
Provides-Extra: spectrum
|
|
12
12
|
Provides-Extra: util
|
|
13
13
|
Provides-Extra: gui
|
|
14
|
+
Provides-Extra: all
|
|
14
15
|
License-File: LICENSE
|
|
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
|