Skip to content

Commit

Permalink
Move to Django 2
Browse files Browse the repository at this point in the history
  • Loading branch information
xnx committed Feb 13, 2020
1 parent 8c3984c commit 4d9e3f7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 154 deletions.
144 changes: 18 additions & 126 deletions notebooks/References Notebook 2020.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -90,17 +90,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enter DOI Here: 10.1016/j.jqsrt.2019.106711\n"
]
}
],
"outputs": [],
"source": [
"# Enter your token here: You need this for using step 2 and 3\n",
"# A token can only be used once you have an account on NASA/ADS https://ui.adsabs.harvard.edu/. \n",
Expand All @@ -121,17 +113,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Bibcode: 2020JQSRT.24106711C\n"
]
}
],
"outputs": [],
"source": [
"def get_citeproc_authors(cpd_author):\n",
" if cpd_author is None:\n",
Expand Down Expand Up @@ -267,25 +251,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"authors: Conway, E. K., I. E. Gordon, A. A. Kyuberis, O. L. Polyansky, J. Tennyson, and N. F. Zobov\n",
"title: Calculated line lists for H<SUB>2</SUB><SUP>16</SUP>O and H<SUB>2</SUB><SUP>18</SUP>O with extensive comparisons to theoretical and experimental sources including the HITRAN2016 database\n",
"journal: Journal of Quantitative Spectroscopy and Radiative Transfer\n",
"volume: 241\n",
"start-page: 106711\n",
"end-page: %P\n",
"year: 2020\n",
"doi: 10.1016/j.jqsrt.2019.106711\n",
"bibcode: https://ui.adsabs.harvard.edu/abs/2020JQSRT.24106711C\n"
]
}
],
"outputs": [],
"source": [
"# HTML with the characters &, <, >, and “ included\n",
"payload = {\"bibcode\": [\"{}\".format(Bibcode)],\n",
Expand Down Expand Up @@ -326,25 +294,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"authors: Conway, E.~K., I.~E. Gordon, A.~A. Kyuberis, O.~L. Polyansky, J. Tennyson, and N.~F. Zobov\n",
"title: Calculated line lists for H$_{2}$$^{16}$O and H$_{2}$$^{18}$O with extensive comparisons to theoretical and experimental sources including the HITRAN2016 database\n",
"journal: Journal of Quantitative Spectroscopy and Radiative Transfer\n",
"volume: 241\n",
"start-page: 106711\n",
"end-page: %P\n",
"year: 2020\n",
"doi: 10.1016/j.jqsrt.2019.106711\n",
"bibcode: https://ui.adsabs.harvard.edu/abs/2020JQSRT.24106711C\n"
]
}
],
"outputs": [],
"source": [
"# BibTeX Reference\n",
"payload = {\"bibcode\": [\"{}\".format(Bibcode)],\n",
Expand Down Expand Up @@ -389,25 +341,9 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"authors: Conway, E. K., I. E. Gordon, A. A. Kyuberis, O. L. Polyansky, J. Tennyson, and N. F. Zobov\n",
"title: Calculated line lists for H&lt;SUB&gt;2&lt;/SUB&gt;&lt;SUP&gt;16&lt;/SUP&gt;O and H&lt;SUB&gt;2&lt;/SUB&gt;&lt;SUP&gt;18&lt;/SUP&gt;O with extensive comparisons to theoretical and experimental sources including the HITRAN2016 database\n",
"journal: Journal of Quantitative Spectroscopy and Radiative Transfer\n",
"volume: 241\n",
"start-page: 106711\n",
"end-page: %P\n",
"year: 2020\n",
"doi: 10.1016/j.jqsrt.2019.106711\n",
"bibcode: https://ui.adsabs.harvard.edu/abs/2020JQSRT.24106711C\n"
]
}
],
"outputs": [],
"source": [
"# HTML with the characters &, <, >, and “ are converted to &amp;, &lt;, &gt;, and &quot;, respectively.\n",
"payload = {\"bibcode\": [\"{}\".format(Bibcode)],\n",
Expand Down Expand Up @@ -450,26 +386,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Authors: E. K. Conway, I. E. Gordon, A. A. Kyuberis, O. L. Polyansky, J. Tennyson, N. F. Zobov \n",
"Title: Calculated line lists for H216O and H218O with extensive comparisons to theoretical and experimental sources including the HITRAN2016 database \n",
"Journal: Journal of Quantitative Spectroscopy and Radiative Transfer \n",
"Volume: 241 \n",
"Year: 2020 \n",
"Page Start: 106711 \n",
"Page End: \n",
"Article Number: 106711 \n",
"DOI: 10.1016/j.jqsrt.2019.106711 \n",
"URL: http://dx.doi.org/10.1016/j.jqsrt.2019.106711 \n"
]
}
],
"outputs": [],
"source": [
"#doi = input(\"Enter doi Here: \")\n",
"doi_fetched = get_source_from_doi('{}'.format(doi))\n",
Expand Down Expand Up @@ -500,20 +419,9 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'(&#x27;E. K. Conway, I. E. Gordon, A. A. Kyuberis, O. L. Polyansky, J. Tennyson, N. F. Zobov&#x27;, &#x27;Calculated line lists for H216O and H218O with extensive comparisons to theoretical and experimental sources including the HITRAN2016 database&#x27;, &#x27;Journal of Quantitative Spectroscopy and Radiative Transfer&#x27;, &#x27;241&#x27;, 2020, &#x27;106711&#x27;, &#x27;&#x27;, &#x27;10.1016/j.jqsrt.2019.106711&#x27;, &#x27;http://dx.doi.org/10.1016/j.jqsrt.2019.106711&#x27;, &#x27;106711&#x27;)'"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# Here is the populated output from the urllib method\n",
"# This will replace (\"\"\"& < \" '> \"\"\" ) with (&amp; &lt; &quot; &#x27; &gt;)\n",
Expand All @@ -531,25 +439,9 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"@article{conway2020calculated,\n",
" title={Calculated line lists for H216O and H218O with extensive comparisons to theoretical and experimental sources including the HITRAN2016 database},\n",
" author={Conway, Eamon K and Gordon, Iouli E and Kyuberis, Aleksandra A and Polyansky, Oleg L and Tennyson, Jonathan and Zobov, Nikolai F},\n",
" journal={Journal of Quantitative Spectroscopy and Radiative Transfer},\n",
" volume={241},\n",
" pages={106711},\n",
" year={2020},\n",
" publisher={Elsevier}\n",
"}\n"
]
}
],
"outputs": [],
"source": [
"\"\"\"Library to query Google Scholar.\n",
"Call the method query with a string which contains the full search\n",
Expand Down Expand Up @@ -690,7 +582,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.6.10"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions pyref/pyref/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.urls import path, include
from django.contrib import admin

import refs.urls

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^refs/', include(refs.urls)),
path('admin/', admin.site.urls),
path('refs/', include(refs.urls)),
]
10 changes: 5 additions & 5 deletions pyref/refs/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.conf.urls import include, url
from django.urls import include, path, re_path
from . import views

