From bf46d6b9f42330b42f4634ea6ac0e2b318942786 Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Thu, 19 Jan 2012 21:36:19 -0500 Subject: Implement new loader function that turns a string into a Geometry, searching through files, named geometries in the cache, and geometry creation functions. The loader function also is responsible for fetching or creating a BVH to go with the geometry. This commit also removes some code that has been replaced by the new system. Other bits will come back in future commits. --- bin/chroma-sim | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'bin/chroma-sim') diff --git a/bin/chroma-sim b/bin/chroma-sim index 854817a..ca1463c 100755 --- a/bin/chroma-sim +++ b/bin/chroma-sim @@ -19,6 +19,7 @@ def main(): from chroma.io import root from chroma.rootimport import ROOT from chroma.tools import enable_debug_on_crash + import chroma.loader ROOT.gROOT.SetBatch() @@ -78,17 +79,7 @@ def main(): if options.debug: enable_debug_on_crash() - module_name, function_name = args[0].rsplit('.', 1) - - try: - module = __import__(module_name, fromlist=[function_name]) - except ImportError: - raise - - detector = getattr(module, function_name) - - if inspect.isfunction(detector): - detector = detector() + detector = chroma.loader.load_geometry_from_string(args[0]) pos = np.array([float(s) for s in options.pos.split(',')], dtype=float) dir = np.array([float(s) for s in options.dir.split(',')], dtype=float) -- cgit