[yt-svn] commit/yt: 5 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Jan 3 21:08:30 PST 2015


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/1b1ac294cd6b/
Changeset:   1b1ac294cd6b
Branch:      yt
User:        xarthisius
Date:        2014-12-09 04:20:47+00:00
Summary:     Fix typo in PixelizedProjectionValuesTest initializer
Affected #:  1 file

diff -r c49dbb18e2f0cbc1357be61e77a1757bf4aa47d2 -r 1b1ac294cd6bcf3410e7f63b0cce11c998731fcd yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -491,7 +491,7 @@
         super(PixelizedProjectionValuesTest, self).__init__(ds_fn)
         self.axis = axis
         self.field = field
-        self.weight_field = field
+        self.weight_field = weight_field
         self.obj_type = obj_type
 
     def run(self):


https://bitbucket.org/yt_analysis/yt/commits/e01cacbc0aa0/
Changeset:   e01cacbc0aa0
Branch:      yt
User:        xarthisius
Date:        2014-12-09 04:34:25+00:00
Summary:     Don't call frb with key None
Affected #:  1 file

diff -r 1b1ac294cd6bcf3410e7f63b0cce11c998731fcd -r e01cacbc0aa0b799682b4c3a86562cb71904e933 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -504,7 +504,8 @@
                               data_source = obj)
         frb = proj.to_frb((1.0, 'unitary'), 256)
         frb[self.field]
-        frb[self.weight_field]
+        if self.weight_field is not None:
+            frb[self.weight_field]
         d = frb.data
         for f in proj.field_data:
             # Sometimes f will be a tuple.


https://bitbucket.org/yt_analysis/yt/commits/315c1e0be573/
Changeset:   315c1e0be573
Branch:      yt
User:        xarthisius
Date:        2014-12-10 03:56:15+00:00
Summary:     merging
Affected #:  20 files

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 doc/helper_scripts/show_fields.py
--- a/doc/helper_scripts/show_fields.py
+++ b/doc/helper_scripts/show_fields.py
@@ -271,5 +271,6 @@
                                   dp=f.dname, dw=len_disp)
                 
             print div
+            print ""
 
 print footer

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 doc/source/analyzing/analysis_modules/radmc3d_export.rst
--- a/doc/source/analyzing/analysis_modules/radmc3d_export.rst
+++ b/doc/source/analyzing/analysis_modules/radmc3d_export.rst
@@ -6,17 +6,11 @@
 .. sectionauthor:: Andrew Myers <atmyers2 at gmail.com>
 .. versionadded:: 2.6
 
