[yt-svn] commit/yt-3.0: MatthewTurk: Removing Tiger frontend.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Oct 22 07:16:42 PDT 2013


1 new commit in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/9d6a692bfef1/
Changeset:   9d6a692bfef1
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-10-22 16:16:07
Summary:     Removing Tiger frontend.
Affected #:  9 files

diff -r 34f821e4b5f24d61dd946f19716dc65db01cf11a -r 9d6a692bfef164ffeb8cc9b61294d93cc153fbd8 yt/frontends/tiger/__init__.py
--- a/yt/frontends/tiger/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-"""
-API for yt.frontends.tiger
-
-
-
-"""
-
-#-----------------------------------------------------------------------------
-# Copyright (c) 2013, 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.
-#-----------------------------------------------------------------------------

diff -r 34f821e4b5f24d61dd946f19716dc65db01cf11a -r 9d6a692bfef164ffeb8cc9b61294d93cc153fbd8 yt/frontends/tiger/api.py
--- a/yt/frontends/tiger/api.py
+++ /dev/null
@@ -1,26 +0,0 @@
-"""
-API for yt.frontends.tiger
-
-
-
-"""
-
-#-----------------------------------------------------------------------------
-# Copyright (c) 2013, 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.
-#-----------------------------------------------------------------------------
-
-from .data_structures import \
-      TigerGrid, \
-      TigerHierarchy, \
-      TigerStaticOutput
-
-from .fields import \
-      TigerFieldInfo, \
-      add_tiger_field
-
-from .io import \
-      IOHandlerTiger

