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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Jul 31 22:36:02 PDT 2014


4 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/6c27d1ac2bc6/
Changeset:   6c27d1ac2bc6
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-08-01 04:19:40
Summary:     Adding a few more items for the yt3 differences quick bullet points.
Affected #:  1 file

diff -r d9933af8625faa7a45957a6269cfce3909a64d14 -r 6c27d1ac2bc6d4c9f7425e591f2c9e773f89660f doc/source/yt3differences.rst
--- a/doc/source/yt3differences.rst
+++ b/doc/source/yt3differences.rst
@@ -16,9 +16,10 @@
 
 * We have reworked yt's import system so that most commonly-used yt functions
   and classes live in the top-level yt namespace. That means you can now
-  import yt with ``import yt``, load a dataset with ``ds = yt.load``
+  import yt with ``import yt``, load a dataset with ``ds = yt.load(filename)``
   and create a plot with ``yt.SlicePlot``.  See :ref:`api-reference` for a full
-  API listing.
+  API listing.  You can still import using ``from yt.mods import *`` to get a
+  pylab-like experience.
 * Fields and metadata for data objects and datasets now have units.  The unit
   system keeps you from making weird things like ``ergs`` + ``g`` and can
   handle things like ``g`` + ``kg`` or ``kg*m/s**2 == Newton``.  See
@@ -29,33 +30,45 @@
   Axis names are now at the *end* of field names, not the beginning.
   ``x-velocity`` is now ``velocity_x``.  For a full list of all of the fields, 
   see :ref:`field-list`.
-* Fields can be accessed by a name, but are named internally as ``(fluid_type,
-  fluid_name)``.  See :ref:`fields`.
-* Mesh fields on-disk will be in code units, and will be named ``(code_name,
-  FieldName)``. See :ref:`fields`.
+* Fields can be accessed by a name, but are named internally as ``(field_type,
+  field_name)``.  See :ref:`fields`.
+* Mesh fields that exist on-disk in an output file can be read in using whatever
+  name is used by the output file.  On-disk fields are always returned in code
+  units.  The full field name will be will be ``(code_name, field_name)``. See
+  :ref:`fields`.
 * Particle fields on-disk will also be in code units, and will be named
   ``(particle_type, FieldName)``.  If there is only one particle type in the
-  output file, the particle type for all particles will be ``io``. See 
+  output file, all particles will use ``io`` as the particle type. See 
   :ref:`fields`.
-* Previously, yt would capture command line arguments when being imported.
-  This no longer happens.  As a side effect, it is no longer necessary to
-  specify ``--parallel`` at the command line when running a parallel 
-  computation. Use ``yt.enable_parallelism()`` instead.  See 
-  :ref:`parallel-computation` for more details.
-* Any derived quantities that *always* returned lists (like ``Extrema``,
-  which would return a list even if you only ask for one field) now only
-  returns a single result if you only ask for one field.  Results for particle
-  and mesh fields will be returned separately.  See :ref:`derived-quantities`
-  for more information.
+* The objects we used to refer to as "parameter files" we now refer to as a
+  dataset.  Instead of ``pf``, we now suggest you use ``ds`` to refer to an
+  object returned by ``yt.load``.
+* You can now create data objects without referring to hierarchy: instead of
+  ``pf.h.all_data()``, you can now say ``ds.all_data()``.
+* The hierarchy is still there, but it is now called the index: ``ds.index``.
+* Previously, yt would capture command line arguments when being imported.  This
+  now only happens when you import yt using ``from yt.mods import *``.  Since
+  command line arguments are not parsed when using ``import yt``, it is no
+  longer necessary to specify ``--parallel`` at the command line when running a
+  parallel computation. Use ``yt.enable_parallelism()`` in your script instead.
+  See :ref:`parallel-computation` for more details.
+* Any derived quantities that *always* returned lists (like ``Extrema``, which
+  would return a list even if you only ask for one field) now only returns a
+  single result if you only ask for one field.  Results for particle and mesh
+  fields will also be returned separately.  See :ref:`derived-quantities` for
+  more information.
 * Derived quantities can now be accessed via a function that hangs off of the
   ``quantities`` atribute of data objects. Instead of
-  ``dd.quantities['TotalMass']``, you can now use
+  ``dd.quantities['TotalMass']()``, you can now use
   ``dd.quantities.total_mass()`` to do the same thing. All derived quantities
   can be accessed via a function that hangs off of the `quantities` attribute
   of data objects. See :ref:`derived-quantities`.
-* You can't get the ``grids`` attribute of data objects.  To get this
+* The ``grids`` attribute data objects no longer exists.  To get this
   information, you have to use spatial chunking and then access them.  See
