Closed ACCarnall closed 8 years ago
I've tried running this on a couple of the other objects and I've hit a couple of other errors as well as some objects for which the code works fine:
Traceback (most recent call last):
File "test_spectra.py", line 67, in <module>
my_PDF.plot_triangle(ID)
File "/Users/adam/PyP-BEAGLE/PyP-BEAGLE/beagle_pdf.py", line 177, in plot_triangle
g.triangle_plot(samples, filled=True, line_args=line_args)
File "/Library/Python/2.7/site-packages/getdist/plots.py", line 1829, in triangle_plot
label_right=True, no_zero=True, no_ylabel=True, no_ytick=True, line_args=line_args)
File "/Library/Python/2.7/site-packages/getdist/plots.py", line 1299, in plot_1d
bounds = self.add_1d(root, root_param, i, normalized=normalized, **line_args[i])
File "/Library/Python/2.7/site-packages/getdist/plots.py", line 807, in add_1d
density = self.sampleAnalyser.get_density(root, param, likes=self.settings.plot_meanlikes)
File "/Library/Python/2.7/site-packages/getdist/plots.py", line 528, in get_density
density = samples.get1DDensityGridData(name, meanlikes=likes)
File "/Library/Python/2.7/site-packages/getdist/mcsamples.py", line 1265, in get1DDensityGridData
bins = np.bincount(bin_indices, weights=self.weights, minlength=fine_bins)
ValueError: The first argument of bincount must be non-negative
Traceback (most recent call last):
File "test_spectra.py", line 67, in <module>
my_PDF.plot_triangle(ID)
File "/Users/adam/PyP-BEAGLE/PyP-BEAGLE/beagle_pdf.py", line 177, in plot_triangle
g.triangle_plot(samples, filled=True, line_args=line_args)
File "/Library/Python/2.7/site-packages/getdist/plots.py", line 1831, in triangle_plot
if self.settings.no_triangle_axis_labels: self._spaceTicks(ax.xaxis)
File "/Library/Python/2.7/site-packages/getdist/plots.py", line 1726, in _spaceTicks
lims = [min(tick[0] - gap_wanted, lims[0]), max(tick[-1] + gap_wanted, lims[1])]
IndexError: list index out of range
Do you think this could be an error with the results of BEAGLE or just with PyP-BEAGLE? The spectral plots look fine for all but a couple of objects (one is the same, but the rest are different). I can send any more information you think may be helpful.
Hi Adam, these errors seem all be related to the getdist
package on which PyP-BEAGLE
depends...
Can you check which version of getdist
you're using? you can just run
head /Library/Python/2.7/site-packages/getdist/__init__.py
My version is 0.2.4
.
Then, if you want me to check this error, you should put all the relevant files (Beagle input and output) into a Dropbox folder and link it here
Thanks Jacopo, I originally had version 0.2.5, but I've downgraded back to 0.2.4 and I'm still receiving the same error messages.
The dropbox link is here: https://www.dropbox.com/sh/dkgyj6wa2h7zom8/AAC6CJ-Z2pvWL-QMkPXnHU45a?dl=0
Note that I've made some changes to beagle_spectra.py within PyP-BEAGLE to get it to show the correct wavelength range on the marginal plots, my edited version of the file is also included.
I can reproduce the first error, more soon...
I understood the roots of the problem, I tried to open a issue here, let's see if the author of getdist
(Antony Lewis) can help us
@ACCarnall As you can see from the issue linked above, Antony quickly replied, and we are trying to fix the problem
Thanks a lot Jacopo!
@ACCarnall I think it would greatly accelerate the debugging providing Antony with a full working example of the problem, i.e. a tar archive containing all the python code and input files necessary to reproduce the error. Can you take care of this and put the archive on the issue linked above?
Hi Jacopo, so would a tar file of the things I put on dropbox for you last week suffice?
I'm afraid not, since this person knows nothing about Beagle. We should provide him with all the python routines and input files, and a very simple bash script which will call the python routines with the correct arguments, the material must be prepared in such a way that the only thing that Antony has to do is to launch the script and get the error.
Ideally, you would test this on a machine where PyP-BEAGLE is not present, and find which files are necessary to reproduce the error. I can help you if you get stuck somewhere.
Hi Jacopo, I've created this example, the only dependency that I guess he might not have is astropy, but I'm not sure how to remove that as a dependency? I've changed the beagle_pdf file so it doesn't rely on any other beagle files, but haven't deleted anything else from it to make it simpler as I wasn't sure what was important and what wasn't! Running test.py produces the error.
Great, well done!!
Happy for me to post it to the other thread or would you like to make some changes?
Oups, I did already, as I was able to run it as well! You should have received a notification, as I cited you in the thread
Closing, let me know if need to re-open!
I've modified the test_spectra example for use with my spectrophotomeric fits, my test_spectra file looks like this:
This runs fine on the first four objects, but when it comes to the fifth corner plot I get the following error:
I'm not sure whether the warnings that appear earlier on might be related to the eventual problem.