BellaNasirudin / py21cmmc_fg

A foreground and instrumental plugin for py21cmmc
MIT License
1 stars 4 forks source link

Bug from repo updates #23

Closed BellaNasirudin closed 6 years ago

BellaNasirudin commented 6 years ago

I don't know how this version works on your computer but I got this error when I ran commit 0c1e69c2adca54776b9740e9094977e6430ff0e6

python gridded_noise_psfg.py /home/bella/powerbox/powerbox/dft.py:51: UserWarning: You do not have pyFFTW installed. Installing it should give some speed increase. warnings.warn("You do not have pyFFTW installed. Installing it should give some speed increase.") global_xH = 6.626352e-01 Ave Tb = 1.493917e+01 global_xH = 5.834840e-01 Ave Tb = 1.242552e+01 global_xH = 4.949036e-01 Ave Tb = 9.901784e+00 Traceback (most recent call last): File "gridded_noise_psfg.py", line 38, in continue_sampling=False # Whether to contine sampling from previous run up to sampleIterations. File "/home/bella/Projects/Parameter_estimation_21cmmc/Codes/py21cmmc_fg/devel/test_series/base_definitions.py", line 103, in run_mcmc **kwargs File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc-0.1.0-py3.6-linux-x86_64.egg/py21cmmc/mcmc/mcmc.py", line 93, in run_mcmc chain = build_computation_chain(core_modules, likelihood_modules, params) File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc-0.1.0-py3.6-linux-x86_64.egg/py21cmmc/mcmc/mcmc.py", line 37, in build_computation_chain chain.setup() File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc-0.1.0-py3.6-linux-x86_64.egg/py21cmmc/mcmc/cosmoHammer/LikelihoodComputationChain.py", line 82, in setup cModule.setup() File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc_fg-0.1.0-py3.6-linux-x86_64.egg/py21cmmc_fg/likelihood.py", line 300, in setup super().setup() File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc-0.1.0-py3.6-linux-x86_64.egg/py21cmmc/mcmc/likelihood.py", line 116, in setup simctx = self.default_simulated_ctx File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc-0.1.0-py3.6-linux-x86_64.egg/py21cmmc/mcmc/likelihood.py", line 85, in default_simulated_ctx return chain.core_simulated_context() File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc-0.1.0-py3.6-linux-x86_64.egg/py21cmmc/mcmc/cosmoHammer/LikelihoodComputationChain.py", line 24, in core_simulated_context m.simulate_data(ctx) File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc_fg-0.1.0-py3.6-linux-x86_64.egg/py21cmmc_fg/core.py", line 533, in simulate_data total_brightness = self.stitch_and_coarsen(total_brightness) File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc_fg-0.1.0-py3.6-linux-x86_64.egg/py21cmmc_fg/core.py", line 853, in stitch_and_coarsen new = cw.stitch_and_coarsen_sky(lightcone, self.sim_sky_size, self.sky_size, self.n_cells) File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc_fg-0.1.0-py3.6-linux-x86_64.egg/py21cmmc_fg/c_wrapper.py", line 36, in stitch_and_coarsen_sky cfunc = ctypes.CDLL(fl).stitch_and_coarsen_sky File "/home/bella/anaconda2/envs/21cmmc/lib/python3.6/ctypes/init.py", line 348, in init self._handle = _dlopen(self._name, mode) OSError: /home/bella/anaconda2/envs/21cmmc/lib/python3.6/site-packages/py21cmmc_fg-0.1.0-py3.6-linux-x86_64.egg/py21cmmc_fg/c_routines.py: invalid ELF header

BellaNasirudin commented 6 years ago

Fixed this with fbb2ac02d5e993f0aedf4eac7136343ba77d4bc6

steven-murray commented 6 years ago

That's strange... I didn't have a c_routines.py file on my system for it to try to read in. I did get this error at first, because I chose to call the C module "routines" which then tried to read in "routines.c" instead of "routines.cpython.*". But I fixed that by calling the module "c_routines". It should be unambiguous, without your fix. But, your fix will also work!