-.. note:: 
-
-    As of :code:`yt-3.0`, the radial column density analysis module is not
-    currently functional.  This functionality is still available in
-    :code:`yt-2.x`.  If you would like to use these features in :code:`yt-3.x`,
-    help is needed to port them over.  Contact the yt-users mailing list if you
-    are interested in doing this.
-
 `RADMC-3D
-<http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/>`_ is a three-dimensional Monte-Carlo radiative transfer code
-that is capable of handling both line and continuum emission. The :class:`~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DWriter`
+<http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/>`_ is a 
+three-dimensional Monte-Carlo radiative transfer code that is capable of 
+handling both line and continuum emission. The 
+:class:`~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DWriter`
 class saves AMR data to disk in an ACSII format that RADMC-3D can read. 
 In principle, this allows one to use RADMC-3D to make synthetic observations 
 from any simulation data format that yt recognizes.
@@ -31,74 +25,77 @@
 
 .. code-block:: python
 
-    from yt.mods import *
-    from yt.analysis_modules.radmc3d_export.api import *
+    import yt
+    from yt.analysis_modules.radmc3d_export.api import RadMC3DWriter
 
-Then, define a field that calculates the dust density in each cell. Here, we assume
-a constant dust-to-gas mass ratio of 0.01:
+Then, define a field that calculates the dust density in each cell. Here, we 
+assume a constant dust-to-gas mass ratio of 0.01:
 
 .. code-block:: python
 
     dust_to_gas = 0.01
     def _DustDensity(field, data):
-        return dust_to_gas*data["density"]
-    add_field("DustDensity", function=_DustDensity)
+        return dust_to_gas * data["density"]
+    yt.add_field(("gas", "dust_density"), function=_DustDensity, units="g/cm**3")
 
 Now load up a dataset and call the
 :class:`~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DWriter`:
 
 .. code-block:: python
 
-    ds = load("galaxy0030/galaxy0030")
+    ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
     writer = RadMC3DWriter(ds)
     
     writer.write_amr_grid()
-    writer.write_dust_file("DustDensity", "dust_density.inp")
+    writer.write_dust_file(("gas", "dust_density"), "dust_density.inp")
 
-The method write_amr_grid() creates an "amr_grid.inp" file that tells RADMC-3D how
-to interpret the rest of the data, while "dust_density.inp" contains the actual data field. 
+The method write_amr_grid() creates an "amr_grid.inp" file that tells RADMC-3D 
+how to interpret the rest of the data, while "dust_density.inp" contains the 
+actual data field. 
 
-We can also supply temperature information. The following code creates a "DustTemperature"
-field that is constant at 10 K, and saves it into a file called "dust_temperature.inp"
+We can also supply temperature information. The following code creates a 
+"dust_temperature" field that is constant at 10 K, and saves it into a file 
+called "dust_temperature.inp"
 
 .. code-block:: python
 
     def _DustTemperature(field, data):
-        return 10.0*data["Ones"]
-    add_field("DustTemperature", function=_DustTemperature)
+        return 0. * data["temperature"] + data.ds.quan(10, 'K')
+    yt.add_field(("gas", "dust_temperature"), function=_DustTemperature, units="K")
     
-    writer.write_dust_file("DustTemperature", "dust_temperature.inp")
+    writer.write_dust_file(("gas", "dust_temperature"), "dust_temperature.inp")
 
-With the "amr_grid.inp", "dust_density.inp", and "dust_temperature.inp" files, RADMC-3D
-has everything it needs to compute the thermal dust emission (you may also have to include
-the location and spectra of any sources, which currently must be done manually). 
-The result is something that looks like this:
+With the "amr_grid.inp", "dust_density.inp", and "dust_temperature.inp" files, 
+RADMC-3D has everything it needs to compute the thermal dust emission (you may 
+also have to include the location and spectra of any sources, which currently 
+must be done manually).  The result is something that looks like this:
 
 .. image:: _images/31micron.png
 
 Line Emission
 -------------
 
-The file format required for line emission is slightly different. The following script will generate 
-two files, one called "numderdens_co.inp", which contains the number density of CO molecules
-for every cell in the index, and another called "gas-velocity.inp", which is useful if you want 
-to include doppler broadening.
+The file format required for line emission is slightly different. The 
+following script will generate two files, one called "numderdens_co.inp", 
+which contains the number density of CO molecules for every cell in the index, 
+and another called "gas-velocity.inp", which is useful if you want to include 
+doppler broadening.
 
 .. code-block:: python
 
-    from yt.mods import *
-    from yt.analysis_modules.radmc3d_export.api import *
+    import yt
+    from yt.analysis_modules.radmc3d_export.api import RadMC3DWriter
 
     x_co = 1.0e-4
     mu_h = 2.34e-24
     def _NumberDensityCO(field, data):
         return (x_co/mu_h)*data["density"]
-    add_field("NumberDensityCO", function=_NumberDensityCO)
+    yt.add_field(("gas", "number_density_CO"), function=_NumberDensityCO, units="cm**-3")
     
-    ds = load("galaxy0030/galaxy0030")
+    ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")
     writer = RadMC3DWriter(ds)
     
     writer.write_amr_grid()
-    writer.write_line_file("NumberDensityCO", "numberdens_co.inp")
+    writer.write_line_file(("gas", "number_density_CO"), "numberdens_co.inp")
     velocity_fields = ["velocity_x", "velocity_y", "velocity_z"]
     writer.write_line_file(velocity_fields, "gas_velocity.inp") 

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 doc/source/cookbook/Halo_Analysis.ipynb
--- a/doc/source/cookbook/Halo_Analysis.ipynb
+++ b/doc/source/cookbook/Halo_Analysis.ipynb
@@ -1,7 +1,7 @@
 {
  "metadata": {
   "name": "",
-  "signature": "sha256:083fded18194cc4b6d9ebf6d04e24a7f1d90cf57831ff0155e99868c0ace73b7"
+  "signature": "sha256:cb4a8114d92def67d5f948ec8326e8af0b20a5340dc8fd54d8d583e9c646886e"
  },
  "nbformat": 3,
  "nbformat_minor": 0,
@@ -226,7 +226,7 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "hc.add_callback('profile', 'virial_radius', [('gas','temperature')],\n",
+      "hc.add_callback('profile', 'virial_radius_fraction', [('gas','temperature')],\n",
       "                storage='virial_profiles',\n",
       "                weight_field='cell_mass', \n",
       "                accumulation=False, output_dir='profiles')\n"
@@ -368,7 +368,7 @@
      "input": [
       "halo = hc_reloaded.halo_list[0]\n",
       "\n",
-      "radius = halo.virial_profiles['virial_radius']\n",
+      "radius = halo.virial_profiles[u\"('index', 'virial_radius_fraction')\"]\n",
       "temperature = halo.virial_profiles[u\"('gas', 'temperature')\"]\n",
       "\n",
       "# Remove output files, that are no longer needed\n",

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 doc/source/cookbook/index.rst
--- a/doc/source/cookbook/index.rst
+++ b/doc/source/cookbook/index.rst
@@ -41,6 +41,7 @@
    custom_colorbar_tickmarks
    embedded_javascript_animation
    embedded_webm_animation
+   gadget_notebook
    ../analyzing/analysis_modules/sunyaev_zeldovich
    fits_radio_cubes
    fits_xray_images

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 doc/source/examining/loading_data.rst
--- a/doc/source/examining/loading_data.rst
+++ b/doc/source/examining/loading_data.rst
@@ -573,7 +573,9 @@
 yt has support for reading Gadget data in both raw binary and HDF5 formats.  It
 is able to access the particles as it would any other particle dataset, and it
 can apply smoothing kernels to the data to produce both quantitative analysis
-and visualization. See :ref:`loading-sph-data` for more details.
+and visualization. See :ref:`loading-sph-data` for more details and
+:ref:`gadget-notebook` for a detailed example of loading, analyzing, and
+visualizing a Gadget dataset.
 
 Gadget data in HDF5 format can be loaded with the ``load`` command:
 
@@ -1026,8 +1028,6 @@
 onto the grid, you can also effectively mimic what your data would look like at
 lower resolution.
 
-See :ref:`gadget-notebook` for an example.
-
 .. _loading-tipsy-data:
 
 Tipsy Data

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 doc/source/reference/field_list.rst
--- a/doc/source/reference/field_list.rst
+++ b/doc/source/reference/field_list.rst
@@ -4121,6 +4121,7 @@
 ('io', 'particle_metallicity1')                                                                                                                                           1              
 ('io', 'particle_metallicity2')                                                                                                                                           1              
 ================================  ========================================================================================================  ====================  =========  ============
+
 .. _ARTIO_specific_fields:
 
 ARTIO-Specific Fields
@@ -4155,6 +4156,7 @@
 ('io', 'METALLICITY_SNIa')                                                                                                                    ``metallicity_snia``             1              
 ('io', 'METALLICITY_SNII')                                                                                                                    ``metallicity_snii``             1              
 ==================================  ========================================================================================================  =======================  =========  ============
+
 .. _Athena_specific_fields:
 
 Athena-Specific Fields
@@ -4168,6 +4170,7 @@
 ('athena', 'cell_centered_B_y')  :math:`\mathrm{\rm{code_magnetic}}`                                     ``magnetic_field_y``          0              
 ('athena', 'cell_centered_B_z')  :math:`\mathrm{\rm{code_magnetic}}`                                     ``magnetic_field_z``          0              
 ===============================  ======================================================================  ====================  =========  ============
+
 .. _Boxlib_specific_fields:
 
 Boxlib-Specific Fields
@@ -4202,6 +4205,7 @@
 ('io', 'particle_id')                                                                                                            ``particle_index``          1              
 ('io', 'particle_mdot')        :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}`                                                                    1              
 =============================  ================================================================================================  ==================  =========  ============
