diff options
author | Stan Seibert <stan@mtrr.org> | 2012-01-19 21:36:19 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2021-05-09 08:42:38 -0700 |
commit | bf46d6b9f42330b42f4634ea6ac0e2b318942786 (patch) | |
tree | 5b18635fcc5228c8326ab5cd43a35d38575c1215 /bin/chroma-sim | |
parent | 3aa00b69bf01f6b2a2f920642f8faa6a52bbb1c4 (diff) | |
download | chroma-bf46d6b9f42330b42f4634ea6ac0e2b318942786.tar.gz chroma-bf46d6b9f42330b42f4634ea6ac0e2b318942786.tar.bz2 chroma-bf46d6b9f42330b42f4634ea6ac0e2b318942786.zip |
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.
Diffstat (limited to 'bin/chroma-sim')
-rwxr-xr-x | bin/chroma-sim | 13 |
1 files changed, 2 insertions, 11 deletions
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) |