diff --git a/kadmos/cmdows/cmdows.py b/kadmos/cmdows/cmdows.py index cb5208cef4f57755861cb9048564c839a1e53368..fb846d58d7e53e41bb5b26cecf01e158f47acc60 100644 --- a/kadmos/cmdows/cmdows.py +++ b/kadmos/cmdows/cmdows.py @@ -398,7 +398,7 @@ class CMDOWS(object): self.add_element_to_element_of_uid(dc_uid, outputs_element, 'designCompetence', 'outputs') return - def add_dc_general_info(self, dc_uid, description, dc_instance, status=None, creation_date=None, owner_uid=None, creator_uid=None, + def add_dc_general_info(self, dc_uid, description, status=None, creation_date=None, owner_uid=None, creator_uid=None, operator_uid=None, model_definition=None): """Method to add a general info element to a dc branch.""" # if instance is higher than 1 the metadata should not be added. diff --git a/kadmos/graph/graph_kadmos.py b/kadmos/graph/graph_kadmos.py index 6b90596674f100ca0ab5e4b5d9b5a3eaf4879ce3..5f76fbbbff47d2d4d7fd9d8b2a3ebe1449362714 100644 --- a/kadmos/graph/graph_kadmos.py +++ b/kadmos/graph/graph_kadmos.py @@ -3439,9 +3439,8 @@ class KadmosGraph(nx.DiGraph, EquationMixin, VistomsMixin): """ # Handle the fact that the *args could also be a list or tuple directly - if len(args) == 2 and isinstance(args[0], basestring) and (isinstance(args[1], tuple) - or isinstance(args[1], list)): - args = [args[0]] + [arg for arg in args[1]] + if len(args) == 1 and isinstance(args[0], (tuple, list)): + args = args[0] # Input assertions assert len(args) > 1, 'At least two arguments are required for a function mode merge.' @@ -3449,24 +3448,26 @@ class KadmosGraph(nx.DiGraph, EquationMixin, VistomsMixin): assert isinstance(arg, basestring) # Create function-mode strings and check them function_nodes = list() - if 'suffices' in kwargs: - suffix_strs = kwargs['suffices'] + if 'ignore_function_id' in kwargs: + assert isinstance(kwargs['ignore_function_id'], bool), 'ignore_function_id should be of type Boolean.' + ignore_function_id = kwargs['ignore_function_id'] else: - suffix_strs = ['']*len(args) + ignore_function_id = False function_name_prev = None for idx, arg in enumerate(args): - node_name = arg + suffix_strs[idx] + node_name = arg function_name = self.nodes[node_name]['name'] function_nodes.append(node_name) self.assert_node_exists(node_name) self.assert_node_attribute_and_value(node_name, 'category', 'function') - if function_name_prev is not None: - assert function_name == function_name_prev, 'Nodes {} and {} do not have the same function ' \ - 'names.'.format(node_name, node_name_prev) - function_name_prev = function_name - node_name_prev = node_name - else: - function_name_prev = function_name + if not ignore_function_id: + if function_name_prev is not None: + assert function_name == function_name_prev, 'Nodes {} and {} do not have the same function ' \ + 'names.'.format(node_name, node_name_prev) + function_name_prev = function_name + node_name_prev = node_name + else: + function_name_prev = function_name # Check or create new node label if 'new_label' in kwargs: assert isinstance(kwargs['new_label'], basestring) diff --git a/setup.py b/setup.py index 5ac4d899bdaafe27de5960b9eca70dfdf42debf3..419efcf2842f7bbe26a558c7cd2ef55a1d5d579b 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages -version = '0.7.7' +version = '0.8.0' def readme(): @@ -11,7 +11,7 @@ def readme(): setup(name='kadmos', version=version, - description='Knowledge- and graph-based Agile Design with Multidisciplinary Optimization System', + description='Knowledge- and graph-based Agile Design for Multidisciplinary Optimization System', long_description=readme(), classifiers=[ 'Development Status :: 4 - Beta',