+
 .. _Castro_specific_fields:
 
 Castro-Specific Fields
@@ -4238,6 +4242,7 @@
 ('boxlib', 'maggrav')     :math:`\mathrm{\frac{\rm{cm}}{\rm{s}^{2}}}`                                                0  :math:`|\mathbf{g}|`                 
 ('boxlib', 'phiGrav')     :math:`\mathrm{\rm{erg} / \rm{g}}`                                                         0  :math:`\Phi`                         
 ========================  ========================================================  =======================  =========  =====================================
+
 .. _Maestro_specific_fields:
 
 Maestro-Specific Fields
@@ -4289,6 +4294,7 @@
 ('boxlib', 'w0_y')             :math:`\mathrm{\rm{cm} / \rm{s}}`                                                       0  :math:`(w_0)_y`                                
 ('boxlib', 'w0_z')             :math:`\mathrm{\rm{cm} / \rm{s}}`                                                       0  :math:`(w_0)_z`                                
 =============================  =====================================================  =======================  =========  ===============================================
+
 .. _Orion_specific_fields:
 
 Orion-Specific Fields
@@ -4323,6 +4329,7 @@
 ('io', 'particle_id')                                                                                                            ``particle_index``          1              
 ('io', 'particle_mdot')        :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}`                                                                    1              
 =============================  ================================================================================================  ==================  =========  ============
+
 .. _ChomboPIC_specific_fields:
 
 ChomboPIC-Specific Fields
@@ -4338,6 +4345,7 @@
 ('io', 'particle_position_x')        :math:`\mathrm{\rm{code}~\rm{length}}`                                                                           1              
 ('io', 'particle_velocity_x')        :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                                     1              
 ===================================  ==========================================================================  ===========================  =========  ============
+
 .. _Orion2_specific_fields:
 
 Orion2-Specific Fields
@@ -4356,6 +4364,7 @@
 ('io', 'particle_velocity_x')        :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                                     1              
 ('io', 'particle_velocity_y')        :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                                     1              
 ===================================  ==========================================================================  ===========================  =========  ============
+
 .. _Pluto_specific_fields:
 
 Pluto-Specific Fields
@@ -4377,6 +4386,7 @@
 ('io', 'particle_velocity_y')        :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                                     1              
 ('io', 'particle_velocity_z')        :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                                     1              
 ===================================  ==========================================================================  ===========================  =========  ============
+
 .. _Eagle_specific_fields:
 
 Eagle-Specific Fields
@@ -4413,6 +4423,7 @@
 ('io', 'Metallicity_09')                                                                              ``Ca_fraction``                1              
 ('io', 'Metallicity_10')                                                                              ``Fe_fraction``                1              
 ============================  ======================================================================  =====================  =========  ============
+
 .. _Enzo_specific_fields:
 
 Enzo-Specific Fields
@@ -4464,6 +4475,7 @@
 ('io', 'identifier')                                                                                      ``particle_index``                    1              
 ('io', 'level')                                                                                                                                 1              
 ================================  ======================================================================  ============================  =========  ============
+
 .. _FLASH_specific_fields:
 
 FLASH-Specific Fields
@@ -4521,6 +4533,7 @@
 ('io', 'particle_tag')                                                                                                         ``particle_index``                   1                                                     
 ('io', 'particle_mass')  :math:`\mathrm{\rm{code}~\rm{mass}}`                                                                  ``particle_mass``                    1                                                     
 =======================  ====================================================================================================  ===========================  =========  ===================================================
+
 .. _Gadget_specific_fields:
 
 Gadget-Specific Fields
@@ -4557,6 +4570,7 @@
 ('io', 'Metallicity_09')                                                                              ``Ca_fraction``                1              
 ('io', 'Metallicity_10')                                                                              ``Fe_fraction``                1              
 ============================  ======================================================================  =====================  =========  ============
+
 .. _GDF_specific_fields:
 
 GDF-Specific Fields
@@ -4576,6 +4590,7 @@
 ('gdf', 'mag_field_y')      :math:`\mathrm{\rm{gauss}}`                    ``magnetic_field_y``          0              
 ('gdf', 'mag_field_z')      :math:`\mathrm{\rm{gauss}}`                    ``magnetic_field_z``          0              
 ==========================  =============================================  ====================  =========  ============
+
 .. _HaloCatalog_specific_fields:
 
 HaloCatalog-Specific Fields
@@ -4594,6 +4609,7 @@
 ('io', 'particle_mass')        :math:`\mathrm{\rm{g}}`                             1  :math:`Virial Mass`  
 ('io', 'virial_radius')        :math:`\mathrm{\rm{cm}}`                            1  :math:`Virial Radius`
 =============================  =================================  =======  =========  =====================
+
 .. _OWLS_specific_fields:
 
 OWLS-Specific Fields
@@ -4630,6 +4646,7 @@
 ('io', 'Metallicity_09')                                                                              ``Ca_fraction``                1              
 ('io', 'Metallicity_10')                                                                              ``Fe_fraction``                1              
 ============================  ======================================================================  =====================  =========  ============
+
 .. _OWLSSubfind_specific_fields:
 
 OWLSSubfind-Specific Fields
@@ -4664,32 +4681,34 @@
 ('io', 'BH_Mdot')                 :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}`                                   1              
 ('io', 'StarFormationRate')       :math:`\mathrm{\rm{code}~\rm{mass} / \rm{code}~\rm{time}}`                                   1              
 ================================  ==========================================================  =======================  =========  ============
+
 .. _RAMSES_specific_fields:
 
 RAMSES-Specific Fields
 ----------------------
 
