modelutil
: Future WorkA list of additional work to do on this package at some point:
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.unittest
test suites:
Field
objects:
__delitem__
and
__getitem__
methods on slices.a[3:6]
= b[2:5]
where a
and b
are both
Field
objects.*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
). replace_key_meta
method for Field
objects which replaces key metadata
(id
, long_name
, units
)
with one line.field
function or Field
method
that translates from MV
to Field
and
back again.add_all
method that
adds all the Field
s from one State
to another State
.StateSet
objects together.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
.
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?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 Field
s in the State
variable.
This, I think, should be a separate method from
is_conformable
.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?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?