modelutil: Future Work

A list of additional work to do on this package at some point:

  • Add MPI routines. Add meat to the wrap methods. When writing wrap for Field objects, account for cases where the data is a scalar or 1-element array and make sure that both masked/unmasked as well as Numpy and numarray arrays are all handled.
  • Additional tests to add to unittest test suites:
    • For Field objects:
      • Container methods.
      • Case with a stride.
      • The __delitem__ and __getitem__ methods on slices.
      • The case with a[3:6] = b[2:5] where a and b are both Field objects.
      • Additional mathematical module functions (i.e. instances of *aryOperations and *aryFunctions).
    • State and StateSet methods.
    • GenericModel methods (especially add_tend1). Currently only a simple test of step1 is done (though the seaice package itself provides a decent test of GenericModel).
  • Create a replace_key_meta method for Field objects which replaces key metadata (id, long_name, units) with one line.
  • Create a field function or Field method that translates from MV to Field and back again.
  • Create an add_all method that adds all the Fields from one State to another State.
  • Write a method or function to combine two or more StateSet objects together.
  • Add to the State and StateSet __setitem__ (or whatever the method is that you use for setting dictionary entries) that you check that the dictionary key is the same as id.
  • It's easy to copy metadata from one Field to another, forget to change the id, and add the new Field to a State container holding the original Field, overwriting the previous value. I've documented this in the manual in two places (including the FAQ); is there any way around this problem? Maybe create a "locked" metadata attribute which allows the variable to only be deleted from a State object but not overwritten?
  • Write a check method that a State variable contains the axes for the Field variables also found in the State. Also check the number of elements along each axis of a Field object is correct, corresponding to the axis Fields in the State variable. This, I think, should be a separate method from is_conformable.
  • In the FAQ page, where there is a discussion of references to data, discuss how this is done in a model (i.e. how the original StateSet is altered).
  • Discuss in manual that the current setup for GenericModel assumes that a model grid doesn't change shape during runtime, and that tendencies follow that same model grid. However, with python you can easily have the grid change while the program is running, so it would be nice (in theory) to have this capability. I have yet to do the hard thinking of the protocol for that. Should there be a separate method different from tend1 where wholesale deletion/insertion of model variables can occur, one which is not summed up (but rather just included into the "tp1" State object) in the step1 method?
  • Keep the max_shape method in State or delete it? If I do keep it, should I add ignore and include keywords, as in the is_conformable method?

Return to modelutil Reference Manual Index.
Return to modelutil Home Page.

Valid HTML 4.01! Valid CSS! Updated: January 12, 2005 by Johnny Lin <email address>. License.