Skip to content

Commit

Permalink
Fixed minor issues for code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
markmcdowall committed Aug 23, 2017
1 parent c250ad6 commit e66506c
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions dummy_pycompss.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
#
# Copyright 2002-2015 Barcelona Supercomputing Center (www.bsc.es)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#
# This code is based on the dummy functions from the pyCOMPSS module so that the
# functions can be run outside of the COMPS environment for testing purposes.
#
"""
.. Copyright 2002-2015 Barcelona Supercomputing Center (www.bsc.es)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This code is based on the dummy functions from the pyCOMPSS module so that the
functions can be run outside of the COMPS environment for testing purposes.
"""

from functools import wraps

Expand All @@ -29,7 +27,7 @@ class constraint(object):
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs

def __call__(self, f):
@wraps(f)
def wrapped_f(*args, **kwargs):
Expand All @@ -41,22 +39,22 @@ class task(object):
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs

def __call__(self, f):
@wraps(f)
def wrapped_f(*args, **kwargs):
return f(*args, **kwargs)
return wrapped_f

# Numbers match both C and Java enums
class Direction:
class Direction(object):
IN = 0
OUT = 1
INOUT = 2


# Numbers match both C and Java enums
class Type:
class Type(object):
FILE = 0
BOOLEAN = 1
STRING = 3
Expand All @@ -67,7 +65,7 @@ class Type:
# COMPLEX = 8


class Parameter:
class Parameter(object):
@wraps(object)
def __init__(self, p_type=None, p_direction=Direction.IN):
self.type = p_type
Expand Down

0 comments on commit e66506c

Please sign in to comment.