app_name = 'refs'
urlpatterns = [
url(r'^$', views.ref_list, name='ref_list'),
url(r'^resolve/(?:(?P<pk>\d+))?$', views.resolve, name='resolve'),
url(r'^delete/(?P<pk>\d+)$', views.delete, name='delete'),
url(r'^edit/(?:(?P<pk>\d+))?$', views.edit, name='edit'),
path('', views.ref_list, name='ref_list'),
re_path(r'^resolve/(?:(?P<pk>\d+))?$', views.resolve, name='resolve'),
re_path(r'^delete/(?P<pk>\d+)$', views.delete, name='delete'),
re_path(r'^edit/(?:(?P<pk>\d+))?$', views.edit, name='edit'),
]
39 changes: 19 additions & 20 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,49 @@ certifi==2019.11.28
chardet==3.0.4
decorator==4.4.1
defusedxml==0.6.0
Django==1.11.8
Django==1.11.28
entrypoints==0.3
idna==2.8
importlib-metadata==1.3.0
ipykernel==5.1.3
ipython==7.10.2
importlib-metadata==1.5.0
ipykernel==5.1.4
ipython==7.12.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
jedi==0.15.1
Jinja2==2.10.3
jedi==0.16.0
Jinja2==2.11.1
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==5.3.4
jupyter-console==5.2.0
jupyter-core==4.6.1
jupyter-console==6.1.0
jupyter-core==4.6.2
MarkupSafe==1.1.1
mistune==0.8.4
more-itertools==7.2.0
mysqlclient==1.4.6
nbconvert==5.6.1
nbformat==4.4.0
notebook==6.0.2
nbformat==5.0.4
notebook==6.0.3
pandocfilters==1.4.2
parso==0.5.2
pexpect==4.7.0
parso==0.6.1
pexpect==4.8.0
pickleshare==0.7.5
prometheus-client==0.7.1
prompt-toolkit==3.0.2
prompt-toolkit==3.0.3
ptyprocess==0.6.0
Pygments==2.5.2
pyrsistent==0.15.6
pyrsistent==0.15.7
python-dateutil==2.8.1
pytz==2019.3
pyzmq==18.1.0
pyzmq==18.1.1
qtconsole==4.6.0
requests==2.22.0
Send2Trash==1.5.0
six==1.13.0
six==1.14.0
terminado==0.8.3
testpath==0.4.4
tornado==6.0.3
traitlets==4.3.3
urllib3==1.25.7
wcwidth==0.1.7
urllib3==1.25.8
wcwidth==0.1.8
webencodings==0.5.1
widgetsnbextension==3.5.1
zipp==0.6.0
zipp==2.2.0

0 comments on commit 4d9e3f7

Please sign in to comment.