-  :ref:`here grid-chunking` for an example.
+  :ref:`here grid-chunking` for an example.  For datasets that use grid
+  hierarchies, you can also access the grids for the entire dataset via
+  `ds.index.grids`.  This attribute is not defined for particle or octree
+  datasets.
 
 Cool New Things
 ---------------


https://bitbucket.org/yt_analysis/yt/commits/2cc22b3e7de0/
Changeset:   2cc22b3e7de0
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-08-01 04:41:25
Summary:     Removing the halo profiler cookbook recipe.
Affected #:  1 file

diff -r 6c27d1ac2bc6d4c9f7425e591f2c9e773f89660f -r 2cc22b3e7de07ebe28f87b068f19590a9ae5b03f doc/source/cookbook/halo_profiler.py
--- a/doc/source/cookbook/halo_profiler.py
+++ /dev/null
@@ -1,44 +0,0 @@
-from yt.mods import *
-from yt.analysis_modules.halo_analysis.api import *
-
-# Load the data set with the full simulation information
-# and rockstar halos
-data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')
-halos_pf = load('rockstar_halos/halos_0.0.bin')
-
-# Instantiate a catalog using those two paramter files
-hc = HaloCatalog(data_pf=data_pf, halos_pf=halos_pf)
-
-# Filter out less massive halos
-hc.add_filter("quantity_value", "particle_mass", ">", 1e14, "Msun")
-
-# attach a sphere object to each halo whose radius extends
-#   to twice the radius of the halo
-hc.add_callback("sphere", factor=2.0)
-
-# use the sphere to calculate radial profiles of gas density
-# weighted by cell volume in terms of the virial radius
-hc.add_callback("profile", x_field="radius",
-                y_fields=[("gas", "overdensity")],
-                weight_field="cell_volume",
-                accumulation=False,
-                storage="virial_quantities_profiles")
-
-
-hc.add_callback("virial_quantities", ["radius"],
-                profile_storage="virial_quantities_profiles")
-hc.add_callback('delete_attribute', 'virial_quantities_profiles')
-
-field_params = dict(virial_radius=('quantity', 'radius_200'))
-hc.add_callback('sphere', radius_field='radius_200', factor=5,
-                field_parameters=field_params)
-hc.add_callback('profile', 'virial_radius', [('gas', 'temperature')],
-                storage='virial_profiles',
-                weight_field='cell_mass',
-                accumulation=False, output_dir='profiles')
-
-# Save the profiles
-hc.add_callback("save_profiles", storage="virial_profiles",
-                output_dir="profiles")
-
-hc.create()


https://bitbucket.org/yt_analysis/yt/commits/8ee38a11597c/
Changeset:   8ee38a11597c
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-08-01 04:52:00
Summary:     Adding a bit more text.
Affected #:  1 file

diff -r 2cc22b3e7de07ebe28f87b068f19590a9ae5b03f -r 8ee38a11597c74934777d5b0e1fecd93b6f1988c doc/source/yt3differences.rst
--- a/doc/source/yt3differences.rst
+++ b/doc/source/yt3differences.rst
@@ -46,24 +46,15 @@
 * You can now create data objects without referring to hierarchy: instead of
   ``pf.h.all_data()``, you can now say ``ds.all_data()``.
 * The hierarchy is still there, but it is now called the index: ``ds.index``.
-* Previously, yt would capture command line arguments when being imported.  This
-  now only happens when you import yt using ``from yt.mods import *``.  Since
-  command line arguments are not parsed when using ``import yt``, it is no
-  longer necessary to specify ``--parallel`` at the command line when running a
-  parallel computation. Use ``yt.enable_parallelism()`` in your script instead.
-  See :ref:`parallel-computation` for more details.
-* Any derived quantities that *always* returned lists (like ``Extrema``, which
-  would return a list even if you only ask for one field) now only returns a
-  single result if you only ask for one field.  Results for particle and mesh
-  fields will also be returned separately.  See :ref:`derived-quantities` for
-  more information.
-* Derived quantities can now be accessed via a function that hangs off of the
-  ``quantities`` atribute of data objects. Instead of
-  ``dd.quantities['TotalMass']()``, you can now use
-  ``dd.quantities.total_mass()`` to do the same thing. All derived quantities
-  can be accessed via a function that hangs off of the `quantities` attribute
-  of data objects. See :ref:`derived-quantities`.
-* The ``grids`` attribute data objects no longer exists.  To get this
+* Command line arguments are only parsed when yt is imported using ``from
+  yt.mods import *``. Since command line arguments are not parsed when using
+  ``import yt``, it is no longer necessary to specify ``--parallel`` at the
+  command line when running a parallel computation. Use
+  ``yt.enable_parallelism()`` in your script instead.  See
+  :ref:`parallel-computation` for more details.
+* Derived quantities have been reworked.  You can now do
+  ``dd.quantities.total_mass()`` instead of ``dd.quantities['TotalMass']()``.
+* The ``grids`` attribute of data objects no longer exists.  To get this
   information, you have to use spatial chunking and then access them.  See
   :ref:`here grid-chunking` for an example.  For datasets that use grid
   hierarchies, you can also access the grids for the entire dataset via
