Skip to content

Commit ec403b9

Browse files
committed
Merge branch 'master' of https://github.com/CMSCompOps/WorkflowWebTools into py3
2 parents a21377a + 7d95994 commit ec403b9

20 files changed

Lines changed: 84 additions & 214 deletions

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
language: python
2-
python: 2.7
3-
dist: trusty
2+
matrix:
3+
include:
4+
- dist: trusty
5+
python: 2.7
6+
- dist: xenial
7+
python: 3.7
8+
env:
9+
- nodoc=true
410
services:
511
- mongodb
612
env: TMPDIR=$PWD/tmp

docs/api.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ From the URL root index, users will be able to directly access the following:
1616
- :ref:`global-view-ref`
1717
- :ref:`new-user-ref`
1818
- :ref:`reset-pass-ref`
19-
- :ref:`show-logs-ref`
2019

2120
.. _global-view-ref:
2221

@@ -53,13 +52,6 @@ Reporting Completed Actions
5352

5453
.. automethod:: workflowtools.WorkflowTools.reportaction
5554

56-
.. _show-logs-ref:
57-
58-
Viewing Workflow Logs
59-
~~~~~~~~~~~~~~~~~~~~~
60-
61-
.. automethod:: workflowtools.WorkflowTools.showlog
62-
6355
.. _new-user-ref:
6456

6557
Creating a New Account

docs/python_modules.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ Manage Actions
5555
.. automodule:: WorkflowWebTools.manageactions
5656
:members:
5757

58-
Show Log
59-
~~~~~~~~
60-
61-
.. automodule:: WorkflowWebTools.showlog
62-
:members:
63-
6458
Classifying Errors
6559
~~~~~~~~~~~~~~~~~~
6660

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
'templates/*']
1919
},
2020
install_requires=[
21-
'cmstoolbox>=0.11.3',
21+
'cmstoolbox>=0.12.0',
2222
'more-itertools<6.0.0',
2323
'cherrypy<18.0.0',
2424
'mako',
2525
'numpy>=1.6.1',
2626
'scipy==1.1.0',
27-
'sklearn',
27+
'scikit-learn==0.20.3',
2828
'passlib>=1.6',
2929
'bcrypt',
3030
'pyOpenSSL',
@@ -35,6 +35,6 @@
3535
'cx_Oracle',
3636
'pandas',
3737
'keras',
38-
'tensorflow'
38+
'tensorflow<2.0'
3939
]
4040
)

test/test_report_action.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def setUp(self):
2828
self.coll = manageactions.get_actions_collection()
2929
# Check that test database is empty
3030
if self.coll.count() != 0:
31-
print 'Test database not empty, abort!!'
31+
print('Test database not empty, abort!!')
3232
exit(123)
3333

3434
now = time.time()

test/test_workflowwebtools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,11 @@ def setUp(self):
237237
if os.path.exists('reasons.db'):
238238
os.remove('reasons.db')
239239

240-
print 'before', rm.reasons_list()
240+
print('before', rm.reasons_list())
241241

242242
rm.update_reasons(self.reasons)
243243

244-
print 'after', rm.reasons_list()
244+
print('after', rm.reasons_list())
245245

246246

247247
def tearDown(self):
@@ -291,7 +291,7 @@ def setUp(self):
291291
rm.update_reasons(self.reasons1)
292292

293293
if ma.get_actions_collection().count() != 0:
294-
print 'Test database not empty, abort!!'
294+
print('Test database not empty, abort!!')
295295
exit(123)
296296

297297
file_name = WorkflowInfo(self.request_base['workflows']).cache_filename('workflow_params')

workflowwebtools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
:author: Daniel Abercrombie <dabercro@mit.edu>
55
"""
66

7-
__version__ = '0.9.4'
7+
__version__ = '0.10.0'
88

99
__all__ = []

workflowwebtools/clusterworkflows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def get_clustered_group(workflow, clusterer, session=None):
208208
group = predictions.get(workflow)
209209

210210
if group is not None:
211-
for wkf, cluster in predictions.iteritems():
211+
for wkf, cluster in predictions.items():
212212
if cluster == group and wkf != workflow:
213213
output.append(wkf)
214214

workflowwebtools/errorutils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
import os
1111
import json
1212
import re
13-
import urlparse
13+
try:
14+
import urlparse
15+
except ImportError:
16+
import urllib.parse as urlparse # pylint: disable=import-error
1417

1518
import validators
1619
import cherrypy
@@ -82,12 +85,11 @@ def open_location(data_location):
8285
if raw is None:
8386
return raw
8487

85-
keys = raw.keys()
86-
if not (keys and isinstance(raw[keys[0]], list)):
88+
if not (raw and isinstance(raw[list(raw)[0]], list)):
8789
return raw
8890

8991
return errors_from_list([
90-
workflow for workflow, statuses in raw.iteritems()
92+
workflow for workflow, statuses in raw.items()
9193
if True in ['manual' in status for status in statuses]
9294
])
9395

workflowwebtools/globalerrors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def setup(self):
118118
if not self.data_location:
119119
current_workflows = self.return_workflows()
120120

121-
prep_ids = set([self.get_workflow(wf).get_prep_id() for wf in current_workflows])
121+
prep_ids = {self.get_workflow(wf).get_prep_id() for wf in current_workflows}
122122

123123
other_workflows = sum([self.get_prepid(prep_id).get_workflows() \
124124
for prep_id in prep_ids], [])
@@ -405,20 +405,20 @@ def group_errors(input_errors, grouping_function, **kwargs):
405405

406406
output = default_errors_format()
407407

408-
for subgroup, values in input_errors.iteritems():
408+
for subgroup, values in input_errors.items():
409409

410410
group = grouping_function(subgroup)
411411

412412
# We have three variables for everything, so we can write this by hand
413413
# Not ideal
414-
for row, row_val in values['errors'].iteritems():
415-
for col, numerrors in row_val.iteritems():
414+
for row, row_val in values['errors'].items():
415+
for col, numerrors in row_val.items():
416416
output[group]['errors'][row][col] += numerrors
417417

418418
output[group]['sub'][subgroup] = values
419419
output[group]['total'] += values['total']
420420

421-
for key, func in kwargs.iteritems():
421+
for key, func in kwargs.items():
422422
output[group][key] = func(group)
423423

424424
return output

0 commit comments

Comments
 (0)