sweverett/CluStR

Complete first-pass run of updated pipeline

Closed this issue · 12 comments

It's hard to keep momentum up when trying to finish all the complicated parts all at once - so let's focus on getting the script to run with minimal functionality like loading a catalog and making a plot of the x vs. y we want to fit. We can try to pass it to the linmix fitter as well!

I'm using the milestone feature here; let's plan on closing this issue by then - a week after our MCMC meeting this Wednesday.

We could also schedule a hack-day if that is helpful for you all. Could be something like an hour long zoom session where we pair code, and then afterwards I can be around for quick remote responses to any questions you end up having.

that sounds good! I feel like that's a milestone we can meet as long as something doesn't go wildly wrong with my lab for Tesla's class like it did last time.

I like the idea of setting aside an hour to code! That would be awesome!

TODO:

  • Redefine class constructors not to save objects that are passed to them
  • Rewrite Data class to grab data from Catalog during the constructor

Another thing - feel free to skip the more complicated I/O stuff by putting this in the beginning of the main function:

#args = parser.parse_args()
#config_filename = args.config_filename
catalog_filename = 'SDSS-May-27-2017-with-visual-with-lumin-with-peaks.fits' 
xlabel = 'lambda' 
ylabel = 'r500_band_lumin'

Spencer, We were wondering if you could point out what the solution to the syntax error in line 174 is. We're having trouble running the code past that point. We've tried deleting the colon and checking previous lines to see if they're the cause without any luck. Thanks in advance!

@paigemkelly
@sweverett

The syntax error is actually on line 172 - there is a missing ")" to close out the print statement. It tells you the error is on line 174 because, since the statement on line 172 is not completed, it tries to include line 174 in the print statement and gets mad that there is an unexpected if statement there. Does that make sense?

I see a number of things that could be causing syntax errors.

There are 8 instances of pass that should not be there and may be causing issues: Lines 52, 74, 86, 94, 110, 118, 189, and 213. The pass keyword is only there for functions that are "unimplemented" - in other words, you put it there as a placeholder to say that there will be some function that does something eventually, but you haven't coded it up yet. Line 217 is an example of this (though the incomplete function definition here may also give a syntax error...)

Line 132 also should be changed as it has a typo and missing parentheses:
table_cat = catalog._load_catolog -> table_cat = catalog._load_catalog()
There are some other weird things going on there, but nothing that should be an obvious syntax error.

I see that github isn't recognizing that the function get_data() is actually a function (you can tell by the color coding), so that may be a clue. Otherwise it is very hard to tell just by looking at the code.

If you want to have a short debugging meeting this week just let me know when.

Learning how to code up the object-oriented aspects at the same time as everything else may be too much all at once. If you're having trouble, I recommend writing a short code snippet to load in the example fits file with astropy, grab a column or two (say lambda and r500_band_lumin), and pass that to the run_linmix() function directly just to see if you can get it running. I can then help with the "object-ifying" part of the code.

You can prototype this on a Jupyter notebook on your machine instead of the clustr code if you feel more comfortable with that as well

Thanks! We'll give that a try and update you on a possible meeting day tomorrow during group meeting.