[yt-svn] commit/yt: MatthewTurk: Removing the astro_objects directory, which was an ill-motivated idea.
Bitbucket
commits-noreply at bitbucket.org
Mon Apr 30 13:21:10 PDT 2012
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/changeset/70d4bc3d4968/
changeset: 70d4bc3d4968
branch: yt
user: MatthewTurk
date: 2012-04-30 22:17:39
summary: Removing the astro_objects directory, which was an ill-motivated idea.
affected #: 7 files
diff -r c0acbf8d43778f223f414504048c0a3278bbfb24 -r 70d4bc3d4968ac4bed97eaeb969fb3ec9f64bc16 yt/astro_objects/api.py
--- a/yt/astro_objects/api.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""
-API for yt.astro_objects
-
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: Columbia University
-Homepage: http://yt-project.org/
-License:
- Copyright (C) 2011 Matthew Turk. All Rights Reserved.
-
- This file is part of yt.
-
- yt is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""
-
-from .astrophysical_object import \
- AstrophysicalObject, identification_method, correlation_method
-
-from .simulation_volume import \
- SimulationVolume
-
-from .clumped_region import \
- ClumpedRegion
diff -r c0acbf8d43778f223f414504048c0a3278bbfb24 -r 70d4bc3d4968ac4bed97eaeb969fb3ec9f64bc16 yt/astro_objects/astrophysical_object.py
--- a/yt/astro_objects/astrophysical_object.py
+++ /dev/null
@@ -1,90 +0,0 @@
-"""
-A base-class representing an astrophysical object
-
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: Columbia University
-Homepage: http://yt-project.org/
-License:
- Copyright (C) 2011 Matthew Turk. All Rights Reserved.
-
- This file is part of yt.
-
- yt is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-"""
-
-astro_object_registry = {}
-
-class AstrophysicalObject(object):
- # No _type_name
- _skip_add = False
-
- class __metaclass__(type):
- def __init__(cls, name, b, d):
- type.__init__(cls, name, b, d)
- if hasattr(cls, "_type_name") and not cls._skip_add:
- astro_object_registry[cls._type_name] = cls
- cls.identification_methods = {}
- cls.correlation_methods = {}
-
- def _lookup_object(self, obj_name):
- if obj_name not in astro_object_registry:
- raise KeyError(obj_name)
- return astro_object_registry[obj_name]
-
- def correlate(self, other_collection, correlation_name):
- pass
-
- def __init__(self, data_source):
- self.objects = {}
- # We mandate that every object have a corresponding AMR3DData source
- # affiliated with it.
- self.data_source = data_source
-
- def find(self, obj_name, identification_name, *args, **kwargs):
- obj = self._lookup_object(obj_name)
- if callable(identification_name):
- identification_method = identification_name
- else:
- if identification_name not in obj.identification_methods:
- raise KeyError(identification_name)
- identification_method = \
- obj.identification_methods[identification_name]
- new_objs = identification_method(self, *args, **kwargs)
- setattr(self, obj_name, new_objs)
- self.objects[obj_name] = new_objs
- return new_objs
-
- def correlate(self, other_set, correlation_name, *args, **kwargs):
- if callable(correlation_name):
- correlation_method = correlation_name
- else:
- if correlation_name not in self.correlation_methods:
- raise KeyError(correlation_name)
- correlation_method = self.correlation_methods[correlation_name]
- linked_objs = correlation_method(self, *args, **kwargs)
- return linked_objs
-
-def correlation_method(obj_name, link_name):
- def passthrough(func):
- obj = astro_object_registry[obj_name]
- obj.correlation_methods[link_name] = func
- return func
- return passthrough
-
-def identification_method(obj_name, id_name):
- def passthrough(func):
- obj = astro_object_registry[obj_name]
- obj.identification_methods[id_name] = func
- return func
- return passthrough
diff -r c0acbf8d43778f223f414504048c0a3278bbfb24 -r 70d4bc3d4968ac4bed97eaeb969fb3ec9f64bc16 yt/astro_objects/clumped_region.py
--- a/yt/astro_objects/clumped_region.py
+++ /dev/null
@@ -1,39 +0,0 @@
-"""
-A base-class representing an astrophysical object
-
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: Columbia University
-Homepage: http://yt-project.org/
-License:
- Copyright (C) 2011 Matthew Turk. All Rights Reserved.
-
- This file is part of yt.
-
- yt is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-"""
-
-from .astrophysical_object import \
- AstrophysicalObject, identification_method, correlation_method
-
-class ClumpedRegion(AstrophysicalObject):
- _type_name = "clumped_region"
- def __init__(self, data_source):
- AstrophysicalObject.__init__(self, data_source)
-
- at identification_method("clumped_region", "level_set")
-def clumps(obj, field, min_val):
- ds = obj.data_source
- mi, ma = ds.quantities["Extrema"](field)[0]
- cls = obj.data_source.extract_connected_sets(field, 1, min_val, ma)
- return [ClumpedRegion(o) for o in cls[1][0]]
diff -r c0acbf8d43778f223f414504048c0a3278bbfb24 -r 70d4bc3d4968ac4bed97eaeb969fb3ec9f64bc16 yt/astro_objects/setup.py
--- a/yt/astro_objects/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('astro_objects', parent_package, top_path)
- config.make_config_py() # installs __config__.py
- #config.make_svn_version_py()
- return config
diff -r c0acbf8d43778f223f414504048c0a3278bbfb24 -r 70d4bc3d4968ac4bed97eaeb969fb3ec9f64bc16 yt/astro_objects/simulation_volume.py
--- a/yt/astro_objects/simulation_volume.py
+++ /dev/null
@@ -1,32 +0,0 @@
-"""
-An AstrophysicalObject that represents a simulation volume
-
-Author: Matthew Turk <matthewturk at gmail.com>
-Affiliation: Columbia University
-Homepage: http://yt-project.org/
-License:
- Copyright (C) 2011 Matthew Turk. All Rights Reserved.
-
- This file is part of yt.
-
- yt is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-"""
-
-from .astrophysical_object import \
- AstrophysicalObject, identification_method, correlation_method
-
-class SimulationVolume(AstrophysicalObject):
- _type_name = "simulation_volume"
- def __init__(self, data_source):
- AstrophysicalObject.__init__(self, data_source)
diff -r c0acbf8d43778f223f414504048c0a3278bbfb24 -r 70d4bc3d4968ac4bed97eaeb969fb3ec9f64bc16 yt/setup.py
--- a/yt/setup.py
+++ b/yt/setup.py
@@ -8,7 +8,6 @@
from numpy.distutils.misc_util import Configuration
config = Configuration('yt', parent_package, top_path)
config.add_subpackage('analysis_modules')
- config.add_subpackage('astro_objects')
config.add_subpackage('data_objects')
config.add_subpackage('frontends')
config.add_subpackage('gui')
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