#1001 Merged at 0dd4980
  1. John ZuHone

This PR implements a number of changes to make GDF writing more flexible.

  1. Write a covering_grid to a GDF file. Gives the option of splitting the data into multiple subgrids before the write.
  2. Allow a GDF file to be overwritten by setting clobber=True. The default value is False.
  3. Attempting to overwrite a file with clobber=False now raises the YTGDFAlreadyExists exception.

This PR also fixes a couple of bugs in covering grids and GDF writing that I found in the process.

This is labeled WIP in case we decide to use this PR as an opportunity to make non-CGS units possible in GDF files.

UPDATE 1: Fixing some bugs I've found along the way.

UPDATE 2: I've made sure that we're backwards-compatible with earlier files, though @xarthisius should check. Fields with aliases convert to cgs correctly. Also made it possible when writing from a covering_grid to change the units.

UPDATE 3: I've changed the name and comment in the example, and added "velocity_unit" and "magnetic_unit" to the list of units.

By default, the dataset_units will be inherited from the parent dataset, but these can be overridden.

I've checked that regardless of what the dataset_units are, that the units of the fields in the dataset are set up correctly on load.

Comments (25)

  1. John ZuHone author

    @xarthisius I am starting to make some fairly substantial changes here, could you have a look at them?

    1. Kacper Kowalik

      Sorry, I've missed your comment in all the recent bb's notification. I'll respond to mail on the list.

  2. John ZuHone author

    Something goofy is happening with this PR... It's not showing my latest commits on this page even though it is on the update page.

    1. Nathan Goldbaum

      @xarthisius mentioned there were latency issues with bitbucket's API today. You may want to raise an issue on their issue tracker or file a support ticket.

  3. John ZuHone author

    Pending acceptance from @xarthisius (and clearing objections from anyone else), this is ready.

  4. John ZuHone author

    This is ready to merge--the test failures previously were caused by the fact that magnetic units were not set up on stream datasets.