jacopo-chevallard / PyP-BEAGLE

4 stars 1 forks source link

Summary Catalog Error with "compute" #20

Closed hakimatek closed 7 years ago

hakimatek commented 7 years ago

BEAGLE_0.9.2

I get an error with the compute function when trying to run my_photometry.summary_catalogue.compute I use the default summary_config.json file.

error message:
 File "A370_z7.py", line 87, in <module>
 my_photometry.summary_catalogue.compute(file_list)
TypeError: compute() takes at least 3 arguments (2 given)

the compute function seems to take indeed one more argument but was not able to fix it.

jacopo-chevallard commented 7 years ago

can you try to pull the latest master and retry?

hakimatek commented 7 years ago

I am still getting the same error.

jacopo-chevallard commented 7 years ago

that's strange, can you check that your local file PyP-BEAGLE/PyP-BEAGLE/beagle_summary_catalogue.py correspond to the file https://github.com/jacopo-chevallard/PyP-BEAGLE/blob/5cc00b28316d14c27cd90481d1e2760049a77001/PyP-BEAGLE/beagle_summary_catalogue.py

hakimatek commented 7 years ago

yes, it's the same.

jacopo-chevallard commented 7 years ago

then modify the test, replacing the line

my_photometry.summary_catalogue.compute(file_list)

with

name = os.path.join(BeagleDirectories.results_dir, args.summary_config)
my_photometry.summary_catalogue.compute(file_list, name)
hakimatek commented 7 years ago

I get the following error:

Traceback (most recent call last):
  File "A370_z7.py", line 97, in <module>
    my_photometry.summary_catalogue.compute(file_list, name)
  File "../PyP-BEAGLE/beagle_summary_catalogue.py", line 130, in compute
    hdu_name = hdu['name']
TypeError: string indices must be integers
jacopo-chevallard commented 7 years ago

same error if you use

my_photometry.summary_catalogue.compute(file_list, config_file=name)

?

hakimatek commented 7 years ago

same error

jacopo-chevallard commented 7 years ago

hakim, can you try to use the new version of PyP-Beagle, installed through pip (see the mail that you should have received earlier today), and let me know if you can finally compute the summary catalogue?

hakimatek commented 7 years ago

I tried with the new version and same error (see below).

also, I can't reach any of the beagle or pyp-beagle pages on github.

Hakim.

python A370_z7.py -r ~/BEAGLE-general-master/results/A370_z7 -p ~/BEAGLE-general-master/params/fit_A370_z7.param -s params_names.json --ID-key ID

Traceback (most recent call last):

File "A370_z7.py", line 97, in

my_photometry.summary_catalogue.compute(file_list, config_file=name)

File "../PyP-BEAGLE/beagle_summary_catalogue.py", line 130, in compute

hdu_name = hdu['name']

TypeError: string indices must be integers

bash-3.2$ python A370_z7.py -r ~/BEAGLE-general-master/results/A370_z7 -p ~/BEAGLE-general-master/params/fit_A370_z7.param -s params_names.json --ID-key ID

Traceback (most recent call last):

File "A370_z7.py", line 97, in

my_photometry.summary_catalogue.compute(file_list, config_file=name)

File "../PyP-BEAGLE/beagle_summary_catalogue.py", line 130, in compute

hdu_name = hdu['name']

TypeError: string indices must be integers

On Thu, Mar 30, 2017 at 4:39 PM, Jacopo Chevallard <notifications@github.com

wrote:

hakim, can you try to use the new version of PyP-Beagle, installed through pip (see the mail that you should have received earlier today), and let me know if you can finally compute the summary catalogue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jacopo-chevallard/PyP-BEAGLE/issues/20#issuecomment-290431817, or mute the thread https://github.com/notifications/unsubscribe-auth/ATDa2h0OohXyEz08C9fLozWN93vRIBNxks5rq76_gaJpZM4L7N5z .

jacopo-chevallard commented 7 years ago

Instead of calling your own python script you should install PyP-BEAGLE through pip

pip install pyp_beagle

then (opening a new terminal after the installation) launch

pyp_beagle -r <your Beagle results folder> 
--compute-summary
--json-summary <JSON summary file>

see here for a more detailed explanation.

You are among the collaborators of this repo, so it's either a problem with GitHub itself, or, perhaps, you're not logged in with the right account.

hakimatek commented 7 years ago

OK, now it seems to work.

I wasn't calling my own script. I just modified test_photometry.py as suggested by uncommenting "my_photometry.summary_catalogue.compute(file_list)"

jacopo-chevallard commented 7 years ago

ok, excellent, closing this issue then!