From 16fd73d138ae3983f5f28bad15548f99ebb70ee6 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Tue, 13 Aug 2024 19:18:07 +0530 Subject: [PATCH 01/14] Add research papers job to post release yml --- .github/workflows/post-release.yml | 36 +++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 173656f951a..70e34221208 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -10,6 +10,9 @@ on: workflow_dispatch: # manual trigger +env: + NASA_ADS_TOKEN: ${{ secrets.NASA_ADS_TOKEN }} + jobs: changelog: runs-on: ubuntu-latest @@ -85,8 +88,38 @@ jobs: README.rst docs/resources/credits.rst + research-using-tardis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install jupyter nbconvert + + - name: Shift to research_done_using_tardis directory + run: | + cd docs/resources/research_done_using_TARDIS/ + + - name: Run the ADS notebook + run: | + jupyter nbconvert --to python ads.ipynb + python3 ads.py + + - uses: actions/upload-artifact@v4 + with: + name: research_papers + path: | + docs/resources/research_done_using_TARDIS/resource_papers.rst + pull_request: - needs: [changelog, citation, credits] + needs: [changelog, citation, credits, research-using-tardis] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -100,6 +133,7 @@ jobs: cp /tmp/changelog/CHANGELOG.md . cp /tmp/citation/CITATION.cff . cp -r /tmp/credits/* . + cp /tmp/research_papers/* - name: Get current date run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV From 52304a6826179598314a7c521019d7c3539c3218 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Tue, 13 Aug 2024 19:18:33 +0530 Subject: [PATCH 02/14] Update notebook to fetch research papers --- .../research_done_using_TARDIS/ads.ipynb | 781 ++---------------- 1 file changed, 64 insertions(+), 717 deletions(-) diff --git a/docs/resources/research_done_using_TARDIS/ads.ipynb b/docs/resources/research_done_using_TARDIS/ads.ipynb index d816cab5aa4..0d78011c20b 100644 --- a/docs/resources/research_done_using_TARDIS/ads.ipynb +++ b/docs/resources/research_done_using_TARDIS/ads.ipynb @@ -1,760 +1,107 @@ { "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Generating TARDIS Citations\n", - "\n", - "Note: This notebook only works if you have the ADS python package and an API key for ADS (for information, see https://ads.readthedocs.io/en/latest/)." - ] - }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ - "import ads\n", - "import pandas as pd\n", - "ads.config.token = \"\" #Add your token" + "import requests\n", + "from urllib.parse import urlencode\n", + "import os" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ - "papers = ads.SearchQuery(q='(((full:\"tardis\" AND (full:\"kerzendorf\" OR (bibstem:\"Natur\" AND full:\"supernova\")))) AND year:2014-)+property:refereed', sort=\"date\",\n", - " fl = ['bibcode','title', 'bibstem', 'author', 'year'])\n", + "BASE_URL = \"https://api.adsabs.harvard.edu/v1/search\"\n", + "tardis_bibcode = \"2014MNRAS.440..387K\" \n", + "tardis_articles = []\n", + "query = {\n", + " \"q\": f'bibcode:\"{tardis_bibcode}\"',\n", + " \"fl\": \"title, year, author, bibstem, citation, bibcode\"\n", + "}\n", "\n", - "bibcodes = []\n", - "titles = []\n", - "bibstems = []\n", - "authors = []\n", - "year_list = []\n", - "for paper in papers:\n", - " bibcodes.append(paper.bibcode)\n", - " titles.append(paper.title)\n", - " bibstems.append(paper.bibstem)\n", - " authors.append(paper.author)\n", - " year_list.append(paper.year)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "def get_url(bibcodes):\n", - " \"\"\"This function takes the list of bibcodes and returns a link!\"\"\"\n", - " url_list = []\n", - " for bibcode in bibcodes:\n", - " url = \"https://ui.adsabs.harvard.edu/abs/{}\".format(bibcode)\n", - " url_list.append(url)\n", - " return url_list\n", + "encoded_query = urlencode(query)\n", + "all_cited_articles = []\n", + "not_refereed = []\n", + "results = requests.get(f\"{BASE_URL}/query?{encoded_query}\", \n", + " headers={'Authorization': 'Bearer ' + os.environ['NASA_ADS_TOKEN']})\n", + "cited_bib_codes = results.json()['response']['docs'][0]['citation']\n", + "all_cited_articles.append(results.json()['response']['docs'][0])\n", + "for single_bib_code in cited_bib_codes:\n", + " start = 0\n", + " numFound = None\n", + " while numFound == None or start < numFound:\n", + " query = {\n", + " \"q\": f'bibcode:\"{single_bib_code}\"',\n", + " \"fl\": \"title, author, bibstem, year, property\",\n", + " \"sort\": \"year desc\",\n", + " \"start\": start\n", + " }\n", + " encoded_query_bib = urlencode(query)\n", "\n", - "def get_hyperlink(bibcodes):\n", - " hyperlink_list=[]\n", - " for url in get_url(bibcodes):\n", - " hyperlink_list.append('`(ADS Link) <{}>`__'.format(url))\n", - " return hyperlink_list" + " bib_results = requests.get(f\"{BASE_URL}/query?{encoded_query_bib}\", \n", + " headers={'Authorization': 'Bearer ' + ads_token})\n", + " numFound = bib_results.json()['response']['numFound']\n", + " articles = bib_results.json()['response']['docs']\n", + " fetched_rows = len(articles)\n", + " start += fetched_rows\n", + " for entry in articles:\n", + " entry['bibcode'] = single_bib_code\n", + " not_refereed.append(entry)\n", + " if 'REFEREED' in entry['property']:\n", + " entry['bibcode'] = single_bib_code\n", + " all_cited_articles.append(entry)" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ - "def get_journal(bibstems):\n", - " \"\"\"This function takes the list of bibstems and returns the journal that they are in, formatted.\"\"\"\n", - " journals = []\n", - " for item in bibstems:\n", - " journals.append(item[0])\n", - " return journals" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "scrolled": true - }, - "outputs": [], - "source": [ - "def get_authors_formatted(authors):\n", - " \"\"\"This gets the first 3 authors of each paper. If there are more than 3, the first 3 followed by 'et al.\n", - " is returned. If it's less than or equal to 3, the first 3 are returned. This function takes in a list and \n", - " returns a modified version of the list\"\"\"\n", - " formatted_author_list=[]\n", - " for author_array in authors: #Note that array is just being used as a variable, no array is used\n", - " count=0\n", - " author_string = \"\"\n", - " for item in author_array:\n", - " if count==0:\n", - " author_string+=item\n", - " count+=1\n", - " elif count<3:\n", - " author_string+=\", \"+item\n", - " count+=1\n", - " elif count==3:\n", - " author_string+=\", et al.\"\n", - " break\n", - " formatted_author_list.append(author_string)\n", - " return formatted_author_list" + "all_cited_articles.sort(key=lambda x: x['year'], reverse=True)" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 44, "metadata": {}, "outputs": [], "source": [ - "def get_titles_formatted(titles):\n", - " formatted_titles_list = []\n", - " for title in titles:\n", - " title_str = \"\"\n", - " for item in title:\n", - " title_str += str(item)\n", - " title_str=title_str.replace(\" \",\"* :sup:`\").replace(\"\",\"`\\ *\")\n", - " formatted_titles_list.append(title_str)\n", - " return formatted_titles_list" + "def format_citation(entry):\n", + " authors = entry['author']\n", + " if len(authors) > 3:\n", + " author_str = ', '.join(authors[:3]) + ', et al.'\n", + " else:\n", + " author_str = ', '.join(authors)\n", + " citation = f\"**{author_str}** {entry['year']}, {entry['bibstem'][0]}, *\\\"{entry['title']}\\\"* `(ADS Link) `__\"\n", + " return citation" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 45, "metadata": {}, "outputs": [], "source": [ - "string_list= []\n", - "\n", - "for i in range(len(list(year_list))):\n", - " string_string = \" \"+\"**{}**\".format(get_authors_formatted(authors)[i])+' '+year_list[i]+',\\\n", - " '+get_journal(bibstems)[i]+', '+'*\"{}\"*'.format(get_titles_formatted(titles)[i])+' '+get_hyperlink(bibcodes)[i]+\"\"\"\n", - " \n", - "\"\"\"\n", - " string_list.append(string_string)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [], - "source": [ - "test_article = open(\"research_papers.rst\", \"w\")\n", - "heading=\"\"\"###################\n", - "Papers Using TARDIS\n", - "###################\"\"\"\n", - "print(heading, file=test_article)\n", - "test_master = string_list\n", - "for line in string_list:\n", - " print(line, file=test_article)\n", - "test_article.close()" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "d = {'Authors': get_authors_formatted(authors), 'Year': year_list, 'Journal': get_journal(bibstems), \n", - " 'Title': get_titles_formatted(titles), 'Link': get_url(bibcodes)}\n", - "df = pd.DataFrame(data=d)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
AuthorsYearJournalTitleLink
0Dutta, Anirban, Singh, Avinash, Anupama, G. C....2021MNRASSN 2017hpa: a carbon-rich Type Ia supernovahttps://ui.adsabs.harvard.edu/abs/2021MNRAS.50...
1Kerzendorf, Wolfgang E., Vogl, Christian, Buch...2021ApJLDalek: A Deep Learning Emulator for TARDIShttps://ui.adsabs.harvard.edu/abs/2021ApJ...91...
2Magee, M. R., Maguire, K., Kotak, R., et al.2021MNRASExploring the diversity of double-detonation e...https://ui.adsabs.harvard.edu/abs/2021MNRAS.50...
3Fiore, A., Chen, T. -W., Jerkstrand, A., et al.2021MNRASSN 2017gci: a nearby Type I Superluminous Supe...https://ui.adsabs.harvard.edu/abs/2021MNRAS.50...
4Williamson, Marc, Kerzendorf, Wolfgang, Modjaz...2021ApJModeling Type Ic Supernovae with TARDIS: Hidde...https://ui.adsabs.harvard.edu/abs/2021ApJ...90...
5Barna, Barnabás, Szalai, Tamás, Jha, Saurabh W...2021MNRASSN 2019muj - a well-observed Type Iax supernov...https://ui.adsabs.harvard.edu/abs/2021MNRAS.50...
6Magee, M. R., Maguire, K.2020A&AAn investigation of* :sup:`56`\\ *Ni shells as ...https://ui.adsabs.harvard.edu/abs/2020A&A...64...
7Chen, Xingzhuo, Hu, Lei, Wang, Lifan2020ApJSArtificial Intelligence-Assisted Inversion (AI...https://ui.adsabs.harvard.edu/abs/2020ApJS..25...
8Gillanders, J. H., Sim, S. A., Smartt, S. J.2020MNRASAT2018kzr: the merger of an oxygen-neon white ...https://ui.adsabs.harvard.edu/abs/2020MNRAS.49...
9Tomasella, Lina, Stritzinger, Maximilian, Bene...2020MNRASObservations of the low-luminosity Type Iax su...https://ui.adsabs.harvard.edu/abs/2020MNRAS.49...
10Miller, A. A., Magee, M. R., Polin, A., et al.2020ApJThe Spectacular Ultraviolet Flash from the Pec...https://ui.adsabs.harvard.edu/abs/2020ApJ...89...
11Bouquin, Daina R., Chivvis, Daniel A., Henneke...2020ApJSCredit Lost: Two Decades of Software Citation ...https://ui.adsabs.harvard.edu/abs/2020ApJS..24...
12Livneh, Ran, Katz, Boaz2020MNRASAn asymmetric explosion mechanism may explain ...https://ui.adsabs.harvard.edu/abs/2020MNRAS.49...
13Kawabata, Miho, Maeda, Keiichi, Yamanaka, Masa...2020ApJSN 2019ein: New Insights into the Similarities...https://ui.adsabs.harvard.edu/abs/2020ApJ...89...
14Srivastav, Shubham, Smartt, Stephen J., Leloud...2020ApJLThe Lowest of the Low: Discovery of SN 2019gsc...https://ui.adsabs.harvard.edu/abs/2020ApJ...89...
15Magee, M. R., Maguire, K., Kotak, R., et al.2020A&ADetermining the* :sup:`56`\\ *Ni distribution o...https://ui.adsabs.harvard.edu/abs/2020A&A...63...
16Vogl, C., Kerzendorf, W. E., Sim, S. A., et al.2020A&ASpectral modeling of type II supernovae. II. A...https://ui.adsabs.harvard.edu/abs/2020A&A...63...
17McBrien, Owen R., Smartt, Stephen J., Chen, Ti...2019ApJLSN2018kzr: A Rapidly Declining Transient from ...https://ui.adsabs.harvard.edu/abs/2019ApJ...88...
18Watson, Darach, Hansen, Camilla J., Selsing, J...2019NaturIdentification of strontium in the merger of t...https://ui.adsabs.harvard.edu/abs/2019Natur.57...
19Jacobson-Galán, Wynn V., Foley, Ryan J., Schwa...2019MNRASDetection of circumstellar helium in Type Iax ...https://ui.adsabs.harvard.edu/abs/2019MNRAS.48...
20Noebauer, Ulrich M., Sim, Stuart A.2019LRCAMonte Carlo radiative transferhttps://ui.adsabs.harvard.edu/abs/2019LRCA.......
21Chatzopoulos, E., Weide, K.2019ApJGray Radiation Hydrodynamics with the FLASH Co...https://ui.adsabs.harvard.edu/abs/2019ApJ...87...
22Mulligan, Brian W., Zhang, Kaicheng, Wheeler, ...2019MNRASExploring the shell model of high-velocity fea...https://ui.adsabs.harvard.edu/abs/2019MNRAS.48...
23Magee, M. R., Sim, S. A., Kotak, R., et al.2019A&ADetecting the signatures of helium in type Iax...https://ui.adsabs.harvard.edu/abs/2019A&A...62...
24Heringer, E., van Kerkwijk, M. H., Sim, S. A.,...2019ApJSpectral Sequences of Type Ia Supernovae. II. ...https://ui.adsabs.harvard.edu/abs/2019ApJ...87...
25Izzo, L., de Ugarte Postigo, A., Maeda, K., et...2019NaturSignatures of a jet cocoon in early spectra of...https://ui.adsabs.harvard.edu/abs/2019Natur.56...
26Vogl, C., Sim, S. A., Noebauer, U. M., et al.2019A&ASpectral modeling of type II supernovae. I. Di...https://ui.adsabs.harvard.edu/abs/2019A&A...62...
27Ergon, M., Fransson, C., Jerkstrand, A., et al.2018A&AMonte-Carlo methods for NLTE spectral synthesi...https://ui.adsabs.harvard.edu/abs/2018A&A...62...
28Barna, Barnabás, Szalai, Tamás, Kerzendorf, Wo...2018MNRASType Iax supernovae as a few-parameter familyhttps://ui.adsabs.harvard.edu/abs/2018MNRAS.48...
29Prentice, S. J., Maguire, K., Smartt, S. J., e...2018ApJLThe Cow: Discovery of a Luminous, Hot, and Rap...https://ui.adsabs.harvard.edu/abs/2018ApJ...86...
30Beaujean, Frederik, Eggers, Hans C., Kerzendor...2018MNRASBayesian modelling of uncertainties of Monte C...https://ui.adsabs.harvard.edu/abs/2018MNRAS.47...
31Magee, M. R., Sim, S. A., Kotak, R., et al.2018A&AModelling the early time behaviour of type Ia ...https://ui.adsabs.harvard.edu/abs/2018A&A...61...
32Röpke, Friedrich K., Sim, Stuart A.2018SSRvModels for Type Ia Supernovae and Related Astr...https://ui.adsabs.harvard.edu/abs/2018SSRv..21...
33Barna, Barnabás, Szalai, Tamás, Kromer, Markus...2017MNRASAbundance tomography of Type Iax SN 2011ay wit...https://ui.adsabs.harvard.edu/abs/2017MNRAS.47...
34Smartt, S. J., Chen, T. -W., Jerkstrand, A., e...2017NaturA kilonova as the electromagnetic counterpart ...https://ui.adsabs.harvard.edu/abs/2017Natur.55...
35Heringer, E., van Kerkwijk, M. H., Sim, S. A.,...2017ApJSpectral Sequences of Type Ia Supernovae. I. C...https://ui.adsabs.harvard.edu/abs/2017ApJ...84...
36Magee, M. R., Kotak, R., Sim, S. A., et al.2017A&AGrowing evidence that SNe Iax are not a one-pa...https://ui.adsabs.harvard.edu/abs/2017A&A...60...
37Boyle, Aoife, Sim, Stuart A., Hachinger, Steph...2017A&AHelium in double-detonation models of type Ia ...https://ui.adsabs.harvard.edu/abs/2017A&A...59...
38Noebauer, U. M., Taubenberger, S., Blinnikov, ...2016MNRASType Ia supernovae within dense carbon- and ox...https://ui.adsabs.harvard.edu/abs/2016MNRAS.46...
39Inserra, C., Bulla, M., Sim, S. A., et al.2016ApJSpectropolarimetry of Superluminous Supernovae...https://ui.adsabs.harvard.edu/abs/2016ApJ...83...
40Szalai, Tamás, Vinkó, József, Nagy, Andrea P.,...2016MNRASThe continuing story of SN IIb 2013df: new opt...https://ui.adsabs.harvard.edu/abs/2016MNRAS.46...
41Magee, M. R., Kotak, R., Sim, S. A., et al.2016A&AThe type Iax supernova, SN 2015H. A white dwar...https://ui.adsabs.harvard.edu/abs/2016A&A...58...
42Dubernet, M. L., Antony, B. K., Ba, Y. A., et al.2016JPhBThe virtual atomic and molecular data centre (...https://ui.adsabs.harvard.edu/abs/2016JPhB...4...
43Parrent, J. T., Howell, D. A., Fesen, R. A., e...2016MNRASComparative analysis of SN 2012dn optical spec...https://ui.adsabs.harvard.edu/abs/2016MNRAS.45...
44Young, P. R., Dere, K. P., Landi, E., et al.2016JPhBThe CHIANTI atomic databasehttps://ui.adsabs.harvard.edu/abs/2016JPhB...4...
45Noebauer, U. M., Sim, S. A.2015MNRASSelf-consistent modelling of line-driven hot-s...https://ui.adsabs.harvard.edu/abs/2015MNRAS.45...
46Matthews, J. H., Knigge, C., Long, K. S., et al.2015MNRASThe impact of accretion disc winds on the opti...https://ui.adsabs.harvard.edu/abs/2015MNRAS.45...
47Kerzendorf, Wolfgang E., Sim, Stuart A.2014MNRASA spectral synthesis code for rapid modelling ...https://ui.adsabs.harvard.edu/abs/2014MNRAS.44...
\n", - "
" - ], - "text/plain": [ - " Authors Year Journal \\\n", - "0 Dutta, Anirban, Singh, Avinash, Anupama, G. C.... 2021 MNRAS \n", - "1 Kerzendorf, Wolfgang E., Vogl, Christian, Buch... 2021 ApJL \n", - "2 Magee, M. R., Maguire, K., Kotak, R., et al. 2021 MNRAS \n", - "3 Fiore, A., Chen, T. -W., Jerkstrand, A., et al. 2021 MNRAS \n", - "4 Williamson, Marc, Kerzendorf, Wolfgang, Modjaz... 2021 ApJ \n", - "5 Barna, Barnabás, Szalai, Tamás, Jha, Saurabh W... 2021 MNRAS \n", - "6 Magee, M. R., Maguire, K. 2020 A&A \n", - "7 Chen, Xingzhuo, Hu, Lei, Wang, Lifan 2020 ApJS \n", - "8 Gillanders, J. H., Sim, S. A., Smartt, S. J. 2020 MNRAS \n", - "9 Tomasella, Lina, Stritzinger, Maximilian, Bene... 2020 MNRAS \n", - "10 Miller, A. A., Magee, M. R., Polin, A., et al. 2020 ApJ \n", - "11 Bouquin, Daina R., Chivvis, Daniel A., Henneke... 2020 ApJS \n", - "12 Livneh, Ran, Katz, Boaz 2020 MNRAS \n", - "13 Kawabata, Miho, Maeda, Keiichi, Yamanaka, Masa... 2020 ApJ \n", - "14 Srivastav, Shubham, Smartt, Stephen J., Leloud... 2020 ApJL \n", - "15 Magee, M. R., Maguire, K., Kotak, R., et al. 2020 A&A \n", - "16 Vogl, C., Kerzendorf, W. E., Sim, S. A., et al. 2020 A&A \n", - "17 McBrien, Owen R., Smartt, Stephen J., Chen, Ti... 2019 ApJL \n", - "18 Watson, Darach, Hansen, Camilla J., Selsing, J... 2019 Natur \n", - "19 Jacobson-Galán, Wynn V., Foley, Ryan J., Schwa... 2019 MNRAS \n", - "20 Noebauer, Ulrich M., Sim, Stuart A. 2019 LRCA \n", - "21 Chatzopoulos, E., Weide, K. 2019 ApJ \n", - "22 Mulligan, Brian W., Zhang, Kaicheng, Wheeler, ... 2019 MNRAS \n", - "23 Magee, M. R., Sim, S. A., Kotak, R., et al. 2019 A&A \n", - "24 Heringer, E., van Kerkwijk, M. H., Sim, S. A.,... 2019 ApJ \n", - "25 Izzo, L., de Ugarte Postigo, A., Maeda, K., et... 2019 Natur \n", - "26 Vogl, C., Sim, S. A., Noebauer, U. M., et al. 2019 A&A \n", - "27 Ergon, M., Fransson, C., Jerkstrand, A., et al. 2018 A&A \n", - "28 Barna, Barnabás, Szalai, Tamás, Kerzendorf, Wo... 2018 MNRAS \n", - "29 Prentice, S. J., Maguire, K., Smartt, S. J., e... 2018 ApJL \n", - "30 Beaujean, Frederik, Eggers, Hans C., Kerzendor... 2018 MNRAS \n", - "31 Magee, M. R., Sim, S. A., Kotak, R., et al. 2018 A&A \n", - "32 Röpke, Friedrich K., Sim, Stuart A. 2018 SSRv \n", - "33 Barna, Barnabás, Szalai, Tamás, Kromer, Markus... 2017 MNRAS \n", - "34 Smartt, S. J., Chen, T. -W., Jerkstrand, A., e... 2017 Natur \n", - "35 Heringer, E., van Kerkwijk, M. H., Sim, S. A.,... 2017 ApJ \n", - "36 Magee, M. R., Kotak, R., Sim, S. A., et al. 2017 A&A \n", - "37 Boyle, Aoife, Sim, Stuart A., Hachinger, Steph... 2017 A&A \n", - "38 Noebauer, U. M., Taubenberger, S., Blinnikov, ... 2016 MNRAS \n", - "39 Inserra, C., Bulla, M., Sim, S. A., et al. 2016 ApJ \n", - "40 Szalai, Tamás, Vinkó, József, Nagy, Andrea P.,... 2016 MNRAS \n", - "41 Magee, M. R., Kotak, R., Sim, S. A., et al. 2016 A&A \n", - "42 Dubernet, M. L., Antony, B. K., Ba, Y. A., et al. 2016 JPhB \n", - "43 Parrent, J. T., Howell, D. A., Fesen, R. A., e... 2016 MNRAS \n", - "44 Young, P. R., Dere, K. P., Landi, E., et al. 2016 JPhB \n", - "45 Noebauer, U. M., Sim, S. A. 2015 MNRAS \n", - "46 Matthews, J. H., Knigge, C., Long, K. S., et al. 2015 MNRAS \n", - "47 Kerzendorf, Wolfgang E., Sim, Stuart A. 2014 MNRAS \n", - "\n", - " Title \\\n", - "0 SN 2017hpa: a carbon-rich Type Ia supernova \n", - "1 Dalek: A Deep Learning Emulator for TARDIS \n", - "2 Exploring the diversity of double-detonation e... \n", - "3 SN 2017gci: a nearby Type I Superluminous Supe... \n", - "4 Modeling Type Ic Supernovae with TARDIS: Hidde... \n", - "5 SN 2019muj - a well-observed Type Iax supernov... \n", - "6 An investigation of* :sup:`56`\\ *Ni shells as ... \n", - "7 Artificial Intelligence-Assisted Inversion (AI... \n", - "8 AT2018kzr: the merger of an oxygen-neon white ... \n", - "9 Observations of the low-luminosity Type Iax su... \n", - "10 The Spectacular Ultraviolet Flash from the Pec... \n", - "11 Credit Lost: Two Decades of Software Citation ... \n", - "12 An asymmetric explosion mechanism may explain ... \n", - "13 SN 2019ein: New Insights into the Similarities... \n", - "14 The Lowest of the Low: Discovery of SN 2019gsc... \n", - "15 Determining the* :sup:`56`\\ *Ni distribution o... \n", - "16 Spectral modeling of type II supernovae. II. A... \n", - "17 SN2018kzr: A Rapidly Declining Transient from ... \n", - "18 Identification of strontium in the merger of t... \n", - "19 Detection of circumstellar helium in Type Iax ... \n", - "20 Monte Carlo radiative transfer \n", - "21 Gray Radiation Hydrodynamics with the FLASH Co... \n", - "22 Exploring the shell model of high-velocity fea... \n", - "23 Detecting the signatures of helium in type Iax... \n", - "24 Spectral Sequences of Type Ia Supernovae. II. ... \n", - "25 Signatures of a jet cocoon in early spectra of... \n", - "26 Spectral modeling of type II supernovae. I. Di... \n", - "27 Monte-Carlo methods for NLTE spectral synthesi... \n", - "28 Type Iax supernovae as a few-parameter family \n", - "29 The Cow: Discovery of a Luminous, Hot, and Rap... \n", - "30 Bayesian modelling of uncertainties of Monte C... \n", - "31 Modelling the early time behaviour of type Ia ... \n", - "32 Models for Type Ia Supernovae and Related Astr... \n", - "33 Abundance tomography of Type Iax SN 2011ay wit... \n", - "34 A kilonova as the electromagnetic counterpart ... \n", - "35 Spectral Sequences of Type Ia Supernovae. I. C... \n", - "36 Growing evidence that SNe Iax are not a one-pa... \n", - "37 Helium in double-detonation models of type Ia ... \n", - "38 Type Ia supernovae within dense carbon- and ox... \n", - "39 Spectropolarimetry of Superluminous Supernovae... \n", - "40 The continuing story of SN IIb 2013df: new opt... \n", - "41 The type Iax supernova, SN 2015H. A white dwar... \n", - "42 The virtual atomic and molecular data centre (... \n", - "43 Comparative analysis of SN 2012dn optical spec... \n", - "44 The CHIANTI atomic database \n", - "45 Self-consistent modelling of line-driven hot-s... \n", - "46 The impact of accretion disc winds on the opti... \n", - "47 A spectral synthesis code for rapid modelling ... \n", - "\n", - " Link \n", - "0 https://ui.adsabs.harvard.edu/abs/2021MNRAS.50... \n", - "1 https://ui.adsabs.harvard.edu/abs/2021ApJ...91... \n", - "2 https://ui.adsabs.harvard.edu/abs/2021MNRAS.50... \n", - "3 https://ui.adsabs.harvard.edu/abs/2021MNRAS.50... \n", - "4 https://ui.adsabs.harvard.edu/abs/2021ApJ...90... \n", - "5 https://ui.adsabs.harvard.edu/abs/2021MNRAS.50... \n", - "6 https://ui.adsabs.harvard.edu/abs/2020A&A...64... \n", - "7 https://ui.adsabs.harvard.edu/abs/2020ApJS..25... \n", - "8 https://ui.adsabs.harvard.edu/abs/2020MNRAS.49... \n", - "9 https://ui.adsabs.harvard.edu/abs/2020MNRAS.49... \n", - "10 https://ui.adsabs.harvard.edu/abs/2020ApJ...89... \n", - "11 https://ui.adsabs.harvard.edu/abs/2020ApJS..24... \n", - "12 https://ui.adsabs.harvard.edu/abs/2020MNRAS.49... \n", - "13 https://ui.adsabs.harvard.edu/abs/2020ApJ...89... \n", - "14 https://ui.adsabs.harvard.edu/abs/2020ApJ...89... \n", - "15 https://ui.adsabs.harvard.edu/abs/2020A&A...63... \n", - "16 https://ui.adsabs.harvard.edu/abs/2020A&A...63... \n", - "17 https://ui.adsabs.harvard.edu/abs/2019ApJ...88... \n", - "18 https://ui.adsabs.harvard.edu/abs/2019Natur.57... \n", - "19 https://ui.adsabs.harvard.edu/abs/2019MNRAS.48... \n", - "20 https://ui.adsabs.harvard.edu/abs/2019LRCA....... \n", - "21 https://ui.adsabs.harvard.edu/abs/2019ApJ...87... \n", - "22 https://ui.adsabs.harvard.edu/abs/2019MNRAS.48... \n", - "23 https://ui.adsabs.harvard.edu/abs/2019A&A...62... \n", - "24 https://ui.adsabs.harvard.edu/abs/2019ApJ...87... \n", - "25 https://ui.adsabs.harvard.edu/abs/2019Natur.56... \n", - "26 https://ui.adsabs.harvard.edu/abs/2019A&A...62... \n", - "27 https://ui.adsabs.harvard.edu/abs/2018A&A...62... \n", - "28 https://ui.adsabs.harvard.edu/abs/2018MNRAS.48... \n", - "29 https://ui.adsabs.harvard.edu/abs/2018ApJ...86... \n", - "30 https://ui.adsabs.harvard.edu/abs/2018MNRAS.47... \n", - "31 https://ui.adsabs.harvard.edu/abs/2018A&A...61... \n", - "32 https://ui.adsabs.harvard.edu/abs/2018SSRv..21... \n", - "33 https://ui.adsabs.harvard.edu/abs/2017MNRAS.47... \n", - "34 https://ui.adsabs.harvard.edu/abs/2017Natur.55... \n", - "35 https://ui.adsabs.harvard.edu/abs/2017ApJ...84... \n", - "36 https://ui.adsabs.harvard.edu/abs/2017A&A...60... \n", - "37 https://ui.adsabs.harvard.edu/abs/2017A&A...59... \n", - "38 https://ui.adsabs.harvard.edu/abs/2016MNRAS.46... \n", - "39 https://ui.adsabs.harvard.edu/abs/2016ApJ...83... \n", - "40 https://ui.adsabs.harvard.edu/abs/2016MNRAS.46... \n", - "41 https://ui.adsabs.harvard.edu/abs/2016A&A...58... \n", - "42 https://ui.adsabs.harvard.edu/abs/2016JPhB...4... \n", - "43 https://ui.adsabs.harvard.edu/abs/2016MNRAS.45... \n", - "44 https://ui.adsabs.harvard.edu/abs/2016JPhB...4... \n", - "45 https://ui.adsabs.harvard.edu/abs/2015MNRAS.45... \n", - "46 https://ui.adsabs.harvard.edu/abs/2015MNRAS.45... \n", - "47 https://ui.adsabs.harvard.edu/abs/2014MNRAS.44... " - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df" + "with open('resource_papers.rst', 'w') as rst_file:\n", + " rst_file.write('###################\\n')\n", + " rst_file.write('Papers Using TARDIS\\n')\n", + " rst_file.write('###################\\n\\n')\n", + " for article in all_cited_articles:\n", + " formatted_citation = format_citation(article)\n", + " rst_file.write(formatted_citation + '\\n\\n')" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "tardis", "language": "python", "name": "python3" }, @@ -768,9 +115,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.10" + "version": "3.12.4" } }, "nbformat": 4, - "nbformat_minor": 4 + "nbformat_minor": 2 } From eac8190414e20cf959a0ccac5764effa810c3bbc Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Tue, 13 Aug 2024 19:35:17 +0530 Subject: [PATCH 03/14] Substitute ads token variable with secret variable --- docs/resources/research_done_using_TARDIS/ads.ipynb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/resources/research_done_using_TARDIS/ads.ipynb b/docs/resources/research_done_using_TARDIS/ads.ipynb index 0d78011c20b..23dae09c5af 100644 --- a/docs/resources/research_done_using_TARDIS/ads.ipynb +++ b/docs/resources/research_done_using_TARDIS/ads.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 35, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -13,7 +13,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -45,7 +45,7 @@ " encoded_query_bib = urlencode(query)\n", "\n", " bib_results = requests.get(f\"{BASE_URL}/query?{encoded_query_bib}\", \n", - " headers={'Authorization': 'Bearer ' + ads_token})\n", + " headers={'Authorization': 'Bearer ' + os.environ['NASA_ADS_TOKEN']})\n", " numFound = bib_results.json()['response']['numFound']\n", " articles = bib_results.json()['response']['docs']\n", " fetched_rows = len(articles)\n", @@ -60,7 +60,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -69,7 +69,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -85,7 +85,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ From 71957a3cb6f482085a862bd66954fb59bdc4352f Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Wed, 14 Aug 2024 10:41:20 +0530 Subject: [PATCH 04/14] Create a separate workflow for fetching research papers using tardis --- .github/workflows/tardis-research-papers.yml | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/tardis-research-papers.yml diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml new file mode 100644 index 00000000000..c740cd6e6a1 --- /dev/null +++ b/.github/workflows/tardis-research-papers.yml @@ -0,0 +1,41 @@ +name: tardis-research-papers + +on: + schedule: + - cron: "0 0 1 * *" + workflow_dispatch: + +defaults: + run: + shell: bash -l {0} + +jobs: + research-using-tardis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install jupyter nbconvert + + - name: Shift to research_done_using_tardis directory + run: | + cd docs/resources/research_done_using_TARDIS/ + + - name: Run the ADS notebook + run: | + jupyter nbconvert --to python ads.ipynb + python3 ads.py + + - uses: actions/upload-artifact@v4 + with: + name: research_papers + path: | + docs/resources/research_done_using_TARDIS/resource_papers.rst \ No newline at end of file From 172eee74ef714900bb06e670b1bb345a6a0a9c43 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Wed, 14 Aug 2024 10:42:05 +0530 Subject: [PATCH 05/14] Remove redundant code --- .github/workflows/post-release.yml | 33 +----------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 70e34221208..b7918a42829 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -88,38 +88,8 @@ jobs: README.rst docs/resources/credits.rst - research-using-tardis: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install jupyter nbconvert - - - name: Shift to research_done_using_tardis directory - run: | - cd docs/resources/research_done_using_TARDIS/ - - - name: Run the ADS notebook - run: | - jupyter nbconvert --to python ads.ipynb - python3 ads.py - - - uses: actions/upload-artifact@v4 - with: - name: research_papers - path: | - docs/resources/research_done_using_TARDIS/resource_papers.rst - pull_request: - needs: [changelog, citation, credits, research-using-tardis] + needs: [changelog, citation, credits] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -133,7 +103,6 @@ jobs: cp /tmp/changelog/CHANGELOG.md . cp /tmp/citation/CITATION.cff . cp -r /tmp/credits/* . - cp /tmp/research_papers/* - name: Get current date run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV From fb6b45c10f88c5aee57df28a5303d68a6942a0cc Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Wed, 14 Aug 2024 13:50:59 +0530 Subject: [PATCH 06/14] Create a PR and dispatch to tardis org data --- .github/workflows/tardis-research-papers.yml | 81 +++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml index c740cd6e6a1..51a9e5d00bf 100644 --- a/.github/workflows/tardis-research-papers.yml +++ b/.github/workflows/tardis-research-papers.yml @@ -9,6 +9,9 @@ defaults: run: shell: bash -l {0} +env: + NASA_ADS_TOKEN: ${{ secrets.NASA_ADS_TOKEN }} + jobs: research-using-tardis: runs-on: ubuntu-latest @@ -38,4 +41,80 @@ jobs: with: name: research_papers path: | - docs/resources/research_done_using_TARDIS/resource_papers.rst \ No newline at end of file + docs/resources/research_done_using_TARDIS/resource_papers.rst + + pull_request: + needs: [research-using-tardis] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + path: /tmp + + - name: Copy files to repository + run: | + cp /tmp/research_papers/* . + + - name: Get current date + run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV + + - uses: peter-evans/create-pull-request@v4 + with: + token: ${{ secrets.BOT_TOKEN }} + committer: TARDIS Bot + author: TARDIS Bot + branch: TARDIS-research-papers-${{ env.DATE }} + base: master + push-to-fork: tardis-bot/tardis + commit-message: Automated changes for TARDIS-research-papers ${{ env.DATE }} + title: TARDIS-research-papers ${{ env.DATE }} + body: | + *\*beep\* \*bop\** + + Hi, human. + + > This pull request contains the latest updates to the research papers that utilize the TARDIS. + + > This pull request should be auto-merged. + labels: automated, build-docs + team-reviewers: tardis-infrastructure + id: create-pr + + - name: Wait for pull request + run: sleep 30 + + - name: Approve pull request (I) + run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve + env: + GITHUB_TOKEN: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} + if: steps.create-pr.outputs.pull-request-operation == 'created' + + - name: Approve pull request (II) + run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve + env: + GITHUB_TOKEN: ${{ secrets.CORE_COORDINATOR_TOKEN }} + if: steps.create-pr.outputs.pull-request-operation == 'created' + + - name: Enable automerge + uses: peter-evans/enable-pull-request-automerge@v2 + with: + token: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} + pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} + merge-method: squash + if: steps.create-pr.outputs.pull-request-operation == 'created' + + dispatch-to-websites: + name: Dispatch to All Websites + runs-on: ubuntu-latest + needs: [research-using-tardis] + steps: + - name: Dispatch to Tardis-org-data + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.BOT_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -H "Content-Type: application/json" \ + -d '{ "event_type": "repo-push" }' \ + https://api.github.com/repos/tardis-sn/tardis-org-data/dispatches \ No newline at end of file From 558cfebbd7e16b886a7af03c7edc5cfdf3675d11 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Wed, 14 Aug 2024 13:51:10 +0530 Subject: [PATCH 07/14] Remove environment variable --- .github/workflows/post-release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index b7918a42829..173656f951a 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -10,9 +10,6 @@ on: workflow_dispatch: # manual trigger -env: - NASA_ADS_TOKEN: ${{ secrets.NASA_ADS_TOKEN }} - jobs: changelog: runs-on: ubuntu-latest From 72b5c4430b0c59478c7cda51c6d07c80061d99a8 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Wed, 14 Aug 2024 18:15:48 +0530 Subject: [PATCH 08/14] Fix destination path for research papers and dispatch to tardis org data if the owner is tardis-sn --- .github/workflows/tardis-research-papers.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml index 51a9e5d00bf..2192c51c85c 100644 --- a/.github/workflows/tardis-research-papers.yml +++ b/.github/workflows/tardis-research-papers.yml @@ -27,21 +27,17 @@ jobs: run: | python -m pip install --upgrade pip pip install jupyter nbconvert - - - name: Shift to research_done_using_tardis directory - run: | - cd docs/resources/research_done_using_TARDIS/ - + - name: Run the ADS notebook run: | - jupyter nbconvert --to python ads.ipynb - python3 ads.py + jupyter nbconvert --to python docs/resources/research_done_using_TARDIS/ads.ipynb + python3 docs/resources/research_done_using_TARDIS/ads.py - uses: actions/upload-artifact@v4 with: name: research_papers path: | - docs/resources/research_done_using_TARDIS/resource_papers.rst + resource_papers.rst pull_request: needs: [research-using-tardis] @@ -55,7 +51,7 @@ jobs: - name: Copy files to repository run: | - cp /tmp/research_papers/* . + cp -r /tmp/resource_papers/* docs/resources/research_done_using_TARDIS/ - name: Get current date run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV @@ -109,6 +105,7 @@ jobs: name: Dispatch to All Websites runs-on: ubuntu-latest needs: [research-using-tardis] + if: github.repository_owner == 'tardis-sn' steps: - name: Dispatch to Tardis-org-data run: | From 58afed9ff1ee4a8af6e55b295dba7bac11cf1907 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Wed, 14 Aug 2024 19:21:41 +0530 Subject: [PATCH 09/14] Update event type in dispatch job --- .github/workflows/tardis-research-papers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml index 2192c51c85c..296044149a1 100644 --- a/.github/workflows/tardis-research-papers.yml +++ b/.github/workflows/tardis-research-papers.yml @@ -113,5 +113,5 @@ jobs: -H "Authorization: Bearer ${{ secrets.BOT_TOKEN }}" \ -H "Accept: application/vnd.github+json" \ -H "Content-Type: application/json" \ - -d '{ "event_type": "repo-push" }' \ + -d '{ "event_type": "fetch-papers" }' \ https://api.github.com/repos/tardis-sn/tardis-org-data/dispatches \ No newline at end of file From 7df634d21bcad1410f1ac25efdfe568ec08fdb8f Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Wed, 14 Aug 2024 19:22:12 +0530 Subject: [PATCH 10/14] Renaming job --- .github/workflows/tardis-research-papers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml index 296044149a1..abeaaccd7c8 100644 --- a/.github/workflows/tardis-research-papers.yml +++ b/.github/workflows/tardis-research-papers.yml @@ -101,8 +101,8 @@ jobs: merge-method: squash if: steps.create-pr.outputs.pull-request-operation == 'created' - dispatch-to-websites: - name: Dispatch to All Websites + dispatch-to-tardis-website: + name: Dispatch to Tardis Website runs-on: ubuntu-latest needs: [research-using-tardis] if: github.repository_owner == 'tardis-sn' From c390ef5ff6e5b93d504c2b60db35d13808c3cef8 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Mon, 19 Aug 2024 12:24:06 +0530 Subject: [PATCH 11/14] Reduce indentation --- .github/workflows/tardis-research-papers.yml | 184 +++++++++---------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml index abeaaccd7c8..a7e0a55a026 100644 --- a/.github/workflows/tardis-research-papers.yml +++ b/.github/workflows/tardis-research-papers.yml @@ -14,104 +14,104 @@ env: jobs: research-using-tardis: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install jupyter nbconvert - - - name: Run the ADS notebook - run: | - jupyter nbconvert --to python docs/resources/research_done_using_TARDIS/ads.ipynb - python3 docs/resources/research_done_using_TARDIS/ads.py - - - uses: actions/upload-artifact@v4 - with: - name: research_papers - path: | - resource_papers.rst + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install jupyter nbconvert + + - name: Run the ADS notebook + run: | + jupyter nbconvert --to python docs/resources/research_done_using_TARDIS/ads.ipynb + python3 docs/resources/research_done_using_TARDIS/ads.py + + - uses: actions/upload-artifact@v4 + with: + name: research_papers + path: | + resource_papers.rst pull_request: - needs: [research-using-tardis] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + needs: [research-using-tardis] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 - with: - path: /tmp - - - name: Copy files to repository - run: | - cp -r /tmp/resource_papers/* docs/resources/research_done_using_TARDIS/ - - - name: Get current date - run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV - - - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.BOT_TOKEN }} - committer: TARDIS Bot - author: TARDIS Bot - branch: TARDIS-research-papers-${{ env.DATE }} - base: master - push-to-fork: tardis-bot/tardis - commit-message: Automated changes for TARDIS-research-papers ${{ env.DATE }} - title: TARDIS-research-papers ${{ env.DATE }} - body: | - *\*beep\* \*bop\** - - Hi, human. - - > This pull request contains the latest updates to the research papers that utilize the TARDIS. - - > This pull request should be auto-merged. - labels: automated, build-docs - team-reviewers: tardis-infrastructure - id: create-pr - - - name: Wait for pull request - run: sleep 30 + - uses: actions/download-artifact@v4 + with: + path: /tmp + + - name: Copy files to repository + run: | + cp -r /tmp/resource_papers/* docs/resources/research_done_using_TARDIS/ + + - name: Get current date + run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV + + - uses: peter-evans/create-pull-request@v4 + with: + token: ${{ secrets.BOT_TOKEN }} + committer: TARDIS Bot + author: TARDIS Bot + branch: TARDIS-research-papers-${{ env.DATE }} + base: master + push-to-fork: tardis-bot/tardis + commit-message: Automated changes for TARDIS-research-papers ${{ env.DATE }} + title: TARDIS-research-papers ${{ env.DATE }} + body: | + *\*beep\* \*bop\** - - name: Approve pull request (I) - run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve - env: - GITHUB_TOKEN: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} - if: steps.create-pr.outputs.pull-request-operation == 'created' + Hi, human. - - name: Approve pull request (II) - run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve - env: - GITHUB_TOKEN: ${{ secrets.CORE_COORDINATOR_TOKEN }} - if: steps.create-pr.outputs.pull-request-operation == 'created' + > This pull request contains the latest updates to the research papers that utilize the TARDIS. - - name: Enable automerge - uses: peter-evans/enable-pull-request-automerge@v2 - with: - token: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} - pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} - merge-method: squash - if: steps.create-pr.outputs.pull-request-operation == 'created' + > This pull request should be auto-merged. + labels: automated, build-docs + team-reviewers: tardis-infrastructure + id: create-pr + + - name: Wait for pull request + run: sleep 30 + + - name: Approve pull request (I) + run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve + env: + GITHUB_TOKEN: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} + if: steps.create-pr.outputs.pull-request-operation == 'created' + + - name: Approve pull request (II) + run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve + env: + GITHUB_TOKEN: ${{ secrets.CORE_COORDINATOR_TOKEN }} + if: steps.create-pr.outputs.pull-request-operation == 'created' + + - name: Enable automerge + uses: peter-evans/enable-pull-request-automerge@v2 + with: + token: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} + pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} + merge-method: squash + if: steps.create-pr.outputs.pull-request-operation == 'created' dispatch-to-tardis-website: - name: Dispatch to Tardis Website - runs-on: ubuntu-latest - needs: [research-using-tardis] - if: github.repository_owner == 'tardis-sn' - steps: - - name: Dispatch to Tardis-org-data - run: | - curl -X POST \ - -H "Authorization: Bearer ${{ secrets.BOT_TOKEN }}" \ - -H "Accept: application/vnd.github+json" \ - -H "Content-Type: application/json" \ - -d '{ "event_type": "fetch-papers" }' \ - https://api.github.com/repos/tardis-sn/tardis-org-data/dispatches \ No newline at end of file + name: Dispatch to Tardis Website + runs-on: ubuntu-latest + needs: [research-using-tardis] + if: github.repository_owner == 'tardis-sn' + steps: + - name: Dispatch to Tardis-org-data + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.BOT_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + -H "Content-Type: application/json" \ + -d '{ "event_type": "fetch-papers" }' \ + https://api.github.com/repos/tardis-sn/tardis-org-data/dispatches \ No newline at end of file From 6049e510f9bf53dd4634548b359e36f788668d31 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Mon, 19 Aug 2024 13:35:06 +0530 Subject: [PATCH 12/14] Use micromamba to install dependencies --- .github/workflows/tardis-research-papers.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml index a7e0a55a026..bbdd30ff1e9 100644 --- a/.github/workflows/tardis-research-papers.yml +++ b/.github/workflows/tardis-research-papers.yml @@ -18,15 +18,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 + - name: Setup micromamba + uses: mamba-org/setup-micromamba@v1 with: - python-version: "3.x" + environment-name: fetch-env + create-args: >- + python=3.10 - - name: Install dependencies + - name: Activate environment + run: micromamba activate fetch-env + + - name: Install additional dependencies run: | - python -m pip install --upgrade pip - pip install jupyter nbconvert + micromamba install -y jupyter - name: Run the ADS notebook run: | From 92eded1fd02cc31f7c9b2040d05871f0fb2a4cf2 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Mon, 19 Aug 2024 15:06:00 +0530 Subject: [PATCH 13/14] Install dependencies in one step --- .github/workflows/tardis-research-papers.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml index bbdd30ff1e9..8f973f970ce 100644 --- a/.github/workflows/tardis-research-papers.yml +++ b/.github/workflows/tardis-research-papers.yml @@ -18,19 +18,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup micromamba + - name: Setup micromamba and install dependencies uses: mamba-org/setup-micromamba@v1 with: environment-name: fetch-env create-args: >- python=3.10 - - - name: Activate environment - run: micromamba activate fetch-env - - - name: Install additional dependencies - run: | - micromamba install -y jupyter + jupyter - name: Run the ADS notebook run: | From bf40f9420eb99238617f66a377ce871e7647b4d8 Mon Sep 17 00:00:00 2001 From: KasukabeDefenceForce Date: Mon, 19 Aug 2024 16:55:06 +0530 Subject: [PATCH 14/14] Change step name --- .github/workflows/tardis-research-papers.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tardis-research-papers.yml b/.github/workflows/tardis-research-papers.yml index 8f973f970ce..e6c76011d0b 100644 --- a/.github/workflows/tardis-research-papers.yml +++ b/.github/workflows/tardis-research-papers.yml @@ -18,13 +18,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup micromamba and install dependencies + - name: Setup micromamba uses: mamba-org/setup-micromamba@v1 with: environment-name: fetch-env create-args: >- python=3.10 - jupyter + jupyter - name: Run the ADS notebook run: | @@ -49,7 +49,8 @@ jobs: - name: Copy files to repository run: | - cp -r /tmp/resource_papers/* docs/resources/research_done_using_TARDIS/ + ls -l /tmp + cp -r /tmp/research_papers/* docs/resources/research_done_using_TARDIS/ - name: Get current date run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV