-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overall design plan #1
Comments
Notes on coding conventions:
And I think we should use the GalSim branching system as well, which has worked well for us so far. (For people not involved with that project: when you want to add something to the code, you open a new issue for it and describe what you'd like to do. Others can comment if they have thoughts. Then you start a branch--eg, if I were to write code based on this issue, I would create a branch called '#1'--which makes pull requests easy. You can also tag your commits with #1 and then they will show up on the issue page, which can be handy if you run into problems midway through.) And as you can see from this issue, the issue pages can also act forum-like if we need such functionality! :) |
A few random comments:
|
Ah, matplotlib: that actually brings up another question. One of the problems with matplotlib is that it is very slow (and this is why DisplayQA only generates plots upon request). However, it's not the only plotting package in the world; there are others that will generate faster but less pretty plots. Should we look into those and maybe pick one for generating results on the fly if users have it installed, and then have something like a In any case--there's an option to make matplotlib required, or we could just have the code write out a simple ASCII table you could plot with gnuplot/supermongo/etc if it doesn't find a plotting package. (We may want to do that anyway so users can use the outputs directly for papers if they don't like matplotlib.) |
It is going to get complicated if we want to be able to talk to multiple plotting programs. My thinking had been that people would use Stile in a way that lets them pick and choose tests. If they’ve chosen a test, they definitely want it run and want to see results. In contrast, I thought that with pipeQA it runs the whole suite automatically, which means that it totally makes sense for it to not write out all plots automatically. Am I thinking about this differently from how you are? How about this for the near term: (2) As a goal for later, once we have something that is stable and can do a few simple tests, we can consider the option of how to interface with other plotting software. |
I'll comment on the rest when I catch up with reading it, but re matplotlib: I'd say use matplotlib until you've noticed a clear bottleneck in the performance, and then worry about replacing it for that particular kind of test (and changing the API for that kind of test to not rely on e.g. matplotlib style keywords if necessary). I think the fact that it's what most (all?) potential developers are most familiar with and by far the Python plotting package with the most market share outweighs performance concerns at this point. And by organizing the code so that everything that wants to make e.g. a scatter plot or a histogram plot has to go through the same class, you've really walled off how much you have to change if you put in a new plotting backend for one of those. |
Okay, that all seems persuasive to me. Leave matplotlib for now, add others later if we need to. Thanks, guys! |
I think matplotlib is a good option for the near term. I think displaying the results would be as important as data handling and tests, because we have to check lots of results of systematic tests. For example, the following complicated but useful feature, which is one of my favorite PipeQA functionalities, might be needed. PipeQA allows us to check first the overall quality of exposure by looking at the entire FOV and if we click a particular CCD that seems problematic we can look at details of QA of the CCD. This is actually very handy to check things. Do we want to think about displaying seriously? |
I'll start with some meta-design ideas:
I think one of the key features (as Hironao has noted) is the need to be able to "drill down" from overview plots to related plots that can help explain what's going on. I think one of the early mistakes of PipeQA (which has now been addressed) was to generate all the drill-down plots up front (that was too slow). So I think we want those to be done on-the-fly, even if we do have the capability to run a lot of overview plots in bulk up-front. I think the other key feature here is that we want an overview plot to know about what drill-down plots might be of interest (and vice versa), and provide a way to move easily from one to the other without having to re-specify the data involved. That said, we don't want to sucked into writing a big fancy user interface for this, when the focus should be on making the right kind of plots. But we definitely want the design to be aware of (at least) these two modes of operations:
I recommend Python 2.7 as a minimum. While 2.6 is what you get in the OS version on big clusters, almost everyone using Python for science has some version of 2.7 available. I also think it will be very hard to support Python 3 at the same time as 2.6. |
Hironao: Yes, we need to think carefully about the presentation and plotting. As I said up above, the displayQA stuff looks really nice, but I worry about people being able to run it on the same machines where they'll be running their tests. We might want to think about an interactive post-processing code in Python (using Tkinter? I haven't used it for much so don't know what its capabilities are). Any thoughts you have would be very helpful. |
Jim:
That's a good point, thanks.
This, I think, also means that the data has to know what other data it's a subset or superset of (which in principle isn't necessary). I think that's a useful feature, though, & will keep it in mind.
Hmm, an interesting point. The simplest thing might to be to have a set of pre-generated "expected" images and a set of new images joined together in some way (side by side?) and ask the user to verify that each pair is qualitatively similar and contains the same labels, legends, etc. Something to think about, in any case.
That's fine with me. I had glanced through some things and knew that 2.5 and 3 really wouldn't be compatible, but hadn't explored 2.6 too carefully--I'm happy to take your word that it's difficult! |
Melanie: I am not sure if using Tkinter is a good idea. I think it would be nice if one can share plots with others. For this purpose, it might be nice to use a web browser (this is what PipeQA does) which makes it easier; we can just send a link. If not, one might have to send a command line (or rather complicated something) to reproduce the result, which sometimes makes mistake. However, I am not sure this is the best solution. I am not familiar with this kind of things either… Probably I need inputs from others! |
Hey folks, I think there is now a semi-working example in the test/ directory. If you pull the latest version, You'll get the corr2 outputs as realshear (all data) and realshear[01]-[01], which is binned into quadrants around ra=0 and dec=0, plus simple .pngs displaying those. The matplotlib calls are just in test_run.py, not as any method of the test function yet. The next step is probably to split off into issues (test, validate and repair what's already here; add unit tests for what's already here; add an HSC data handler; add plotting functions to the correlation function tests; add other correlation function tests, which should be easy once the plotting's done; add other kinds of tests, eg histograms, single-point statistics, etc) and tackle things individually. But hopefully this is enough of a framework to start things going. |
Okay, there was a formatting snafu above--might be better to read on github. Also, when I said |
And to address Hironao's point, sorry--we might want to allow interactive results both via something like Tkinter, for folks like me who are on machines where they won't be able to do web servers, and via DisplayQA for folks who can. But I would say if we do do something like Tkinter, that's far down the road--we have much more important stuff to do first... |
I couldn't run the test… It seems that there is no tests.py in ../stile/. Am I missing something? bash-3.2$ pwd |
Yes, I agree that we have much more important stuff to do first. Maybe we might just want to use DisplayQA first (or easier one like just a simple matplotlib!). |
Sorry, you're right! The file is there now. |
Great! It works now. |
I very belatedly decided to try
Is something missing...? |
Hmm...is that the only output you see? |
Yes. I can dig into it more myself if this is non-obvious to you, I just wondered if something was obviously missing... |
I should clarify: that means corr2 didn't write its output file (realshear is the output file requested from corr2). So if there had been something else--I see there isn't--that could be a sign that corr2 had failed first. I'm happy to come over & help if you like. |
Sure, whenever you’re ready. |
Hi Melanie (and anyone else who might be following along): I confirm that if I install the latest corr2 this does work just fine. For those who might be wondering, the problem is that recently Mike changed the filenames for shear correlations so that all the e's became g's. I had an older version that was expecting As for when this happened, Melanie, I looked at Mike's commits: |
And just for posterity, I wasn't able to compile corr2 with clang, and had to find an old GalSim issue where I was complaining about this (since in OSX 10.9, the compiler that comes with Xcode is clang, not g++). The comment where Mike responded to my complaint and we iterated for a while on how to compile is here: Could be useful if this comes up again. (basically, I had to set some compiler flags differently and change 1 line of code) |
Sorry, screwed up formatting, please view on github. |
Preserving for the record that we decided on a telecon today to use Sphinx for documentation rather than DOxygen... |
(and thanks to @TallJimbo for the suggestion) |
This thread is a place to debate some overall design decisions for Stile (or whatever we decide to call it, if we want to change the name).
As I've been thinking about this, I've been aiming to maximize the possible user base, which drives a couple of design decisions: 1, that the interface with the data should be as separate as possible from the test functions, and 2, that we want to include enough code that you can run all of the tests without knowing Python, via config files/command-line options. 2 is low on the list of priorities at the moment, but I thought it would be helpful to keep in mind as we're working out the structure.
Brief overview of the architecture, as I've conceived of it so far:
Things I have put less thought into:
Exactly what kind of outputs we want to generate for each of the tests, and how we go about doing it. The displayQA framework produces some really nice outputs, but it requires running a web server; I know that the machine where I plan to run the HSC pipeline won't let me do that due to security concerns. I also worry a little about defining a hard pass/fail metric for a lot of these tests. On the other hand, as I said, very nice outputs, and less code to write...
Code that exists:
I just put up some simple file I/O (copied from another project) and the corr2 interface, which is mostly untested but has a lot of what we need I think. Over the next week or so I'll clean up and post:
Next comment: some notes on coding conventions.
The text was updated successfully, but these errors were encountered: