djpugh / MTfit

MTfit code for Bayesian Moment Tensor Fitting
78 stars 17 forks source link

cprobability exception #58

Open SquirrelKnight opened 5 years ago

SquirrelKnight commented 5 years ago

Please fill in the following details as much as possible when submitting your issue as this will help with testing and reproducing the issue

Environment Information

{ "version": "1.0.5", "c_extensions present": [ "cmarkov_chain_monte_carlo", "cprobability", "cmoment_tensor_conversion", "cscatangle" ], "platform": "darwin", "num_threads": 8, "python version": "3.7.1 (default, Dec 14 2018, 13:28:58) \n[Clang 4.0.1 (tags/RELEASE_401/final)]", "python version info": [ 3, 7, 1, "final", 0 ], "dependency info": { "numpy": "1.15.4", "scipy": "1.1.0", "matplotlib": "3.0.2", "cython": "0.29.2", "sphinx": "1.8.2", "h5py": "2.8.0" } }

What error you are getting

Error running cython code Traceback (most recent call last): File "/Users/jesse/anaconda3/lib/python3.7/site-packages/MTfit/probability/probability.py", line 871, in ln_marginalise return cprobability.ln_marginalise(ln_pdf.astype(np.float64)) File "src/MTfit/probability/cprobability.pyx", line 130, in MTfit.probability.cprobability.ln_marginalise ValueError: Buffer has wrong number of dimensions (expected 2, got 1) Error running cython code Traceback (most recent call last): File "/Users/jesse/anaconda3/lib/python3.7/site-packages/MTfit/probability/probability.py", line 1269, in exp return cprobability.ln_exp(self._ln_pdf) File "src/MTfit/probability/cprobability.pyx", line 1817, in MTfit.probability.cprobability.ln_exp ValueError: Buffer has wrong number of dimensions (expected 1, got 2)

What behaviour you would expect

To not get the errors, hopefully!

Reproduction steps

This occurs after every inversion I have attempted. I could send in the input pickle file to see if the issue can be reproduced.

djpugh commented 5 years ago

Hi @SquirrelKnight, thanks for this - I will have a look to see if I can reproduce it - is this blocking the run (it should try again if an error is thrown) - I think I have reproduced and it is an "expected" error - I'll update the code so that it is caught

SquirrelKnight commented 5 years ago

Hi @djpugh ,

It doesn't block the program, and I still seem to get results just fine.

djpugh commented 5 years ago

I've updated the logging to make it clearer about the errors not being important - #60 - need to fix some tests which I may have a chance to do soon, but both this error and the one in #59 should be handled more nicely