def delete_section_property(self, section_name, property_name):
        """
        Args:
            section_name (str): the name of the section, case insensitive
            property_name (str): the property name in the section
        """
        section_name = JSONSchema.format_section_name(section_name).lower()
        property_name = JSONSchema.format_property_name(property_name)
        rebuild_data = False
        if section_name in self._sections and \
            'properties' in self._sections[section_name] and \
                property_name in self._sections[section_name]['properties']:
            del self._sections[section_name]['properties'][property_name]
            rebuild_data = True

        if rebuild_data:
            contents = ''
            properties = self._sections[section_name]['properties']
            lastIndex = len(properties) - 1
            for i, (key, value) in enumerate(properties.items()):
                contents += '{}{}{}'.format(key,
                                            InputParser._PROPVALUE_SEPARATOR,
                                            value)
                if i < lastIndex:
                    contents += '\n'

            self._sections[section_name]['data'] = contents
    def check_if_substitution_key(self, section_name, property_names):
        result = [(property_name, False) for property_name in property_names]
        if not self.is_substitution_allowed():
            return result

        section_name = JSONSchema.format_section_name(section_name).lower()
        property_names = [
            JSONSchema.format_property_name(property_name)
            for property_name in property_names
        ]
        section_property_name = self.get_property_default_value(
            section_name, JSONSchema.NAME)
        section_property_name = self.get_section_property(
            section_name, JSONSchema.NAME, section_property_name)
        for key in self._substitutions.keys():
            key_items = key.split('.')
            if len(key_items) == 3 and \
                    key_items[0] == section_name and \
                    key_items[1] == section_property_name and \
                    key_items[2] in property_names:
                result[property_names.index(key_items[2])] = (key_items[2],
                                                              True)
                continue

        return result
    def set_section_property(self, section_name, property_name, value):
        section_name = JSONSchema.format_section_name(section_name).lower()
        property_name = JSONSchema.format_property_name(property_name)
        value = self._json_schema.check_property_value(section_name,
                                                       property_name, value)
        types = self.get_property_types(section_name, property_name)

        parser_temp = copy.deepcopy(self)
        InputParser._set_section_property(parser_temp._sections, section_name,
                                          property_name, value, types)
        msg = self._json_schema.validate_property(parser_temp.to_JSON(),
                                                  section_name, property_name)
        if msg is not None:
            raise AquaChemistryError("{}.{}: Value '{}': '{}'".format(
                section_name, property_name, value, msg))

        InputParser._set_section_property(self._sections, section_name,
                                          property_name, value, types)
        if property_name == JSONSchema.NAME:
            if InputParser.OPERATOR == section_name:
                self._update_operator_input_schema()
                # remove properties that are not valid for this section
                default_properties = self.get_section_default_properties(
                    section_name)
                if isinstance(default_properties, dict):
                    properties = self.get_section_properties(section_name)
                    for property_name in list(properties.keys()):
                        if property_name != JSONSchema.NAME and property_name not in default_properties:
                            self.delete_section_property(
                                section_name, property_name)
            elif JSONSchema.PROBLEM == section_name:
                self._update_algorithm_problem()
                self._update_operator_problem()
            elif InputParser.is_pluggable_section(section_name):
                self._json_schema.update_pluggable_input_schemas(self)
                # remove properties that are not valid for this section
                default_properties = self.get_section_default_properties(
                    section_name)
                if isinstance(default_properties, dict):
                    properties = self.get_section_properties(section_name)
                    for property_name in list(properties.keys()):
                        if property_name != JSONSchema.NAME and property_name not in default_properties:
                            self.delete_section_property(
                                section_name, property_name)

                if section_name == JSONSchema.ALGORITHM:
                    self._update_dependency_sections()
            elif value is not None:
                value = str(value).lower().strip()
                if len(value) > 0 and self.section_is_driver(value):
                    self._update_driver_input_schemas()
                    self._update_driver_sections()

        self._sections = self._order_sections(self._sections)
    def get_section_property(self, section_name, property_name, default_value=None):
        """Return a property by name.
        Args:
            section_name (str): the name of the section, case insensitive
            property_name (str): the property name in the section
            default_value : default value in case it is not found
        Returns:
            Value: The property value
        """
        section_name = JSONSchema.format_section_name(section_name).lower()
        property_name = JSONSchema.format_property_name(property_name)
        if section_name in self._sections:
            section = self._sections[section_name]
            if 'properties' in section and property_name in section['properties']:
                return section['properties'][property_name]

        return default_value
    def _set_section_property(sections, section_name, property_name, value,
                              types):
        """
        Args:
            section_name (str): the name of the section, case insensitive
            property_name (str): the property name in the section
            value : property value
            types : schema valid types
        """
        section_name = JSONSchema.format_section_name(section_name).lower()
        property_name = JSONSchema.format_property_name(property_name)
        value = JSONSchema.get_value(value, types)

        if section_name not in sections:
            sections[section_name] = OrderedDict([(JSONSchema.NAME,
                                                   section_name)])

        if 'properties' not in sections[section_name]:
            sections[section_name]['properties'] = OrderedDict()

        # name should come first
        if JSONSchema.NAME == property_name and property_name not in sections[
                section_name]['properties']:
            new_dict = OrderedDict([(property_name, value)])
            new_dict.update(sections[section_name]['properties'])
            sections[section_name]['properties'] = new_dict
        else:
            sections[section_name]['properties'][property_name] = value

        # rebuild data
        contents = ''
        properties = sections[section_name]['properties']
        lastIndex = len(properties) - 1
        for i, (key, value) in enumerate(properties.items()):
            contents += '{}{}{}'.format(key, InputParser._PROPVALUE_SEPARATOR,
                                        value)
            if i < lastIndex:
                contents += '\n'

        sections[section_name]['data'] = contents