diff -r 34f821e4b5f24d61dd946f19716dc65db01cf11a -r 9d6a692bfef164ffeb8cc9b61294d93cc153fbd8 yt/frontends/tiger/data_structures.py
--- a/yt/frontends/tiger/data_structures.py
+++ /dev/null
@@ -1,195 +0,0 @@
-"""
-TIGER-specific data structures
-
-
-
-"""
-
-#-----------------------------------------------------------------------------
-# Copyright (c) 2013, 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.
-#-----------------------------------------------------------------------------
-
-from yt.funcs import *
-from yt.data_objects.grid_patch import \
-           AMRGridPatch
-from yt.geometry.grid_geometry_handler import \
-           GridGeometryHandler
-from yt.data_objects.static_output import \
-           StaticOutput
-
-from yt.data_objects.field_info_container import \
-    FieldInfoContainer, NullFunc
-from .fields import TigerFieldInfo, KnownTigerFields
-
-class TigerGrid(AMRGridPatch):
-    _id_offset = 0
-
-    def __init__(self, id, hierarchy, left_edge, right_edge, left_dims, right_dims):
-        AMRGridPatch.__init__(self, id, hierarchy = hierarchy)
-        self.LeftEdge = left_edge
-        self.RightEdge = right_edge
-        self.Level = 0
-        self.NumberOfParticles = 0
-        self.left_dims = np.array(left_dims, dtype='int32')
-        self.right_dims = np.array(right_dims, dtype='int32')
-        self.ActiveDimensions = self.right_dims - self.left_dims
-        self.Parent = None
-        self.Children = []
-
-    @property
-    def child_mask(self):
-        return np.ones(self.ActiveDimensions, dtype='int32')
-
-    def __repr__(self):
-        return "TigerGrid_%04i (%s)" % (self.id, self.ActiveDimensions)
-
-class TigerHierarchy(GridGeometryHandler):
-
-    grid = TigerGrid
-
-    def __init__(self, pf, data_style):
-        self.directory = pf.fullpath
-        self.data_style = data_style
-        GridGeometryHandler.__init__(self, pf, data_style)
-
-    def _count_grids(self):
-        # Tiger is unigrid
-        self.ngdims = [i/j for i,j in
-                izip(self.pf.root_size, self.pf.max_grid_size)]
-        self.num_grids = np.prod(self.ngdims)
-        self.max_level = 0
-
-    def _setup_classes(self):
-        dd = self._get_data_reader_dict()
-        GridGeometryHandler._setup_classes(self, dd)
-        self.object_types.sort()
-
-    def _parse_hierarchy(self):
-        grids = []
-        # We need to fill in dims, LE, RE, level, count
-        dims, LE, RE, levels, counts = [], [], [], [], []
-        DLE = self.pf.domain_left_edge
-        DRE = self.pf.domain_right_edge 
-        DW = DRE - DLE
-        gds = DW / self.ngdims
-        rd = [self.pf.root_size[i]-self.pf.max_grid_size[i] for i in range(3)]
-        glx, gly, glz = np.mgrid[DLE[0]:DRE[0]-gds[0]:self.ngdims[0]*1j,
-                                 DLE[1]:DRE[1]-gds[1]:self.ngdims[1]*1j,
-                                 DLE[2]:DRE[2]-gds[2]:self.ngdims[2]*1j]
-        gdx, gdy, gdz = np.mgrid[0:rd[0]:self.ngdims[0]*1j,
-                                 0:rd[1]:self.ngdims[1]*1j,
-                                 0:rd[2]:self.ngdims[2]*1j]
-        LE, RE, levels, counts = [], [], [], []
-        i = 0
-        for glei, gldi in izip(izip(glx.flat, gly.flat, glz.flat),
-                               izip(gdx.flat, gdy.flat, gdz.flat)):
-            gld = np.array(gldi)
-            gle = np.array(glei)
-            gre = gle + gds
-            g = self.grid(i, self, gle, gre, gld, gld+self.pf.max_grid_size)
-            grids.append(g)
-            dims.append(self.pf.max_grid_size)
-            LE.append(g.LeftEdge)
-            RE.append(g.RightEdge)
-            levels.append(g.Level)
-            counts.append(g.NumberOfParticles)
-            i += 1
-        self.grids = np.empty(len(grids), dtype='object')
-        for gi, g in enumerate(grids): self.grids[gi] = g
-        self.grid_dimensions[:] = np.array(dims, dtype='int64')
-        self.grid_left_edge[:] = np.array(LE, dtype='float64')
-        self.grid_right_edge[:] = np.array(RE, dtype='float64')
-        self.grid_levels.flat[:] = np.array(levels, dtype='int32')
-        self.grid_particle_count.flat[:] = np.array(counts, dtype='int32')
-
-    def _populate_grid_objects(self):
-        # We don't need to do anything here
-        for g in self.grids: g._setup_dx()
-
-    def _detect_fields(self):
-        self.file_mapping = {"Density" : "rhob",
-                             "Temperature" : "temp"}
-
-    @property
-    def field_list(self):
-        return self.file_mapping.keys()
-
-    def _setup_derived_fields(self):
-        self.derived_field_list = []
-
-class TigerStaticOutput(StaticOutput):
-    _hierarchy_class = TigerHierarchy
-    _fieldinfo_fallback = TigerFieldInfo
-    _fieldinfo_known = KnownTigerFields
-
-    def __init__(self, rhobname, root_size, max_grid_size=128,
-                 data_style='tiger', storage_filename = None):
-        StaticOutput.__init__(self, rhobname, data_style)
-        self.storage_filename = storage_filename
-        self.basename = rhobname[:-4]
-        if not os.path.exists(self.basename + "rhob"):
-            print "%s doesn't exist, don't know how to handle this!" % (
-                        self.basename + "rhob")
-            raise IOError
-        if not iterable(root_size): root_size = (root_size,) * 3
-        self.root_size = root_size
-        if not iterable(max_grid_size): max_grid_size = (max_grid_size,) * 3
-        self.max_grid_size = max_grid_size
-
-        self.field_info = FieldInfoContainer.create_with_fallback(
-                            self._fieldinfo_fallback)
-
-        # We assume that we have basename + "rhob" and basename + "temp"
-        # to get at our various parameters.
-
-        # First we get our our header:
-        
-        header = [
-            ('i', 'dummy0'),
-            ('f', 'ZR'),
-            ('f', 'OMEGA0'),
-            ('f', 'FLAM0'),
-            ('f', 'OMEGAB'),
-            ('f', 'H0'),
-            ('f', 'BOXL0'),
-            ('i', 'dummy1'),
-            ]
-
-        h_fmt, h_key = zip(*header)
-        header_string = "".join(h_fmt)
-
-        fs = open(self.basename + "rhob")
-        header_raw = read_struct(fs, header_string)
-        self.parameters.update(dict(zip(h_key, header_raw)))
-
-        if "InitialTime" not in self.parameters:
-            self.current_time = 0.0
-        self.unique_identifier = \
-            int(os.stat(self.parameter_filename)[ST_CTIME])
-        self.parameters['TopGridDimensions'] = root_size
-        self.parameters['TopGridRank'] = 3
-        self.units["Density"] = 1.0
-        self.parameters['RefineBy'] = 2
-
-    def _set_units(self):
-        self.domain_left_edge = np.zeros(3, dtype='float64')
-        self.domain_right_edge = np.ones(3, dtype='float64')
-        self.units = {}
-        self.time_units = {}
-        self.time_units['1'] = 1
-        self.units['1'] = 1.0
-        self.units['cm'] = 1.0 # This is just plain false
-        self.units['unitary'] = 1.0 / (self["DomainRightEdge"] - self["DomainLeftEdge"]).max()
-
-    def _parse_parameter_file(self):
-        pass
-
-    @classmethod
-    def _is_valid(self, *args, **kwargs):
-        return os.path.exists(args[0] + "rhob")
-
-

