From 3817542fb43d28440871c979a69c4cf3317b4b17 Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Wed, 15 Dec 2004 16:36:44 +0000 Subject: [PATCH] *** empty log message *** --- Cantera/python/Cantera/__init__.py | 9 +------- .../python/Cantera/{Mixture.py => mixture.py} | 21 ++++++++++++------- Cantera/python/Cantera/num.py | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) rename Cantera/python/Cantera/{Mixture.py => mixture.py} (95%) diff --git a/Cantera/python/Cantera/__init__.py b/Cantera/python/Cantera/__init__.py index 4e3ca59d8..1ff7ba54a 100755 --- a/Cantera/python/Cantera/__init__.py +++ b/Cantera/python/Cantera/__init__.py @@ -11,14 +11,7 @@ from gases import * from set import set from importFromFile import * -ctdata = '' -try: - import cantera_loc - ctdata = cantera_loc.CANTERA_DATA -except: - pass - -from Mixture import Mixture +from mixture import Mixture def writeCSV(f, list): """Write list items to file 'f' in comma-separated-value format.""" diff --git a/Cantera/python/Cantera/Mixture.py b/Cantera/python/Cantera/mixture.py similarity index 95% rename from Cantera/python/Cantera/Mixture.py rename to Cantera/python/Cantera/mixture.py index d311e497d..65b672e95 100644 --- a/Cantera/python/Cantera/Mixture.py +++ b/Cantera/python/Cantera/mixture.py @@ -1,3 +1,7 @@ +""" +Multiphase mixtures. +""" + import _cantera import types from Cantera.num import zeros, array, asarray @@ -5,7 +9,7 @@ from exceptions import CanteraError class Mixture: """ - Multiphase mixtures. Class Mixture represents + xxx Multiphase mixtures. Class Mixture represents mixtures of one or more phases of matter. To construct a mixture, supply a list of phases to the constructor, each paired with the number of moles for that phase: @@ -36,6 +40,7 @@ class Mixture: """ def __init__(self, phases=[]): + """ init """ self.__mixid = _cantera.mix_new() self._spnames = [] self._phases = [] @@ -56,13 +61,13 @@ class Mixture: """Delete the Mixture instance. The phase objects are not deleted.""" _cantera.mix_del(self.__mixid) - def __repr__(self): - s = '' - for p in range(len(self._phases)): - s += '\n******************* Phase '+self._phases[p].name()+' ******************************\n' - s += '\n Moles: '+`self.phaseMoles(p)`+'\n' - s += self._phases[p].__repr__()+'\n\n' - return s +## def __repr__(self): +## s = '' +## for p in range(len(self._phases)): +## s += '\n******************* Phase '+self._phases[p].name()+' ******************************\n' +## s += '\n Moles: '+`self.phaseMoles(p)`+'\n' +## s += self._phases[p].__repr__()+'\n\n' +## return s def _addPhase(self, phase = None, moles = 0.0): """Add a phase to the mixture.""" diff --git a/Cantera/python/Cantera/num.py b/Cantera/python/Cantera/num.py index 9ac852793..de53d9de0 100644 --- a/Cantera/python/Cantera/num.py +++ b/Cantera/python/Cantera/num.py @@ -26,5 +26,5 @@ zeros = nummodule.zeros array = nummodule.array asarray = nummodule.asarray transpose = nummodule.transpose - +ravel = nummodule.ravel