aconley / mbb_emcee Goto Github PK
View Code? Open in Web Editor NEWModified blackbody MCMC code
Modified blackbody MCMC code
MBB runs perfectly fine with with filter set to delta function and res = mbb_emcee.mbb_results(h5file)
loads fine.
However I kept getting KeyError: 'mbb_emcee/resources/'
when I run res = mbb_emcee.mbb_results(h5file)
on an .h5 file that was generated when response function.
/Users/admin/anaconda/lib/python2.7/site-packages/mbb_emcee-0.5.1-py2.7-macosx-10.5-x86_64.egg/mbb_emcee/results.pyc in __init__(self, fit, h5file, redshift, lumdist, cosmo_type)
82
83 if not h5file is None:
---> 84 self.readFromHDF5(h5file)
85 else:
86 if redshift is None:
/Users/admin/anaconda/lib/python2.7/site-packages/mbb_emcee-0.5.1-py2.7-macosx-10.5-x86_64.egg/mbb_emcee/results.pyc in readFromHDF5(self, filename)
1086 errmsg = "Didn't find expected responses in {:s}"
1087 raise ValueError(errmsg.format(filename))
-> 1088 self._responsewheel = response_set()
1089 self._responsewheel.readFromHDF5(f["Responses"])
1090
/Users/admin/anaconda/lib/python2.7/site-packages/mbb_emcee-0.5.1-py2.7-macosx-10.5-x86_64.egg/mbb_emcee/response.pyc in __init__(self, inputfile, dir)
582 self._responses = {}
583 # Note this loads a default if inputfile is None
--> 584 self.read(inputfile=inputfile, dir=dir)
585
586 def read(self, inputfile=None, dir=None):
/Users/admin/anaconda/lib/python2.7/site-packages/mbb_emcee-0.5.1-py2.7-macosx-10.5-x86_64.egg/mbb_emcee/response.pyc in read(self, inputfile, dir)
606 infile = resource_filename(__name__,
607 'resources/mbb_filterwheel.txt')
--> 608 indir = resource_filename(__name__, 'resources/')
609 elif not isinstance(inputfile, basestring):
610 raise TypeError("filename must be string-like")
/Users/admin/anaconda/lib/python2.7/site-packages/pkg_resources.pyc in resource_filename(self, package_or_requirement, resource_name)
948 """Return a true filesystem path for specified resource"""
949 return get_provider(package_or_requirement).get_resource_filename(
--> 950 self, resource_name
951 )
952
/Users/admin/anaconda/lib/python2.7/site-packages/pkg_resources.pyc in get_resource_filename(self, manager, resource_name)
1644 for name in eagers:
1645 self._extract_resource(manager, self._eager_to_zip(name))
-> 1646 return self._extract_resource(manager, zip_path)
1647
1648 @staticmethod
/Users/admin/anaconda/lib/python2.7/site-packages/pkg_resources.pyc in _extract_resource(self, manager, zip_path)
1665 return os.path.dirname(last)
1666
-> 1667 timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])
1668
1669 if not WRITE_SUPPORT:
KeyError: 'mbb_emcee/resources/'
I tried adding the following lines to response.py, but it seems like it is still reading if inputfile is None:
(response.read()) when I try to load the results.
inputfile = 'mbb_filterwheel.txt'
indir = '/Users/admin/mbb_emcee/mbb_emcee/resources'
Any thoughts? Thanks.
Daisy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.