-
Notifications
You must be signed in to change notification settings - Fork 2
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
Explore the creation of graphical timelines for donors, donees, and donor-donee pairs based on intended_funding_timeframe_in_months #125
Comments
Was this part supposed to link to something? |
@riceissa -- oops! I edited to add the link |
The browser timeline reminded me of https://en.wikipedia.org/wiki/Ubuntu_version_history#Version_timeline I'm wondering if you're imagining the vertical dimension being used for anything (e.g. maybe each new grant gets bumped up to its own level, like the Ubuntu releases), or if you're imagining just a 1-dimensional plot with the grant timeframes marked as intervals on the line. |
@riceissa great question! There are a few ways we could use the vertical dimension:
|
Here is a quick and dirty version https://gist.github.com/riceissa/016664523d6edc72e83649220830eeec [ETA: It looks like the large number of donors/donees is a problem (the plot labels just become unreadable if we do e.g. every single Open Phil donee for Example plots
|
@riceissa, I think we should go ahead with this. Here are my thoughts regarding what versions to go ahead with:
I'm coming up with the number 10 arbitrarily, but you can choose a slightly different number based on your experimentation. I think capping by number rather than amount threshold (of amount paid by donor to donee) is better, because we may not find a good amount threshold that works consistently across donor-donee combinations. |
This phrasing seems to imply that there are filters other than cause area, but I can't recall any other filters. Did you have something else in mind that the plot should handle? |
Ok, I'm done with this (modulo potential non-cause-area filters; see previous comment), and my work is in this branch: https://github.com/vipulnaik/donations/tree/timeframe-plot Some notes:
|
What's the content of this login.py supposed to be? Do you have a sample somewhere (a dummy file) @riceissa? Sorry if I missed this; I didn't see it in the repo or in the comments on this GitHub issue. |
It should look like:
(The documentation for this is printed to stderr if you run |
Thanks @riceissa, this is awesome!!! I am currently running this code on donations.vipulnaik.com (even though it is not yet merged to master). I had to commit a small fix to make it work (adding an extra space). I also made a PR #131 out of your branch so that it's easier to explore the diff on GitHub. I have a couple of pieces of feedback:
|
@vipulnaik Can you please give the URLs/queries that produced those plots? I can't reproduce the error without seeing which plots I am supposed to be looking at in my local DLW instance. For example at http://localhost:8000/donor.php?donor=Open+Philanthropy+Project#donorDonationList I see the following, which looks fine to me: |
Ah @riceissa this brings me to another bug similar to #121; I think the key being used to hash doesn't have the right incorporation of cause area filters. That's why you are seeing a completely different list of top donees than the true, canonical one (I think you are seeing a list filtered to the AI safety cause area). So please first fix that bug, using thte idea of #121 as a guide. For a simpler example of a donor with much fewer donees (and therefore less subject to the bug of the preceding para) see https://donations.vipulnaik.com/donor.php?donor=Vipul+Naik#donorDonationList https://donations.vipulnaik.com/images/ae1d3d74a5d4f2679e251d384f61393b-timeframe.png |
I'm really confused by this part. Line 57 in bf389a2
|
I'm not able to reproduce this bug. Here's what it looks like on my machine: Since I can't reproduce it, this makes it pretty annoying to debug and fix. I think there must be something special about your version of matplotlib or something. |
Sorry about that. It turns out I had a space at the end of my |
I was actually loading a subset of the SQL files so didn't have all of the grants in the database when generating the plot. I get the same list of grantees now so I don't think the bug you are talking about was the cause. |
I was comparing the graphical timeline against the data shown on the page below it. This masters and Ph.D. grant showed as having a timeframe of 1 month, not 48 months, hence my confusion. However, after your poke, I checked and found that the bug was in the table display! Specifically, a missing paren. I've fixed that now: 5c0d4ee So at least as far as I can make out the durations in the graphical timeline display are correct. |
Nonetheless, that bug does exist. Just now, I repro'd it by following analogous steps to those in #121 (comment) so it was a fortuitous accident that it got surfaced here. |
@riceissa I think the bug can be fixed by tweaking these two lines https://github.com/vipulnaik/donations/pull/131/files#diff-9cb3f3c9dbff485308195cdc97afac16ab50fa087cfd9f68816aca98cd3eb283R19-R20 to include cause area filter in the hash key -- do you want to give it a try? If not, I should be able to do it too. |
@riceissa: I just merged master into the branch, FYI. |
* Add initial timeframe plotting code * Rename to timeframe_plot.py * Add arguments * Pass in all the arguments * Add timeframe plot for donorDonee * Fix query for single_donor_multiple_donees plot * Fix query for single_donee_multiple_donors * Add timeframe graph python command * Add timeframe plots to the website code * Use better input to hash for filename * Encode arguments to python using base64 * Uncomment import statements * Add space before '--base64' so that graphical timeline generation actually works * Fix bug noted in #125 (comment) Co-authored-by: Issa Rice <riceissa@gmail.com>
This was bugging me so I looked into it more, and you might be able to fix it by using the following line:
You can put this line right before the |
Thanks @riceissa! This worked so I pushed the change. |
I'm thinking of the kind of timeline where the time is plotted horizontally, and then we have bars for the time periods that various grants are for.
I think this is most helpful for donor-donee pairs, e.g., https://donations.vipulnaik.com/donorDonee.php?donor=Open+Philanthropy+Project&donee=Machine+Intelligence+Research+Institute In particular, it allows us to visually check if there is any "gap" in funding (a time period when Open Phil wasn't funding MIRI) and if there are periods of double-funding (a second grant was made while an existing one was still within timeframe).
We'll have to figure out how to deal with grants with no
intended_funding_timeframe_in_months
. We could show them as dots, or something like dot with a question mark to indicate unknown timeframe.Here's a super-complicated graphical timeline; I'm obviously looking for something similar (in particular, the various bars won't be connected to or branching out from one another).
https://commons.wikimedia.org/wiki/File:Timeline_of_web_browsers.svg
The text was updated successfully, but these errors were encountered: