Class or Dictionary?

Martin De Kauwe mdekauwe at gmail.com
Sat Feb 12 01:24:26 CET 2011


Sorry I should have added a little more example to help with clarity?
So after reading the .INI file I then initialise the objects I
described e.g.

 def initialise_simulation(self):
    """Set the initial conditions.

    using values from the .ini value set the C and N pools
    and other misc states.

    """
    for attr, value in self.initial_state.__dict__.iteritems():
        #print attr, value
        setattr(self.pools, attr, value)

    # maybe need M2_AS_HA here?
    self.pools.lai = self.params.sla * self.params.cfrac_dry_mass
    self.fluxes.nuptake = 0.0



More information about the Python-list mailing list