-===================================  ================================================================================================  ==================  =========  ============
-field name                           units                                                                                             aliases             particle?  display name
-===================================  ================================================================================================  ==================  =========  ============
-('ramses', 'Density')                :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length}^{3}}}`                            ``density``                 0              
-('ramses', 'x-velocity')             :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                      ``velocity_x``              0              
-('ramses', 'y-velocity')             :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                      ``velocity_y``              0              
-('ramses', 'z-velocity')             :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                      ``velocity_z``              0              
-('ramses', 'Pressure')               :math:`\mathrm{\frac{\rm{code}~\rm{mass}}{\rm{code}~\rm{length} \cdot \rm{code}~\rm{time}^{2}}}`  ``pressure``                0              
-('ramses', 'Metallicity')                                                                                                              ``metallicity``             0              
-('io', 'particle_position_x')        :math:`\mathrm{\rm{code}~\rm{length}}`                                                                                        1              
-('io', 'particle_position_y')        :math:`\mathrm{\rm{code}~\rm{length}}`                                                                                        1              
-('io', 'particle_position_z')        :math:`\mathrm{\rm{code}~\rm{length}}`                                                                                        1              
-('io', 'particle_velocity_x')        :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                                                  1              
-('io', 'particle_velocity_y')        :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                                                  1              
-('io', 'particle_velocity_z')        :math:`\mathrm{\rm{code}~\rm{length} / \rm{code}~\rm{time}}`                                                                  1              
-('io', 'particle_mass')              :math:`\mathrm{\rm{code}~\rm{mass}}`                                                                                          1              
-('io', 'particle_identifier')                                                                                                          ``particle_index``          1              
-('io', 'particle_refinement_level')                                                                                                                                1              
-('io', 'particle_age')               :math:`\mathrm{\rm{code}~\rm{time}}`                                                                                          1              
-('io', 'particle_metallicity')                                                                                                                                     1              
-===================================  ================================================================================================  ==================  =========  ============
+===================================  ========================================  ==================  =========  ============
+field name                           units                                     aliases             particle?  display name
+===================================  ========================================  ==================  =========  ============
+('ramses', 'Density')                :math:`\mathrm{\rm{code_density}}`        ``density``                 0              
+('ramses', 'x-velocity')             :math:`\mathrm{\rm{code}~\rm{velocity}}`  ``velocity_x``              0              
+('ramses', 'y-velocity')             :math:`\mathrm{\rm{code}~\rm{velocity}}`  ``velocity_y``              0              
+('ramses', 'z-velocity')             :math:`\mathrm{\rm{code}~\rm{velocity}}`  ``velocity_z``              0              
+('ramses', 'Pressure')               :math:`\mathrm{\rm{code_pressure}}`       ``pressure``                0              
+('ramses', 'Metallicity')                                                      ``metallicity``             0              
+('io', 'particle_position_x')        :math:`\mathrm{\rm{code}~\rm{length}}`                                1              
+('io', 'particle_position_y')        :math:`\mathrm{\rm{code}~\rm{length}}`                                1              
+('io', 'particle_position_z')        :math:`\mathrm{\rm{code}~\rm{length}}`                                1              
+('io', 'particle_velocity_x')        :math:`\mathrm{\rm{code}~\rm{velocity}}`                              1              
+('io', 'particle_velocity_y')        :math:`\mathrm{\rm{code}~\rm{velocity}}`                              1              
+('io', 'particle_velocity_z')        :math:`\mathrm{\rm{code}~\rm{velocity}}`                              1              
+('io', 'particle_mass')              :math:`\mathrm{\rm{code}~\rm{mass}}`                                  1              
+('io', 'particle_identifier')                                                  ``particle_index``          1              
+('io', 'particle_refinement_level')                                                                        1              
+('io', 'particle_age')               :math:`\mathrm{\rm{code}~\rm{time}}`                                  1              
+('io', 'particle_metallicity')                                                                             1              
+===================================  ========================================  ==================  =========  ============
+
 .. _Rockstar_specific_fields:
 
 Rockstar-Specific Fields
@@ -4756,6 +4775,7 @@
 ('io', 'min_vel_err')                                                                    1                                   
 ('io', 'min_bulkvel_err')                                                                1                                   
 =============================  =======================================  =======  =========  =================================
+
 .. _Tipsy_specific_fields:
 
 Tipsy-Specific Fields
@@ -4812,6 +4832,7 @@
 ============================  ======================================================================  =====================  =========  ============
 
 
+
 Index of Fields
 ---------------
 

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 doc/source/visualizing/_cb_docstrings.inc
--- a/doc/source/visualizing/_cb_docstrings.inc
+++ b/doc/source/visualizing/_cb_docstrings.inc
@@ -201,7 +201,7 @@
    :class:`~yt.visualization.plot_modifications.ImageLineCallback`.)
 
    Plot from ``p1`` to ``p2`` (normalized image plane coordinates) with
-  ``plot_args`` fed into the plot.
+   ``plot_args`` fed into the plot.
 
 .. python-script::
 

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 doc/source/visualizing/plots.rst
--- a/doc/source/visualizing/plots.rst
+++ b/doc/source/visualizing/plots.rst
@@ -127,13 +127,14 @@
 If supplied without units, the center is assumed by in code units.  There are also
 the following alternative options for the `center` keyword:
 
-* `"center"`, "c"`: the domain center
-* `"max"`, `"m"`: the position of the maximum density
-* `("min", field)`: the position of the minimum of `field`
-* `("max", field)`: the position of the maximum of `field`
+* ``"center"``, ``"c"``: the domain center
+* ``"max"``, ``"m"``: the position of the maximum density
+* ``("min", field)``: the position of the minimum of ``field``
+* ``("max", field)``: the position of the maximum of ``field``
 
