pyne/pyne — pull request #100 by elliottbiondo (2013-01-09 23:51:05+00:00)
Title: Issue #78 and #98

This covers the vast majority of #78 and also #98.

**read_mcnp_inp(filename) + mat_from_mcnp(filename, mat_line, densities)**
These functions read MCNP inp files and create a list of Material/MultiMaterial objects. The function read_mcnp_inp (the user facing function) identifies the lines that materials appear on and their corresponding densities. The function mat_from_mcnp does the actual parsing. The material densities are taken from cell cards. The compositions are taken from the material cards. Atom/mass densities and atom/mass fractions are both supported. If a material has multiple densities, a MultiMaterial is created and the user is alerted via stdout. Comments denoted by c, C, and $ are all supported.

Metadata is also added when available and stored in material.attrs. The material number and isotope table identifiers (if present) are taken from the material card. Any or all of the following is parsed from the material if available: name of the material, source, comments. They are supplied by the user in the manner:
```
C source: internet, person, etc.
C name: stainless steel, water, etc.
C comments: any additional information
C more comments
m3 1001.025c 0.45 1002.035c 0.05 ... etc.
```

This metadata can be written in any arbitrary order and comments can be an arbitrary number of lines. These functions are tested by test_read_mcnp.

**material.write_mcnp_mass_fracs(self, filename)**
This method appends an MCNP material definition, with attributes, to the specified file. The format is identical to that of read_mcnp_inp. The 80 characters per line limit is enforced for "comments". Density is also printed as a comment. This method is tested by test_write_mcnp_mass_fracs.

**material.write_alara(filename)**
This function has the same features of write_mcnp_mass_fracs, but for ALARA format. Density is not printed as a comment, as it is specified explicitly in ALARA format. This function is tested by test_write_alara.

**material.mass_density_from_atom_density(self, num_den)**
This method uses material.comp and a supplied atom density to return a mass density, which can then be assigned to the material. This method was created in order to calculate mass density for read_mcnp_inp in the case when an atom density is specified in the cell card. This method is tested by test_mass_density_from_atom_density.

In addition I have written a test_natural_elements, to make sure natural elements are behaving properly in accordance with #98.

It should be noted that the 2 write functions do not support MultiMaterials because I have not decided on the best behavior (or if they even should at all).