Changeset 1693


Ignore:
Timestamp:
Aug 8, 2005, 5:12:43 PM (20 years ago)
Author:
ole
Message:

Comment about properties

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/wiki/issues.txt

    r1670 r1693  
    22OPEN ISSUES:
    33------------
     4
     5
     6Try to use properties with getters and setters
     7E.g. as in
     8class Contact(object):
     9
     10    def __init__(self, first_name=None, last_name=None,
     11                 display_name=None, email=None):
     12        self.first_name = first_name
     13        self.last_name = last_name
     14        self.display_name = display_name
     15        self.email = email
     16
     17    def print_info(self):
     18        print self.display_name, "<" + self.email + ">"           
     19
     20    def set_email(self, value):
     21        if '@' not in value:
     22            raise Exception("This doesn't look like an email address.")
     23        self._email = value
     24
     25    def get_email(self):
     26        return self._email
     27
     28    email = property(get_email, set_email)
     29----------------------------------------------------
     30
     31Issue:  File function (e.g. boundary) should give an error message (or set a defoult) if underlying netcdf has missing values. Make a unit test.
     32Maybe the underlying code should detect NaNs.
     33
    434
    535Issue: finaltime should be renamed 'duration'
Note: See TracChangeset for help on using the changeset viewer.