<commit_before>
from ThermoPhase import ThermoPhase
from exceptions import CanteraError
import Numeric
import _cantera

class SurfacePhase(ThermoPhase):
    """A class for surface phases."""

    def __init__(self, xml_phase=None, index=-1):
        ThermoPhase.__init__(self, xml_phase=xml_phase, index=index)

    def setSiteDensity(self, n0):
        _cantera.surf_setsitedensity(self._phase_id, n0)

    def siteDensity(self):
        return _cantera.surf_sitedensity(self._phase_id)
    
    def setCoverages(self, theta):
        nt = len(theta)
        if nt == self.nSpecies():
            _cantera.surf_setcoverages(self._phase_id,
                                     Numeric.asarray(theta,'d'))
        else:
            raise CanteraError('expected '+`self.nSpecies()`+
                               ' coverage values, but got '+`nt`)

    def coverages(self):
        return _cantera.surf_getcoverages(self._phase_id)

    def setConcentrations(self, theta):
        _cantera.surf_setconcentrations(self._phase_id, theta)

    def concentrations(self):
        return _cantera.surf_getconcentrations(self._phase_id)


    
<commit_msg>minor cleanup<commit_after>
from ThermoPhase import ThermoPhase
from exceptions import CanteraError
import Numeric
import _cantera

class SurfacePhase(ThermoPhase):
    """A class for surface phases."""

    def __init__(self, xml_phase=None, index=-1):
        ThermoPhase.__init__(self, xml_phase=xml_phase, index=index)

    def setSiteDensity(self, n0):
        """Set the site density."""
        _cantera.surf_setsitedensity(self._phase_id, n0)

    def siteDensity(self):
        """Site density [kmol/m2]"""
        return _cantera.surf_sitedensity(self._phase_id)
    
    def setCoverages(self, theta):
        """Set the surface coverages to the values in array 'theta'."""
        nt = len(theta)
        if nt == self.nSpecies():
            _cantera.surf_setcoverages(self._phase_id,
                                     Numeric.asarray(theta,'d'))
        else:
            raise CanteraError('expected '+`self.nSpecies()`+
                               ' coverage values, but got '+`nt`)

    def coverages(self):
        """Return the array of surface coverages."""
        return _cantera.surf_getcoverages(self._phase_id)

    def setConcentrations(self, conc):
        """Set the surface concentrations to the values in
        array 'conc'."""
        _cantera.surf_setconcentrations(self._phase_id, conc)

    def concentrations(self):
        """Return the array of surface concentrations [kmol/m2]."""
        return _cantera.surf_getconcentrations(self._phase_id)


    

{'fraction_non_alphanumeric': 0.10166288737717309, 'fraction_numerical': 0.0030234315948601664, 'mean_word_length': 2.7124824684431976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5985794', 'n_tokens_mistral': 829, 'n_tokens_neox': 771, 'n_words': 177}