diff -r 34f821e4b5f24d61dd946f19716dc65db01cf11a -r 9d6a692bfef164ffeb8cc9b61294d93cc153fbd8 yt/frontends/tiger/fields.py
--- a/yt/frontends/tiger/fields.py
+++ /dev/null
@@ -1,31 +0,0 @@
-"""
-Tiger-specific fields
-
-
-
-"""
-
-#-----------------------------------------------------------------------------
-# Copyright (c) 2013, 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.
-#-----------------------------------------------------------------------------
-
-from yt.data_objects.field_info_container import \
-    FieldInfoContainer, \
-    FieldInfo, \
-    ValidateParameter, \
-    ValidateDataField, \
-    ValidateProperty, \
-    ValidateSpatial, \
-    ValidateGridType
-import yt.fields.universal_fields
-
-KnownTigerFields = FieldInfoContainer()
-add_tiger_field = KnownTigerFields.add_field
-
-TigerFieldInfo = FieldInfoContainer.create_with_fallback(FieldInfo)
-add_field = TigerFieldInfo.add_field
-

diff -r 34f821e4b5f24d61dd946f19716dc65db01cf11a -r 9d6a692bfef164ffeb8cc9b61294d93cc153fbd8 yt/frontends/tiger/io.py
--- a/yt/frontends/tiger/io.py
+++ /dev/null
@@ -1,33 +0,0 @@
-"""
-TIGER-specific IO functions
-
-
-
-"""
-
-#-----------------------------------------------------------------------------
-# Copyright (c) 2013, 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.
-#-----------------------------------------------------------------------------
-
-from yt.utilities.io_handler import \
-           BaseIOHandler
-
-class IOHandlerTiger(BaseIOHandler):
-    _data_style = "tiger"
-    _offset = 36
-
-    def __init__(self, *args, **kwargs):
-        BaseIOHandler.__init__(self, *args, **kwargs)
-        self._memmaps = {}
-
-    def _read_data(self, grid, field):
-        fn = grid.pf.basename + grid.hierarchy.file_mapping[field]
-        LD = np.array(grid.left_dims, dtype='int64')
-        SS = np.array(grid.ActiveDimensions, dtype='int64')
-        RS = np.array(grid.pf.root_size, dtype='int64')
-        data = au.read_tiger_section(fn, LD, SS, RS).astype("float64")
-        return data

diff -r 34f821e4b5f24d61dd946f19716dc65db01cf11a -r 9d6a692bfef164ffeb8cc9b61294d93cc153fbd8 yt/frontends/tiger/setup.py
--- a/yt/frontends/tiger/setup.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env python
-import setuptools
-import os
-import sys
-import os.path
-
-
-def configuration(parent_package='', top_path=None):
-    from numpy.distutils.misc_util import Configuration
-    config = Configuration('tiger', parent_package, top_path)
-    config.make_config_py()  # installs __config__.py
-    #config.make_svn_version_py()
-    return config

diff -r 34f821e4b5f24d61dd946f19716dc65db01cf11a -r 9d6a692bfef164ffeb8cc9b61294d93cc153fbd8 yt/mods.py
--- a/yt/mods.py
+++ b/yt/mods.py
@@ -84,15 +84,9 @@
 from yt.frontends.flash.api import \
     FLASHStaticOutput, FLASHFieldInfo, add_flash_field
 
-from yt.frontends.tiger.api import \
-    TigerStaticOutput, TigerFieldInfo, add_tiger_field
-
 from yt.frontends.artio.api import \
     ARTIOStaticOutput, ARTIOFieldInfo, add_artio_field
 
-#from yt.frontends.artio2.api import \
-#    Artio2StaticOutput
-
 from yt.frontends.ramses.api import \
     RAMSESStaticOutput, RAMSESFieldInfo, add_ramses_field

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

--

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