clawpack/pyclaw — pull request #484 by ketch (2014-12-17 10:44:08+00:00)
Title: Many improvements to Grid and Dimension.

Some of the things in this PR are demonstrated in http://nbviewer.ipython.org/gist/ketch/1a7888d1fcc37209b260,
which is work in progress.

This PR implements the following changes:

### Grid
- add new print function for Grid with useful information
- add grid.plot() method for 2D grids
- remove `grid.num_ghost` since ghost cell information belongs to solver
- `mapc2p` does not take Patch as an argument (now only takes 1 argument, the list of coordinate arrays)
- clear cached values when a Grid or Dimension property is changed (so everything gets updated based on new property)

#### Coordinate functions
- add methods `grid.p_centers_with_ghost` and `grid.p_edges_with_ghost` to get physical edge locations.
- add methods `grid.p_center` and `grid.c_center` to retrieve coordinates of a single cell center
- make `grid.compute_*` methods private (by adding an initial underscore) since they should only be called internally.
- correctly call `grid._compute*` (don't need to explicitly pass self)
- simplify `grid._compute_p_centers` and `grid._compute_p_edges` (1D does not need to be a special case).
- simplify `grid._compute_c_centers_with_ghost`
- make cached centers and edges exist separately for each Grid
- don't cache dimension or grid coordinate arrays with ghosts (since num_ghost is not a grid property)

#### Docstrings
- expand grid class docstring
- fix minor typos in docstrings

### Dimension
- clear cached values when a Dimension property is changed (so everything gets updated based on new property)
- remove `dimension.num_ghost`
- make `_centers` and `_edges` exist separately for each Dimension
- pass num_ghost as argument to `dimension.*_with_ghost()`