This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH aggregate_data AS ( | |
| SELECT | |
| crossref.published_year as year, | |
| -- crossref.type as type, | |
| COUNT(*) AS n_outputs, | |
| SUM(CASE WHEN coki.oa.coki.open = TRUE THEN 1 ELSE 0 END) AS n_outputs_open, | |
| SUM(CASE WHEN coki.oa.coki.closed = TRUE THEN 1 ELSE 0 END) AS n_outputs_closed, | |
| SUM(CASE WHEN coki.oa.coki.publisher_only = TRUE THEN 1 ELSE 0 END) as n_publisher_open, | |
| SUM(CASE WHEN coki.oa.coki.other_platform_only = TRUE THEN 1 ELSE 0 END) as n_other_platform_open, | |
| SUM(CASE WHEN coki.oa.coki.both = TRUE THEN 1 ELSE 0 END) as n_both_open, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH | |
| -- UNNEST the funder DOIs in the Crossref DOI table | |
| CR_FUNDER_DOI_TABLE AS ( | |
| SELECT | |
| a.doi, | |
| crossref.published_year, | |
| -- Deal with the Crossref Month 13 issue | |
| CASE WHEN crossref.published_month > 12 then 12 ELSE crossref.published_month END as published_month, | |
| unpaywall.* EXCEPT(doi), | |
| crossref.type, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import datetime | |
| from google.cloud import firestore | |
| from google.cloud import storage | |
| import time | |
| import logging | |
| db = firestore.Client() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pylab import * | |
| from scipy.ndimage import measurements | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import time | |
| import sys | |
| import signal | |
| def signal_handler(signal, frame): | |
| sys.exit(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Provisioning script for a Vagrant VM running iPythonNotebook | |
| # Obtain curl and install setuptools and pip | |
| apt-get update | |
| apt-get -y install python-setuptools | |
| easy_install pip | |
| # Get ipython and dependencies | |
| echo | |
| echo Installing iPython and dependencies... |