@@ -138,6 +129,20 @@
 Preliminary support for non-cartesian coordinates has been added.  We expect
 this to be considerably solidified and expanded in yt 3.1.
 
+Reworked import system
+^^^^^^^^^^^^^^^^^^^^^^
+
+It's now possible to import all yt functionality using ``import yt``. Rather
+than using ``from yt.mods import *``, we suggest using ``import yt`` in new
+scripts.  Most commonly used yt functionality is attached to the ``yt`` module.
+Load a dataset with ``yt.load()``, create a phase plot using ``yt.PhasePlot,
+and much more, see :ref:`the api docs api-reference` to learn more about what's
+in the ``yt`` namespace, or just use tab completion in IPython: ``yt.<tab>``.
+
+It's still possible to use ``from yt.mods import *`` to create an interactive
+pylab-like experience.  Importing yt this way has several side effects, most
+notably the command line arguments parsing and other startup tasks will run.
+
 API Changes
 -----------
 
@@ -196,6 +201,22 @@
 data objects are now attached to the to the ``dataset`` object.  Before, you
 would say ``ph.f.sphere()``, now you can say ``ds.sphere()``.
 
+New derived quantities interface
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Derived quantities can now be accessed via a function that hangs off of the
+``quantities`` atribute of data objects. Instead of
+``dd.quantities['TotalMass']()``, you can now use ``dd.quantities.total_mass()``
+to do the same thing. All derived quantities can be accessed via a function that
+hangs off of the `quantities` attribute of data objects.
+
+Any derived quantities that *always* returned lists (like ``Extrema``, which
+would return a list even if you only ask for one field) now only returns a
+single result if you only ask for one field.  Results for particle and mesh
+fields will also be returned separately.  See :ref:`derived-quantities` for more
+information.
+
+
 Field Info
 ^^^^^^^^^^
 


https://bitbucket.org/yt_analysis/yt/commits/ce522887be4e/
Changeset:   ce522887be4e
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-08-01 06:14:12
Summary:     Re-adding and fixing the halo_profiler recipe.
Affected #:  1 file

diff -r 8ee38a11597c74934777d5b0e1fecd93b6f1988c -r ce522887be4e2fe7efefc7eabe109c706bd1a9af doc/source/cookbook/halo_profiler.py
--- /dev/null
+++ b/doc/source/cookbook/halo_profiler.py
@@ -0,0 +1,44 @@
+import yt
+from yt.analysis_modules.halo_analysis.api import HaloCatalog
+
+# Load the data set with the full simulation information
+# and rockstar halos
+data_ds = yt.load('Enzo_64/RD0006/RedshiftOutput0006')
+halos_ds = yt.load('rockstar_halos/halos_0.0.bin')
+
+# Instantiate a catalog using those two paramter files
+hc = HaloCatalog(data_ds=data_ds, halos_ds=halos_ds)
+
+# Filter out less massive halos
+hc.add_filter("quantity_value", "particle_mass", ">", 1e14, "Msun")
+
+# attach a sphere object to each halo whose radius extends
+#   to twice the radius of the halo
+hc.add_callback("sphere", factor=2.0)
+
+# use the sphere to calculate radial profiles of gas density
+# weighted by cell volume in terms of the virial radius
+hc.add_callback("profile", x_field="radius",
+                y_fields=[("gas", "overdensity")],
+                weight_field="cell_volume",
+                accumulation=False,
+                storage="virial_quantities_profiles")
+
+
+hc.add_callback("virial_quantities", ["radius"],
+                profile_storage="virial_quantities_profiles")
+hc.add_callback('delete_attribute', 'virial_quantities_profiles')
+
+field_params = dict(virial_radius=('quantity', 'radius_200'))
+hc.add_callback('sphere', radius_field='radius_200', factor=5,
+                field_parameters=field_params)
+hc.add_callback('profile', 'virial_radius', [('gas', 'temperature')],
+                storage='virial_profiles',
+                weight_field='cell_mass',
+                accumulation=False, output_dir='profiles')
+
+# Save the profiles
+hc.add_callback("save_profiles", storage="virial_profiles",
+                output_dir="profiles")
+
+hc.create()

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