-where for the last two objects any spatial field, such as `"density"`, `"velocity_z"`,
-etc., may be used, e.g. `center=("min","temperature")`
+where for the last two objects any spatial field, such as ``"density"``,
+``"velocity_z"``,
+etc., may be used, e.g. ``center=("min","temperature")``.
 
 Here is an example that combines all of the options we just discussed.
 

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/analysis_modules/halo_analysis/halo_callbacks.py
--- a/yt/analysis_modules/halo_analysis/halo_callbacks.py
+++ b/yt/analysis_modules/halo_analysis/halo_callbacks.py
@@ -404,7 +404,7 @@
                halo.quantities["particle_identifier"])
 
     fields = ensure_list(fields)
-    fields = [halo.halo_catalog.data_source._determine_fields(field)[0]
+    fields = [halo.data_object._determine_fields(field)[0]
               for field in fields]
     
     dds = halo.halo_catalog.data_ds

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/analysis_modules/halo_analysis/halo_catalog.py
--- a/yt/analysis_modules/halo_analysis/halo_catalog.py
+++ b/yt/analysis_modules/halo_analysis/halo_catalog.py
@@ -376,7 +376,7 @@
             # Add all of the default quantities that all halos must have
             self.add_default_quantities('all')
 
-        my_index = np.argsort(self.data_source["particle_identifier"])
+        my_index = np.argsort(self.data_source["all", "particle_identifier"])
         for i in parallel_objects(my_index, njobs=njobs, dynamic=dynamic):
             new_halo = Halo(self)
             halo_filter = True

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/analysis_modules/radmc3d_export/RadMC3DInterface.py
--- a/yt/analysis_modules/radmc3d_export/RadMC3DInterface.py
+++ b/yt/analysis_modules/radmc3d_export/RadMC3DInterface.py
@@ -13,7 +13,8 @@
 # The full license is in the file COPYING.txt, distributed with this software.
 #-----------------------------------------------------------------------------
 
-from yt.mods import *
+import yt
+import numpy as np
 from yt.utilities.lib.write_array import \
     write_3D_array, write_3D_vector_array
 
@@ -86,40 +87,42 @@
     file "dust_density.inp" in a form readable by radmc3d. It will also write
     a "dust_temperature.inp" file with everything set to 10.0 K: 
 
-    >>> from yt.mods import *
-    >>> from yt.analysis_modules.radmc3d_export.api import *
+    >>> import yt
+    >>> from yt.analysis_modules.radmc3d_export.api import RadMC3DWriter
 
     >>> dust_to_gas = 0.01
     >>> def _DustDensity(field, data):
     ...     return dust_to_gas*data["Density"]
-    >>> add_field("DustDensity", function=_DustDensity)
+    >>> yt.add_field("DustDensity", function=_DustDensity)
 
     >>> def _DustTemperature(field, data):
     ...     return 10.0*data["Ones"]
-    >>> add_field("DustTemperature", function=_DustTemperature)
+    >>> yt.add_field("DustTemperature", function=_DustTemperature)
     
-    >>> ds = load("galaxy0030/galaxy0030")
+    >>> ds = yt.load("galaxy0030/galaxy0030")
     >>> writer = RadMC3DWriter(ds)
     
     >>> writer.write_amr_grid()
     >>> writer.write_dust_file("DustDensity", "dust_density.inp")
     >>> writer.write_dust_file("DustTemperature", "dust_temperature.inp")
 
-    This will create a field called "NumberDensityCO" and write it out to
+    ---
+
+    This example will create a field called "NumberDensityCO" and write it out to
     the file "numberdens_co.inp". It will also write out information about
     the gas velocity to "gas_velocity.inp" so that this broadening may be
     included in the radiative transfer calculation by radmc3d:
 
-    >>> from yt.mods import *
-    >>> from yt.analysis_modules.radmc3d_export.api import *
+    >>> import yt
+    >>> from yt.analysis_modules.radmc3d_export.api import RadMC3DWriter
 
     >>> x_co = 1.0e-4
     >>> mu_h = 2.34e-24
     >>> def _NumberDensityCO(field, data):
     ...     return (x_co/mu_h)*data["Density"]
-    >>> add_field("NumberDensityCO", function=_NumberDensityCO)
+    >>> yt.add_field("NumberDensityCO", function=_NumberDensityCO)
     
-    >>> ds = load("galaxy0030/galaxy0030")
+    >>> ds = yt.load("galaxy0030/galaxy0030")
     >>> writer = RadMC3DWriter(ds)
     
     >>> writer.write_amr_grid()
@@ -183,8 +186,8 @@
         RE   = self.domain_right_edge
 
         # Radmc3D wants the cell wall positions in cgs. Convert here:
-        LE_cgs = LE * self.ds.units['cm']
-        RE_cgs = RE * self.ds.units['cm']
+        LE_cgs = LE.in_units('cm')
+        RE_cgs = RE.in_units('cm')
 
         # calculate cell wall positions
         xs = [str(x) for x in np.linspace(LE_cgs[0], RE_cgs[0], dims[0]+1)]

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/analysis_modules/radmc3d_export/tests/test_radmc3d_exporter.py
--- /dev/null
+++ b/yt/analysis_modules/radmc3d_export/tests/test_radmc3d_exporter.py
@@ -0,0 +1,56 @@
+"""
+Unit test for the RADMC3D Exporter analysis module
+"""
+
+#-----------------------------------------------------------------------------
+# Copyright (c) 2014, yt Development Team.
+#
+# Distributed under the terms of the Modified BSD License.
+#
+# The full license is in the file COPYING.txt, distributed with this software.
+#-----------------------------------------------------------------------------
+
+import yt
+from yt.testing import *
+from yt.analysis_modules.radmc3d_export.api import RadMC3DWriter
+from yt.config import ytcfg
+import tempfile
+import os
+import shutil
+
+ISO_GAL = "IsolatedGalaxy/galaxy0030/galaxy0030"
+
+ at requires_file(ISO_GAL)
+def test_radmc3d_exporter_continuum():
+    """
+    This test is simply following the description in the docs for how to
+    generate the necessary output files to run a continuum emission map from
+    dust for one of our sample datasets.
+    """
+
+    # Set up in a temp dir
+    tmpdir = tempfile.mkdtemp()
+    curdir = os.getcwd()
+    os.chdir(tmpdir)
+
+    # Make up a dust density field where dust density is 1% of gas density
+    dust_to_gas = 0.01
+    def _DustDensity(field, data):
+        return dust_to_gas * data["density"]
+    
+    # Make up a dust temperature field where temp = 10K everywhere
+    def _DustTemperature(field, data):
+        return 0.*data["temperature"] + data.ds.quan(10,'K')
+    
+    ds = yt.load(ISO_GAL)
+    ds.add_field(("gas", "dust_density"), function=_DustDensity, units="g/cm**3")
+    ds.add_field(("gas", "dust_temperature"), function=_DustTemperature, units="K")
+    writer = RadMC3DWriter(ds)
+    
+    writer.write_amr_grid()
+    writer.write_dust_file(("gas", "dust_density"), "dust_density.inp")
+    writer.write_dust_file(("gas", "dust_temperature"), "dust_temperature.inp")
+
+    # clean up
+    os.chdir(curdir)
+    shutil.rmtree(tmpdir)

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/data_objects/construction_data_containers.py
--- a/yt/data_objects/construction_data_containers.py
+++ b/yt/data_objects/construction_data_containers.py
@@ -54,6 +54,8 @@
     NeedsDataField,\
     NeedsProperty,\
     NeedsParameter
+from yt.fields.derived_field import \
+    TranslationFunc
 
 class YTStreamlineBase(YTSelectionContainer1D):
     """
@@ -525,19 +527,26 @@
         fields_to_get = [f for f in fields if f not in self.field_data]
         fields_to_get = self._identify_dependencies(fields_to_get)
         if len(fields_to_get) == 0: return
-        fill, gen, part = self._split_fields(fields_to_get)
+        fill, gen, part, alias = self._split_fields(fields_to_get)
         if len(part) > 0: self._fill_particles(part)
         if len(fill) > 0: self._fill_fields(fill)
+        for a, f in sorted(alias.items()):
+            self[a] = f(self)
+            self.field_data[a].convert_to_units(f.output_units)
         if len(gen) > 0: self._generate_fields(gen)
 
     def _split_fields(self, fields_to_get):
         fill, gen = self.index._split_fields(fields_to_get)
         particles = []
+        alias = {}
         for field in gen:
             if field[0] == 'deposit':
                 fill.append(field)
                 continue
             finfo = self.ds._get_field_info(*field)
+            if finfo._function.func_name == "_TranslationFunc":
+                alias[field] = finfo
+                continue
             try:
                 finfo.check_available(self)
             except NeedsOriginalGrid:
@@ -546,15 +555,17 @@
             finfo = self.ds._get_field_info(*field)
             if finfo.particle_type:
                 particles.append(field)
-        gen = [f for f in gen if f not in fill]
+        gen = [f for f in gen if f not in fill and f not in alias]
         fill = [f for f in fill if f not in particles]
-        return fill, gen, particles
+        return fill, gen, particles, alias
 
     def _fill_particles(self, part):
         for p in part:
             self[p] = self._pdata_source[p]
 
     def _fill_fields(self, fields):
+        fields = [f for f in fields if f not in self.field_data]
+        if len(fields) == 0: return
         output_fields = [np.zeros(self.ActiveDimensions, dtype="float64")
                          for field in fields]
         domain_dims = self.ds.domain_dimensions.astype("int64") \
@@ -786,6 +797,8 @@
 
 
     def _fill_fields(self, fields):
+        fields = [f for f in fields if f not in self.field_data]
+        if len(fields) == 0: return
         ls = self._initialize_level_state(fields)
         for level in range(self.level + 1):
             domain_dims = self.ds.domain_dimensions.astype("int64") \

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py
+++ b/yt/data_objects/data_containers.py
@@ -600,11 +600,6 @@
             if inspected >= len(fields_to_get): break
             inspected += 1
             fi = self.ds._get_field_info(*field)
-            if not spatial and any(
-                    isinstance(v, ValidateSpatial) for v in fi.validators):
-                # We don't want to pre-fetch anything that's spatial, as that
-                # will be done later.
-                continue
             fd = self.ds.field_dependencies.get(field, None) or \
                  self.ds.field_dependencies.get(field[1], None)
             # This is long overdue.  Any time we *can't* find a field

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -618,9 +618,11 @@
         import yt.units.dimensions as dimensions
         self.unit_registry.add("code_length", 1.0, dimensions.length)
         self.unit_registry.add("code_mass", 1.0, dimensions.mass)
+        self.unit_registry.add("code_density", 1.0, dimensions.density)
         self.unit_registry.add("code_time", 1.0, dimensions.time)
         self.unit_registry.add("code_magnetic", 1.0, dimensions.magnetic_field)
         self.unit_registry.add("code_temperature", 1.0, dimensions.temperature)
+        self.unit_registry.add("code_pressure", 1.0, dimensions.pressure)
         self.unit_registry.add("code_velocity", 1.0, dimensions.velocity)
         self.unit_registry.add("code_metallicity", 1.0,
                                dimensions.dimensionless)
@@ -676,9 +678,17 @@
         self.unit_registry.modify("code_length", self.length_unit)
         self.unit_registry.modify("code_mass", self.mass_unit)
         self.unit_registry.modify("code_time", self.time_unit)
-        vel_unit = getattr(self, "velocity_unit",
-                    self.length_unit / self.time_unit)
+        vel_unit = getattr(
+            self, "velocity_unit", self.length_unit / self.time_unit)
+        pressure_unit = getattr(
+            self, "pressure_unit",
+            self.mass_unit / (self.length_unit * self.time_unit)**2)
+        temperature_unit = getattr(self, "temperature_unit", 1.0)
+        density_unit = getattr(self, "density_unit", self.mass_unit / self.length_unit**3)
         self.unit_registry.modify("code_velocity", vel_unit)
+        self.unit_registry.modify("code_temperature", temperature_unit)
+        self.unit_registry.modify("code_pressure", pressure_unit)
+        self.unit_registry.modify("code_density", density_unit)
         # domain_width does not yet exist
         if (self.domain_left_edge is not None and
             self.domain_right_edge is not None):

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/frontends/ramses/data_structures.py
--- a/yt/frontends/ramses/data_structures.py
+++ b/yt/frontends/ramses/data_structures.py
@@ -33,8 +33,9 @@
     get_box_grids_level
 from yt.utilities.io_handler import \
     io_registry
+from yt.utilities.physical_constants import mp, kb
 from .fields import \
-    RAMSESFieldInfo
+    RAMSESFieldInfo, _X
 import yt.utilities.fortran_utils as fpu
 from yt.geometry.oct_container import \
     RAMSESOctreeContainer
@@ -489,19 +490,28 @@
         # Note that unit_l *already* converts to proper!
         # Also note that unit_l must be multiplied by the boxlen parameter to
         # ensure we are correctly set up for the current domain.
-        length_unit = self.parameters['unit_l'] * self.parameters['boxlen']
-        rho_u = self.parameters['unit_d']
-        # We're not multiplying by the boxlength here.
-        mass_unit = rho_u * self.parameters['unit_l']**3
+        length_unit = self.parameters['unit_l']
+        boxlen = self.parameters['boxlen']
+        density_unit = self.parameters['unit_d']
+        mass_unit = density_unit * (length_unit * boxlen)**3
         time_unit = self.parameters['unit_t']
-
         magnetic_unit = np.sqrt(4*np.pi * mass_unit /
                                 (time_unit**2 * length_unit))
+        pressure_unit = density_unit * (length_unit / time_unit)**2
+        # TODO:
+        # Generalize the temperature field to account for ionization
+        # For now assume an atomic ideal gas with cosmic abundances (x_H = 0.76)
+        mean_molecular_weight_factor = _X**-1
+
+        self.density_unit = self.quan(density_unit, 'g/cm**3')
         self.magnetic_unit = self.quan(magnetic_unit, "gauss")
-        self.length_unit = self.quan(length_unit, "cm")
+        self.length_unit = self.quan(length_unit * boxlen, "cm")
         self.mass_unit = self.quan(mass_unit, "g")
         self.time_unit = self.quan(time_unit, "s")
-        self.velocity_unit = self.length_unit / self.time_unit
+        self.velocity_unit = self.quan(length_unit, 'cm') / self.time_unit
+        self.temperature_unit = (self.velocity_unit**2 * mp *
+                                 mean_molecular_weight_factor / kb)
+        self.pressure_unit = self.quan(pressure_unit, 'dyne/cm**2')
 
     def _parse_parameter_file(self):
         # hardcoded for now
@@ -546,15 +556,21 @@
         self.domain_dimensions = np.ones(3, dtype='int32') * \
                         2**(self.min_level+1)
         self.domain_right_edge = np.ones(3, dtype='float64')
-        # This is likely not true, but I am not sure how to otherwise
-        # distinguish them.
-        mylog.warning("RAMSES frontend assumes all simulations are cosmological!")
-        self.cosmological_simulation = 1
+        # This is likely not true, but it's not clear how to determine the boundary conditions
         self.periodicity = (True, True, True)
-        self.current_redshift = (1.0 / rheader["aexp"]) - 1.0
-        self.omega_lambda = rheader["omega_l"]
-        self.omega_matter = rheader["omega_m"]
-        self.hubble_constant = rheader["H0"] / 100.0 # This is H100
+        # These conditions seem to always be true for non-cosmological datasets
+        if rheader["time"] > 0 and rheader["H0"] == 1 and rheader["aexp"] == 1:
+            self.cosmological_simulation = 0
+            self.current_redshift = 0
+            self.hubble_constant = 0
+            self.omega_matter = 0
+            self.omega_lambda = 0
+        else:
+            self.cosmological_simulation = 1
+            self.current_redshift = (1.0 / rheader["aexp"]) - 1.0
+            self.omega_lambda = rheader["omega_l"]
+            self.omega_matter = rheader["omega_m"]
+            self.hubble_constant = rheader["H0"] / 100.0 # This is H100
         self.max_level = rheader['levelmax'] - self.min_level - 1
         f.close()
 

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/frontends/ramses/fields.py
--- a/yt/frontends/ramses/fields.py
+++ b/yt/frontends/ramses/fields.py
@@ -32,8 +32,9 @@
 
 b_units = "code_magnetic"
 ra_units = "code_length / code_time**2"
-rho_units = "code_mass / code_length**3"
-vel_units = "code_length / code_time"
+rho_units = "code_density"
+vel_units = "code_velocity"
+pressure_units = "code_pressure"
 
 known_species_masses = dict(
   (sp, mh * v) for sp, v in [
@@ -70,7 +71,7 @@
         ("x-velocity", (vel_units, ["velocity_x"], None)),
         ("y-velocity", (vel_units, ["velocity_y"], None)),
         ("z-velocity", (vel_units, ["velocity_z"], None)),
-        ("Pressure", ("code_mass / (code_length * code_time**2)", ["pressure"], None)),
+        ("Pressure", (pressure_units, ["pressure"], None)),
         ("Metallicity", ("", ["metallicity"], None)),
     )
     known_particle_fields = (

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/units/dimensions.py
--- a/yt/units/dimensions.py
+++ b/yt/units/dimensions.py
@@ -42,6 +42,7 @@
 volume   = area * length
 momentum = mass * velocity
 force    = mass * acceleration
+pressure = force / area
 energy   = force * length
 power    = energy / time
 flux     = power / area

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/visualization/plot_container.py
--- a/yt/visualization/plot_container.py
+++ b/yt/visualization/plot_container.py
@@ -35,6 +35,12 @@
 from yt.utilities.exceptions import \
     YTNotInsideNotebook
 
+def ensure_callbacks(f):
+    @wraps(f)
+    def newfunc(*args, **kwargs):
+        args[0].run_callbacks()
+        return f(*args, **kwargs)
+    return newfunc
 
 def invalidate_data(f):
     @wraps(f)
@@ -416,16 +422,17 @@
     def __getitem__(self, item):
         return self.plots[item]
 
-    def run_callbacks(self, f):
-        keys = self.frb.keys()
-        for name, (args, kwargs) in self._callbacks:
-            cbw = CallbackWrapper(self, self.plots[f], self.frb, f)
-            CallbackMaker = callback_registry[name]
-            callback = CallbackMaker(*args[1:], **kwargs)
-            callback(cbw)
-        for key in self.frb.keys():
-            if key not in keys:
-                del self.frb[key]
+    def run_callbacks(self):
+        for f in self.fields:
+            keys = self.frb.keys()
+            for name, (args, kwargs) in self._callbacks:
+                cbw = CallbackWrapper(self, self.plots[f], self.frb, f)
+                CallbackMaker = callback_registry[name]
+                callback = CallbackMaker(*args[1:], **kwargs)
+                callback(cbw)
+            for key in self.frb.keys():
+                if key not in keys:
+                    del self.frb[key]
 
     def _set_font_properties(self):
         for f in self.plots:
@@ -524,6 +531,7 @@
         self.figure_size = float(size)
         return self
 
+    @ensure_callbacks
     def save(self, name=None, mpl_kwargs=None):
         """saves the plot to disk.
 
@@ -629,6 +637,7 @@
         except YTNotInsideNotebook:
             return self.save(name=name, mpl_kwargs=mpl_kwargs)
 
+    @ensure_callbacks
     def _repr_html_(self):
         """Return an html representation of the plot object. Will display as a
         png for each WindowPlotMPL instance in self.plots"""

diff -r e01cacbc0aa0b799682b4c3a86562cb71904e933 -r 315c1e0be573554cc92e4e420196d7d615369d93 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -159,8 +159,8 @@
 
     Parameters
     ----------
-    data_source : :class:`yt.data_objects.data_containers.YTProjBase` or
-                  :class:`yt.data_objects.data_containers.YTSliceBase`
+
+    data_source : :class:`yt.data_objects.data_containers.YTProjBase` or :class:`yt.data_objects.data_containers.YTSliceBase`
         This is the source to be pixelized, which can be a projection or a
         slice.  (For cutting planes, see
         `yt.visualization.fixed_resolution.ObliqueFixedResolutionBuffer`.)
@@ -895,8 +895,6 @@
             else:
                 self.plots[f].cax.minorticks_off()
 
-            self.run_callbacks(f)
-
             if draw_axes is False:
                 self.plots[f]._toggle_axes(draw_axes)
 


https://bitbucket.org/yt_analysis/yt/commits/e5cf41050d43/
Changeset:   e5cf41050d43
Branch:      yt
User:        xarthisius
Date:        2015-01-04 04:50:35+00:00
Summary:     Remove density as a weight field for DM-only datasets
Affected #:  1 file

diff -r 315c1e0be573554cc92e4e420196d7d615369d93 -r e5cf41050d431871cd00f21bb9a238ac415ebe39 yt/frontends/tipsy/tests/test_outputs.py
--- a/yt/frontends/tipsy/tests/test_outputs.py
+++ b/yt/frontends/tipsy/tests/test_outputs.py
@@ -52,7 +52,7 @@
     for dobj_name in dso:
         for field in _fields:
             for axis in [0, 1, 2]:
-                for weight_field in [None, "density"]:
+                for weight_field in [None]:
                     yield PixelizedProjectionValuesTest(
                         ds, axis, field, weight_field,
                         dobj_name)
@@ -83,7 +83,7 @@
     for dobj_name in dso:
         for field in _fields:
             for axis in [0, 1, 2]:
-                for weight_field in [None, "density"]:
+                for weight_field in [None]:
                     yield PixelizedProjectionValuesTest(
                         ds, axis, field, weight_field,
                         dobj_name)


https://bitbucket.org/yt_analysis/yt/commits/e88ef09175f9/
Changeset:   e88ef09175f9
Branch:      yt
User:        xarthisius
Date:        2015-01-04 05:08:23+00:00
Summary:     Merged in xarthisius/yt (pull request #1348)

Fix typo in PixelizedProjectionValuesTest initializer
Affected #:  2 files

diff -r bff388fc33061ed00da992bf274c96433c66a058 -r e88ef09175f96b2d336ba2597f68df966458fb0f yt/frontends/tipsy/tests/test_outputs.py
--- a/yt/frontends/tipsy/tests/test_outputs.py
+++ b/yt/frontends/tipsy/tests/test_outputs.py
@@ -52,7 +52,7 @@
     for dobj_name in dso:
         for field in _fields:
             for axis in [0, 1, 2]:
-                for weight_field in [None, "density"]:
+                for weight_field in [None]:
                     yield PixelizedProjectionValuesTest(
                         ds, axis, field, weight_field,
                         dobj_name)
@@ -83,7 +83,7 @@
     for dobj_name in dso:
         for field in _fields:
             for axis in [0, 1, 2]:
-                for weight_field in [None, "density"]:
+                for weight_field in [None]:
                     yield PixelizedProjectionValuesTest(
                         ds, axis, field, weight_field,
                         dobj_name)

diff -r bff388fc33061ed00da992bf274c96433c66a058 -r e88ef09175f96b2d336ba2597f68df966458fb0f yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -491,7 +491,7 @@
         super(PixelizedProjectionValuesTest, self).__init__(ds_fn)
         self.axis = axis
         self.field = field
-        self.weight_field = field
+        self.weight_field = weight_field
         self.obj_type = obj_type
 
     def run(self):
@@ -504,7 +504,8 @@
                               data_source = obj)
         frb = proj.to_frb((1.0, 'unitary'), 256)
         frb[self.field]
-        frb[self.weight_field]
+        if self.weight_field is not None:
+            frb[self.weight_field]
         d = frb.data
         for f in proj.field_data:
             # Sometimes f will be a tuple.

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list