diff --git a/pubs/apis.py b/pubs/apis.py
index aef5c5d..064d23a 100644
--- a/pubs/apis.py
+++ b/pubs/apis.py
@@ -15,7 +15,7 @@ class ReferenceNotFoundError(Exception):
pass
-def get_bibentry_from_api(id_str, id_type, try_doi=True, ui=None):
+def get_bibentry_from_api(id_str, id_type, try_doi=True, ui=None, raw=False):
"""Return a bibtex string from various ID methods.
This is a wrapper around functions that will return a bibtex string given
@@ -50,6 +50,9 @@ def get_bibentry_from_api(id_str, id_type, try_doi=True, ui=None):
raise ValueError('id_type must be one of `doi`, `isbn`, or `arxiv`.')
bibentry_raw = id_fns[id_type](id_str, try_doi=try_doi, ui=ui)
+ if raw:
+ return bibentry_raw
+
bibentry = endecoder.EnDecoder().decode_bibdata(bibentry_raw)
if bibentry is None:
raise ReferenceNotFoundError(
diff --git a/pubs/bibstruct.py b/pubs/bibstruct.py
index 541d4b6..9e3e3f4 100644
--- a/pubs/bibstruct.py
+++ b/pubs/bibstruct.py
@@ -51,7 +51,7 @@ def author_last(author_str):
return author_str.split(',')[0]
-def generate_citekey(bibdata):
+def generate_citekey(bibdata, generate=True):
""" Generate a citekey from bib_data.
:param generate: if False, return the citekey defined in the file,
diff --git a/pubs/commands/__init__.py b/pubs/commands/__init__.py
index ed5defa..ddd40ad 100644
--- a/pubs/commands/__init__.py
+++ b/pubs/commands/__init__.py
@@ -18,3 +18,4 @@ from . import import_cmd
# bonus
from . import websearch_cmd
from . import url_cmd
+#from . import bibtex_cmd
diff --git a/pubs/commands/add_cmd.py b/pubs/commands/add_cmd.py
index 12b87cd..1aa2ec7 100644
--- a/pubs/commands/add_cmd.py
+++ b/pubs/commands/add_cmd.py
@@ -72,6 +72,22 @@ def bibentry_from_editor(conf, ui):
return bibentry
+def bibentry_from_api(args, ui, raw=False):
+ try:
+ if args.doi is not None:
+ return apis.get_bibentry_from_api(args.doi, 'doi', ui=ui, raw=raw)
+ elif args.isbn is not None:
+ return apis.get_bibentry_from_api(args.isbn, 'isbn', ui=ui, raw=raw)
+ # TODO distinguish between cases, offer to open the error page in a webbrowser.
+ # TODO offer to confirm/change citekey
+ elif args.arxiv is not None:
+ return apis.get_bibentry_from_api(args.arxiv, 'arxiv', ui=ui, raw=raw)
+ except apis.ReferenceNotFoundError as e:
+ ui.error(str(e))
+ ui.exit(1)
+
+
+
def command(conf, args):
"""
:param bibfile: bibtex file (in .bib, .bibml or .yaml format.
@@ -92,19 +108,7 @@ def command(conf, args):
if args.doi is None and args.isbn is None and args.arxiv is None:
bibentry = bibentry_from_editor(conf, ui)
else:
- bibentry = None
- try:
- if args.doi is not None:
- bibentry = apis.get_bibentry_from_api(args.doi, 'doi', ui=ui)
- elif args.isbn is not None:
- bibentry = apis.get_bibentry_from_api(args.isbn, 'isbn', ui=ui)
- # TODO distinguish between cases, offer to open the error page in a webbrowser.
- # TODO offer to confirm/change citekey
- elif args.arxiv is not None:
- bibentry = apis.get_bibentry_from_api(args.arxiv, 'arxiv', ui=ui)
- except apis.ReferenceNotFoundError as e:
- ui.error(str(e))
- ui.exit(1)
+ bibentry = bibentry_from_api(args, ui)
else:
bibentry_raw = content.get_content(bibfile, ui=ui)
bibentry = decoder.decode_bibdata(bibentry_raw)
@@ -116,7 +120,7 @@ def command(conf, args):
citekey = args.citekey
if citekey is None:
base_key = bibstruct.extract_citekey(bibentry)
- citekey = rp.unique_citekey(base_key)
+ citekey = rp.unique_citekey(base_key, bibentry)
elif citekey in rp:
ui.error('citekey already exist {}.'.format(citekey))
ui.exit(1)
diff --git a/pubs/commands/import_cmd.py b/pubs/commands/import_cmd.py
index 7cbf3b6..6d51488 100644
--- a/pubs/commands/import_cmd.py
+++ b/pubs/commands/import_cmd.py
@@ -14,26 +14,28 @@ from ..content import system_path, read_text_file
from ..command_utils import add_doc_copy_arguments
-_ABORT_USE_IGNORE_MSG = "Aborting import. Use --ignore-malformed to ignore."
+_ABORT_USE_IGNORE_MSG = " Aborting import. Use --ignore-malformed to ignore."
_IGNORING_MSG = " Ignoring it."
def parser(subparsers, conf):
parser = subparsers.add_parser(
'import',
- help='import paper(s) to the repository')
+ help='import paper(s) to the repository.')
parser.add_argument(
'bibpath',
- help='path to bibtex, bibtexml or bibyaml file (or directory)')
+ help=("path to bibtex, bibtexml or bibyaml file, or a directory "
+ "containing such files; will not recurse into subdirectories."))
parser.add_argument(
'keys', nargs='*',
- help="one or several keys to import from the file")
+ help=("one or several keys to import from the file; if not provided,"
+ " all entries will be imported."))
parser.add_argument(
'-O', '--overwrite', action='store_true', default=False,
- help="Overwrite keys already in the database")
+ help="overwrite keys already in the database.")
parser.add_argument(
'-i', '--ignore-malformed', action='store_true', default=False,
- help="Ignore malformed and unreadable files and entries")
+ help="ignore malformed and unreadable files and entries.")
add_doc_copy_arguments(parser, copy=False)
return parser
diff --git a/pubs/p3.py b/pubs/p3.py
index 197d26f..c78fa7e 100644
--- a/pubs/p3.py
+++ b/pubs/p3.py
@@ -87,10 +87,14 @@ else:
super(StdIO, self).__init__(*args, **kwargs)
def write(self, s):
+ super(StdIO, self).write(s)
if self.additional_out is not None:
+ try:
+ s = s.decode()
+ except AttributeError:
+ pass
self.additional_out.write(s)
- super(StdIO, self).write(s)
# Only for tests to capture std{out,err}
def _fake_stdio(additional_out=False):
diff --git a/pubs/pubs_cmd.py b/pubs/pubs_cmd.py
index 740c709..08911cb 100644
--- a/pubs/pubs_cmd.py
+++ b/pubs/pubs_cmd.py
@@ -32,6 +32,7 @@ CORE_CMDS = collections.OrderedDict([
('websearch', commands.websearch_cmd),
('url', commands.url_cmd),
+ #('bibtex', commands.bibtex_cmd),
])
diff --git a/pubs/repo.py b/pubs/repo.py
index 51cd666..bb687b6 100644
--- a/pubs/repo.py
+++ b/pubs/repo.py
@@ -192,8 +192,16 @@ class Repository(object):
p.docpath = docfile
self.push_paper(p, overwrite=True, event=False)
- def unique_citekey(self, base_key):
- """Create a unique citekey for a given basekey."""
+ def unique_citekey(self, base_key, bibentry):
+ """Create a unique citekey for a given base key.
+
+ :param base_key: the base key in question.
+ :param bibentry: the bib entry to possibly generate the citekey.
+ """
+ # can't have `/` in citekeys
+ # FIXME: a bit crude, but efficient for now (and allows unicode citekeys)
+ if '/' in base_key:
+ base_key = bibstruct.generate_citekey(bibentry)
for n in itertools.count():
if not base_key + _base27(n) in self.citekeys:
return base_key + _base27(n)
diff --git a/readme.md b/readme.md
index 5e618e0..dd2d902 100644
--- a/readme.md
+++ b/readme.md
@@ -86,7 +86,7 @@ and then add `\cite{Loeb_2012}` in your manuscript. After exporting the bibliogr
You can attach a document to a reference:
```
- pubs add Loeb2012_downloaded.pdf Loeb_2012
+ pubs doc add Loeb2012_downloaded.pdf Loeb_2012
```
And open your documents automatically from the command line:
diff --git a/tests/data/collection.bib b/tests/data/collection.bib
new file mode 100644
index 0000000..2c240fe
--- /dev/null
+++ b/tests/data/collection.bib
@@ -0,0 +1,41 @@
+@article{Einstein_1935,
+ doi = {10.1103/physrev.47.777},
+ url = {https://doi.org/10.1103%2Fphysrev.47.777},
+ year = 1935,
+ month = {may},
+ publisher = {American Physical Society ({APS})},
+ volume = {47},
+ number = {10},
+ pages = {777--780},
+ author = {A. Einstein and B. Podolsky and N. Rosen},
+ title = {Can Quantum-Mechanical Description of Physical Reality Be Considered Complete?},
+ journal = {Physical Review}
+}
+
+@article{Schrodinger_1935,
+ doi = {10.1017/s0305004100013554},
+ url = {https://doi.org/10.1017%2Fs0305004100013554},
+ year = 1935,
+ month = {oct},
+ publisher = {Cambridge University Press ({CUP})},
+ volume = {31},
+ number = {04},
+ pages = {555},
+ author = {E. Schrödinger and M. Born},
+ title = {Discussion of Probability Relations between Separated Systems},
+ journal = {Mathematical Proceedings of the Cambridge Philosophical Society}
+}
+
+@article{Bell_1964,
+ doi = {10.1103/physicsphysiquefizika.1.195},
+ url = {https://doi.org/10.1103%2Fphysicsphysiquefizika.1.195},
+ year = 1964,
+ month = {nov},
+ publisher = {American Physical Society ({APS})},
+ volume = {1},
+ number = {3},
+ pages = {195--200},
+ author = {J. S. Bell},
+ title = {On the Einstein Podolsky Rosen paradox},
+ journal = {Physics Physique {\cyrchar\cyrf}{\cyrchar\cyri}{\cyrchar\cyrz}{\cyrchar\cyri}{\cyrchar\cyrk}{\cyrchar\cyra}}
+}
diff --git a/tests/readme.txt b/tests/readme.md
similarity index 53%
rename from tests/readme.txt
rename to tests/readme.md
index 88a6a13..356786e 100644
--- a/tests/readme.txt
+++ b/tests/readme.md
@@ -1,7 +1,11 @@
1. Install the dependencies using:
-> pip install -r requirements.txt
+```
+pip install -r ../dev_requirements.txt
+```
2. Run the tests using:
-> python -m unittest discover
+```
+python setup.py test
+```
-If you use nosetest, it will complain about addExpectedFailure, which you can safely disregard.
+If you use nosetest, it will complain about addExpectedFailure, which you can safely disregard.
diff --git a/tests/test_apis.py b/tests/test_apis.py
index 0a7feb9..e4d9d4b 100644
--- a/tests/test_apis.py
+++ b/tests/test_apis.py
@@ -16,8 +16,12 @@ import mock_requests
class APITests(unittest.TestCase):
- pass
+ @mock.patch('pubs.apis.requests.get', side_effect=mock_requests.mock_requests_get)
+ def test_readme(self, reqget):
+ apis.doi2bibtex('10.1007/s00422-012-0514-6')
+ apis.isbn2bibtex('978-0822324669')
+ apis.arxiv2bibtex('math/9501234')
class TestDOI2Bibtex(APITests):
diff --git a/tests/test_apis_data.json b/tests/test_apis_data.json
index 8fe73aa..14e76d9 100644
--- a/tests/test_apis_data.json
+++ b/tests/test_apis_data.json
@@ -25,6 +25,58 @@
200,
null
],
+ [
+ [
+ "https://dx.doi.org/10.1007/s00422-012-0514-6"
+ ],
+ {
+ "headers": {
+ "accept": "application/x-bibtex"
+ }
+ },
+ "@article{Loeb_2012,\n\tdoi = {10.1007/s00422-012-0514-6},\n\turl = {https://doi.org/10.1007%2Fs00422-012-0514-6},\n\tyear = 2012,\n\tmonth = {aug},\n\tpublisher = {Springer Nature},\n\tvolume = {106},\n\tnumber = {11-12},\n\tpages = {757--765},\n\tauthor = {Gerald E. Loeb},\n\ttitle = {Optimal isn't good enough},\n\tjournal = {Biological Cybernetics}\n}",
+ 200,
+ null
+ ],
+ [
+ [
+ "https://dx.doi.org/10.1007/s00422-012-0514-6"
+ ],
+ {
+ "headers": {
+ "accept": "application/x-bibtex"
+ }
+ },
+ "@article{Loeb_2012,\n\tdoi = {10.1007/s00422-012-0514-6},\n\turl = {https://doi.org/10.1007%2Fs00422-012-0514-6},\n\tyear = 2012,\n\tmonth = {aug},\n\tpublisher = {Springer Nature},\n\tvolume = {106},\n\tnumber = {11-12},\n\tpages = {757--765},\n\tauthor = {Gerald E. Loeb},\n\ttitle = {Optimal isn't good enough},\n\tjournal = {Biological Cybernetics}\n}",
+ 200,
+ null
+ ],
+ [
+ [
+ "https://dx.doi.org/10.1007/s00422-012-0514-6"
+ ],
+ {
+ "headers": {
+ "accept": "application/x-bibtex"
+ }
+ },
+ "@article{Loeb_2012,\n\tdoi = {10.1007/s00422-012-0514-6},\n\turl = {https://doi.org/10.1007%2Fs00422-012-0514-6},\n\tyear = 2012,\n\tmonth = {aug},\n\tpublisher = {Springer Nature},\n\tvolume = {106},\n\tnumber = {11-12},\n\tpages = {757--765},\n\tauthor = {Gerald E. Loeb},\n\ttitle = {Optimal isn't good enough},\n\tjournal = {Biological Cybernetics}\n}",
+ 200,
+ null
+ ],
+ [
+ [
+ "https://dx.doi.org/10.1007/s00422-012-0514-6"
+ ],
+ {
+ "headers": {
+ "accept": "application/x-bibtex"
+ }
+ },
+ "@article{Loeb_2012,\n\tdoi = {10.1007/s00422-012-0514-6},\n\turl = {https://doi.org/10.1007%2Fs00422-012-0514-6},\n\tyear = 2012,\n\tmonth = {aug},\n\tpublisher = {Springer Nature},\n\tvolume = {106},\n\tnumber = {11-12},\n\tpages = {757--765},\n\tauthor = {Gerald E. Loeb},\n\ttitle = {Optimal isn't good enough},\n\tjournal = {Biological Cybernetics}\n}",
+ 200,
+ null
+ ],
[
[
"https://dx.doi.org/10.1086/307221"
@@ -95,7 +147,7 @@
"https://export.arxiv.org/api/query?id_list=1312.2021"
],
{},
- "\n\n \n ArXiv Query: search_query=&id_list=1312.2021&start=0&max_results=10\n http://arxiv.org/api/eXBvi61X4ShcFWF7lwJgRo7KSFk\n 2018-08-14T00:00:00-04:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/1312.2021v1\n 2013-12-06T21:33:40Z\n 2013-12-06T21:33:40Z\n Living with the Wrong Sign\n We describe a UV complete asymptotically fragile Lorentz-invariant theory\nexhibiting superluminal signal propagation. Its low energy effective action\ncontains \"wrong\" sign higher dimensional operators. Nevertheless, the theory\ngives rise to an S-matrix, which is defined at all energies. As expected for a\nnon-local theory, the corresponding scattering amplitudes are not exponentially\nbounded on the physical sheet, but otherwise are healthy. We study some of the\nphysical consequences of this S-matrix.\n\n \n Patrick Cooper\n \n \n Sergei Dubovsky\n \n \n Ali Mohsen\n \n 10.1103/INVALIDDOI.89.084044\n \n Phys. Rev. D 89, 084044 (2014)\n \n \n \n \n \n \n\n",
+ "\n\n \n ArXiv Query: search_query=&id_list=1312.2021&start=0&max_results=10\n http://arxiv.org/api/eXBvi61X4ShcFWF7lwJgRo7KSFk\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/1312.2021v1\n 2013-12-06T21:33:40Z\n 2013-12-06T21:33:40Z\n Living with the Wrong Sign\n We describe a UV complete asymptotically fragile Lorentz-invariant theory\nexhibiting superluminal signal propagation. Its low energy effective action\ncontains \"wrong\" sign higher dimensional operators. Nevertheless, the theory\ngives rise to an S-matrix, which is defined at all energies. As expected for a\nnon-local theory, the corresponding scattering amplitudes are not exponentially\nbounded on the physical sheet, but otherwise are healthy. We study some of the\nphysical consequences of this S-matrix.\n\n \n Patrick Cooper\n \n \n Sergei Dubovsky\n \n \n Ali Mohsen\n \n 10.1103/INVALIDDOI.89.084044\n \n Phys. Rev. D 89, 084044 (2014)\n \n \n \n \n \n \n\n",
200,
null
],
@@ -104,7 +156,7 @@
"https://export.arxiv.org/api/query?id_list=1710.08557"
],
{},
- "\n\n \n ArXiv Query: search_query=&id_list=1710.08557&start=0&max_results=10\n http://arxiv.org/api/bNB5RPNlUYbELau5YJ4IzaIq1x8\n 2018-08-14T00:00:00-04:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/1710.08557v1\n 2017-10-24T00:21:32Z\n 2017-10-24T00:21:32Z\n On Neuromechanical Approaches for the Study of Biological Grasp and\n Manipulation\n Biological and robotic grasp and manipulation are undeniably similar at the\nlevel of mechanical task performance. However, their underlying fundamental\nbiological vs. engineering mechanisms are, by definition, dramatically\ndifferent and can even be antithetical. Even our approach to each is\ndiametrically opposite: inductive science for the study of biological systems\nvs. engineering synthesis for the design and construction of robotic systems.\nThe past 20 years have seen several conceptual advances in both fields and the\nquest to unify them. Chief among them is the reluctant recognition that their\nunderlying fundamental mechanisms may actually share limited common ground,\nwhile exhibiting many fundamental differences. This recognition is particularly\nliberating because it allows us to resolve and move beyond multiple paradoxes\nand contradictions that arose from the initial reasonable assumption of a large\ncommon ground. Here, we begin by introducing the perspective of neuromechanics,\nwhich emphasizes that real-world behavior emerges from the intimate\ninteractions among the physical structure of the system, the mechanical\nrequirements of a task, the feasible neural control actions to produce it, and\nthe ability of the neuromuscular system to adapt through interactions with the\nenvironment. This allows us to articulate a succinct overview of a few salient\nconceptual paradoxes and contradictions regarding under-determined vs.\nover-determined mechanics, under- vs. over-actuated control, prescribed vs.\nemergent function, learning vs. implementation vs. adaptation, prescriptive vs.\ndescriptive synergies, and optimal vs. habitual performance. We conclude by\npresenting open questions and suggesting directions for future research. We\nhope this frank assessment of the state-of-the-art will encourage and guide\nthese communities to continue to interact and make progress in these important\nareas.\n\n \n Francisco J Valero-Cuevas\n \n \n Marco Santello\n \n 10.1186/s12984-017-0305-3\n \n Journal of NeuroEngineering and Rehabilitation, 2017\n \n \n \n \n \n\n",
+ "\n\n \n ArXiv Query: search_query=&id_list=1710.08557&start=0&max_results=10\n http://arxiv.org/api/bNB5RPNlUYbELau5YJ4IzaIq1x8\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/1710.08557v1\n 2017-10-24T00:21:32Z\n 2017-10-24T00:21:32Z\n On Neuromechanical Approaches for the Study of Biological Grasp and\n Manipulation\n Biological and robotic grasp and manipulation are undeniably similar at the\nlevel of mechanical task performance. However, their underlying fundamental\nbiological vs. engineering mechanisms are, by definition, dramatically\ndifferent and can even be antithetical. Even our approach to each is\ndiametrically opposite: inductive science for the study of biological systems\nvs. engineering synthesis for the design and construction of robotic systems.\nThe past 20 years have seen several conceptual advances in both fields and the\nquest to unify them. Chief among them is the reluctant recognition that their\nunderlying fundamental mechanisms may actually share limited common ground,\nwhile exhibiting many fundamental differences. This recognition is particularly\nliberating because it allows us to resolve and move beyond multiple paradoxes\nand contradictions that arose from the initial reasonable assumption of a large\ncommon ground. Here, we begin by introducing the perspective of neuromechanics,\nwhich emphasizes that real-world behavior emerges from the intimate\ninteractions among the physical structure of the system, the mechanical\nrequirements of a task, the feasible neural control actions to produce it, and\nthe ability of the neuromuscular system to adapt through interactions with the\nenvironment. This allows us to articulate a succinct overview of a few salient\nconceptual paradoxes and contradictions regarding under-determined vs.\nover-determined mechanics, under- vs. over-actuated control, prescribed vs.\nemergent function, learning vs. implementation vs. adaptation, prescriptive vs.\ndescriptive synergies, and optimal vs. habitual performance. We conclude by\npresenting open questions and suggesting directions for future research. We\nhope this frank assessment of the state-of-the-art will encourage and guide\nthese communities to continue to interact and make progress in these important\nareas.\n\n \n Francisco J Valero-Cuevas\n \n \n Marco Santello\n \n 10.1186/s12984-017-0305-3\n \n Journal of NeuroEngineering and Rehabilitation, 2017\n \n \n \n \n \n\n",
200,
null
],
@@ -113,7 +165,7 @@
"https://export.arxiv.org/api/query?id_list=1710.08557"
],
{},
- "\n\n \n ArXiv Query: search_query=&id_list=1710.08557&start=0&max_results=10\n http://arxiv.org/api/bNB5RPNlUYbELau5YJ4IzaIq1x8\n 2018-08-14T00:00:00-04:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/1710.08557v1\n 2017-10-24T00:21:32Z\n 2017-10-24T00:21:32Z\n On Neuromechanical Approaches for the Study of Biological Grasp and\n Manipulation\n Biological and robotic grasp and manipulation are undeniably similar at the\nlevel of mechanical task performance. However, their underlying fundamental\nbiological vs. engineering mechanisms are, by definition, dramatically\ndifferent and can even be antithetical. Even our approach to each is\ndiametrically opposite: inductive science for the study of biological systems\nvs. engineering synthesis for the design and construction of robotic systems.\nThe past 20 years have seen several conceptual advances in both fields and the\nquest to unify them. Chief among them is the reluctant recognition that their\nunderlying fundamental mechanisms may actually share limited common ground,\nwhile exhibiting many fundamental differences. This recognition is particularly\nliberating because it allows us to resolve and move beyond multiple paradoxes\nand contradictions that arose from the initial reasonable assumption of a large\ncommon ground. Here, we begin by introducing the perspective of neuromechanics,\nwhich emphasizes that real-world behavior emerges from the intimate\ninteractions among the physical structure of the system, the mechanical\nrequirements of a task, the feasible neural control actions to produce it, and\nthe ability of the neuromuscular system to adapt through interactions with the\nenvironment. This allows us to articulate a succinct overview of a few salient\nconceptual paradoxes and contradictions regarding under-determined vs.\nover-determined mechanics, under- vs. over-actuated control, prescribed vs.\nemergent function, learning vs. implementation vs. adaptation, prescriptive vs.\ndescriptive synergies, and optimal vs. habitual performance. We conclude by\npresenting open questions and suggesting directions for future research. We\nhope this frank assessment of the state-of-the-art will encourage and guide\nthese communities to continue to interact and make progress in these important\nareas.\n\n \n Francisco J Valero-Cuevas\n \n \n Marco Santello\n \n 10.1186/s12984-017-0305-3\n \n Journal of NeuroEngineering and Rehabilitation, 2017\n \n \n \n \n \n\n",
+ "\n\n \n ArXiv Query: search_query=&id_list=1710.08557&start=0&max_results=10\n http://arxiv.org/api/bNB5RPNlUYbELau5YJ4IzaIq1x8\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/1710.08557v1\n 2017-10-24T00:21:32Z\n 2017-10-24T00:21:32Z\n On Neuromechanical Approaches for the Study of Biological Grasp and\n Manipulation\n Biological and robotic grasp and manipulation are undeniably similar at the\nlevel of mechanical task performance. However, their underlying fundamental\nbiological vs. engineering mechanisms are, by definition, dramatically\ndifferent and can even be antithetical. Even our approach to each is\ndiametrically opposite: inductive science for the study of biological systems\nvs. engineering synthesis for the design and construction of robotic systems.\nThe past 20 years have seen several conceptual advances in both fields and the\nquest to unify them. Chief among them is the reluctant recognition that their\nunderlying fundamental mechanisms may actually share limited common ground,\nwhile exhibiting many fundamental differences. This recognition is particularly\nliberating because it allows us to resolve and move beyond multiple paradoxes\nand contradictions that arose from the initial reasonable assumption of a large\ncommon ground. Here, we begin by introducing the perspective of neuromechanics,\nwhich emphasizes that real-world behavior emerges from the intimate\ninteractions among the physical structure of the system, the mechanical\nrequirements of a task, the feasible neural control actions to produce it, and\nthe ability of the neuromuscular system to adapt through interactions with the\nenvironment. This allows us to articulate a succinct overview of a few salient\nconceptual paradoxes and contradictions regarding under-determined vs.\nover-determined mechanics, under- vs. over-actuated control, prescribed vs.\nemergent function, learning vs. implementation vs. adaptation, prescriptive vs.\ndescriptive synergies, and optimal vs. habitual performance. We conclude by\npresenting open questions and suggesting directions for future research. We\nhope this frank assessment of the state-of-the-art will encourage and guide\nthese communities to continue to interact and make progress in these important\nareas.\n\n \n Francisco J Valero-Cuevas\n \n \n Marco Santello\n \n 10.1186/s12984-017-0305-3\n \n Journal of NeuroEngineering and Rehabilitation, 2017\n \n \n \n \n \n\n",
200,
null
],
@@ -122,7 +174,7 @@
"https://export.arxiv.org/api/query?id_list=INVALIDID"
],
{},
- "\n\n \n ArXiv Query: search_query=&id_list=INVALIDID\n http://arxiv.org/api//TMQrv7hMz9PNtlUyGrhFtefYFQ\n 2018-08-14T00:00:00-04:00\n 1\n 0\n 1\n \n http://arxiv.org/api/errors#incorrect_id_format_for_INVALIDID\n Error\n incorrect id format for INVALIDID\n 2018-08-14T00:00:00-04:00\n \n \n arXiv api core\n \n \n\n",
+ "\n\n \n ArXiv Query: search_query=&id_list=INVALIDID\n http://arxiv.org/api//TMQrv7hMz9PNtlUyGrhFtefYFQ\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 1\n \n http://arxiv.org/api/errors#incorrect_id_format_for_INVALIDID\n Error\n incorrect id format for INVALIDID\n 2019-01-04T00:00:00-05:00\n \n \n arXiv api core\n \n \n\n",
400,
"400 Client Error: Bad Request for url: https://export.arxiv.org/api/query?id_list=INVALIDID"
],
@@ -131,7 +183,7 @@
"https://export.arxiv.org/api/query?id_list=astro-ph/9812133"
],
{},
- "\n\n \n ArXiv Query: search_query=&id_list=astro-ph/9812133&start=0&max_results=10\n http://arxiv.org/api/SfKekabpSjI/htnxCLpK3q9AsUs\n 2018-08-14T00:00:00-04:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/astro-ph/9812133v1\n 1998-12-08T03:27:34Z\n 1998-12-08T03:27:34Z\n Measurements of Omega and Lambda from 42 High-Redshift Supernovae\n We report measurements of the mass density, Omega_M, and\ncosmological-constant energy density, Omega_Lambda, of the universe based on\nthe analysis of 42 Type Ia supernovae discovered by the Supernova Cosmology\nProject. The magnitude-redshift data for these SNe, at redshifts between 0.18\nand 0.83, are fit jointly with a set of SNe from the Calan/Tololo Supernova\nSurvey, at redshifts below 0.1, to yield values for the cosmological\nparameters. All SN peak magnitudes are standardized using a SN Ia lightcurve\nwidth-luminosity relation. The measurement yields a joint probability\ndistribution of the cosmological parameters that is approximated by the\nrelation 0.8 Omega_M - 0.6 Omega_Lambda ~= -0.2 +/- 0.1 in the region of\ninterest (Omega_M <~ 1.5). For a flat (Omega_M + Omega_Lambda = 1) cosmology we\nfind Omega_M = 0.28{+0.09,-0.08} (1 sigma statistical) {+0.05,-0.04}\n(identified systematics). The data are strongly inconsistent with a Lambda = 0\nflat cosmology, the simplest inflationary universe model. An open, Lambda = 0\ncosmology also does not fit the data well: the data indicate that the\ncosmological constant is non-zero and positive, with a confidence of P(Lambda >\n0) = 99%, including the identified systematic uncertainties. The best-fit age\nof the universe relative to the Hubble time is t_0 = 14.9{+1.4,-1.1} (0.63/h)\nGyr for a flat cosmology. The size of our sample allows us to perform a variety\nof statistical tests to check for possible systematic errors and biases. We\nfind no significant differences in either the host reddening distribution or\nMalmquist bias between the low-redshift Calan/Tololo sample and our\nhigh-redshift sample. The conclusions are robust whether or not a\nwidth-luminosity relation is used to standardize the SN peak magnitudes.\n\n \n S. Perlmutter\n The Supernova Cosmology Project\n \n \n G. Aldering\n The Supernova Cosmology Project\n \n \n G. Goldhaber\n The Supernova Cosmology Project\n \n \n R. A. Knop\n The Supernova Cosmology Project\n \n \n P. Nugent\n The Supernova Cosmology Project\n \n \n P. G. Castro\n The Supernova Cosmology Project\n \n \n S. Deustua\n The Supernova Cosmology Project\n \n \n S. Fabbro\n The Supernova Cosmology Project\n \n \n A. Goobar\n The Supernova Cosmology Project\n \n \n D. E. Groom\n The Supernova Cosmology Project\n \n \n I. M. Hook\n The Supernova Cosmology Project\n \n \n A. G. Kim\n The Supernova Cosmology Project\n \n \n M. Y. Kim\n The Supernova Cosmology Project\n \n \n J. C. Lee\n The Supernova Cosmology Project\n \n \n N. J. Nunes\n The Supernova Cosmology Project\n \n \n R. Pain\n The Supernova Cosmology Project\n \n \n C. R. Pennypacker\n The Supernova Cosmology Project\n \n \n R. Quimby\n The Supernova Cosmology Project\n \n \n C. Lidman\n The Supernova Cosmology Project\n \n \n R. S. Ellis\n The Supernova Cosmology Project\n \n \n M. Irwin\n The Supernova Cosmology Project\n \n \n R. G. McMahon\n The Supernova Cosmology Project\n \n \n P. Ruiz-Lapuente\n The Supernova Cosmology Project\n \n \n N. Walton\n The Supernova Cosmology Project\n \n \n B. Schaefer\n The Supernova Cosmology Project\n \n \n B. J. Boyle\n The Supernova Cosmology Project\n \n \n A. V. Filippenko\n The Supernova Cosmology Project\n \n \n T. Matheson\n The Supernova Cosmology Project\n \n \n A. S. Fruchter\n The Supernova Cosmology Project\n \n \n N. Panagia\n The Supernova Cosmology Project\n \n \n H. J. M. Newberg\n The Supernova Cosmology Project\n \n \n W. J. Couch\n The Supernova Cosmology Project\n \n 10.1086/307221\n \n 21 pages and 10 figures. Accepted for publication in the\n Astrophysical Journal. Individual color figures, supplementary tables, and\n preprint also available at http://www-supernova.lbl.gov/\n Astrophys.J.517:565-586,1999\n \n \n \n \n \n \n \n\n",
+ "\n\n \n ArXiv Query: search_query=&id_list=astro-ph/9812133&start=0&max_results=10\n http://arxiv.org/api/SfKekabpSjI/htnxCLpK3q9AsUs\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/astro-ph/9812133v1\n 1998-12-08T03:27:34Z\n 1998-12-08T03:27:34Z\n Measurements of Omega and Lambda from 42 High-Redshift Supernovae\n We report measurements of the mass density, Omega_M, and\ncosmological-constant energy density, Omega_Lambda, of the universe based on\nthe analysis of 42 Type Ia supernovae discovered by the Supernova Cosmology\nProject. The magnitude-redshift data for these SNe, at redshifts between 0.18\nand 0.83, are fit jointly with a set of SNe from the Calan/Tololo Supernova\nSurvey, at redshifts below 0.1, to yield values for the cosmological\nparameters. All SN peak magnitudes are standardized using a SN Ia lightcurve\nwidth-luminosity relation. The measurement yields a joint probability\ndistribution of the cosmological parameters that is approximated by the\nrelation 0.8 Omega_M - 0.6 Omega_Lambda ~= -0.2 +/- 0.1 in the region of\ninterest (Omega_M <~ 1.5). For a flat (Omega_M + Omega_Lambda = 1) cosmology we\nfind Omega_M = 0.28{+0.09,-0.08} (1 sigma statistical) {+0.05,-0.04}\n(identified systematics). The data are strongly inconsistent with a Lambda = 0\nflat cosmology, the simplest inflationary universe model. An open, Lambda = 0\ncosmology also does not fit the data well: the data indicate that the\ncosmological constant is non-zero and positive, with a confidence of P(Lambda >\n0) = 99%, including the identified systematic uncertainties. The best-fit age\nof the universe relative to the Hubble time is t_0 = 14.9{+1.4,-1.1} (0.63/h)\nGyr for a flat cosmology. The size of our sample allows us to perform a variety\nof statistical tests to check for possible systematic errors and biases. We\nfind no significant differences in either the host reddening distribution or\nMalmquist bias between the low-redshift Calan/Tololo sample and our\nhigh-redshift sample. The conclusions are robust whether or not a\nwidth-luminosity relation is used to standardize the SN peak magnitudes.\n\n \n S. Perlmutter\n The Supernova Cosmology Project\n \n \n G. Aldering\n The Supernova Cosmology Project\n \n \n G. Goldhaber\n The Supernova Cosmology Project\n \n \n R. A. Knop\n The Supernova Cosmology Project\n \n \n P. Nugent\n The Supernova Cosmology Project\n \n \n P. G. Castro\n The Supernova Cosmology Project\n \n \n S. Deustua\n The Supernova Cosmology Project\n \n \n S. Fabbro\n The Supernova Cosmology Project\n \n \n A. Goobar\n The Supernova Cosmology Project\n \n \n D. E. Groom\n The Supernova Cosmology Project\n \n \n I. M. Hook\n The Supernova Cosmology Project\n \n \n A. G. Kim\n The Supernova Cosmology Project\n \n \n M. Y. Kim\n The Supernova Cosmology Project\n \n \n J. C. Lee\n The Supernova Cosmology Project\n \n \n N. J. Nunes\n The Supernova Cosmology Project\n \n \n R. Pain\n The Supernova Cosmology Project\n \n \n C. R. Pennypacker\n The Supernova Cosmology Project\n \n \n R. Quimby\n The Supernova Cosmology Project\n \n \n C. Lidman\n The Supernova Cosmology Project\n \n \n R. S. Ellis\n The Supernova Cosmology Project\n \n \n M. Irwin\n The Supernova Cosmology Project\n \n \n R. G. McMahon\n The Supernova Cosmology Project\n \n \n P. Ruiz-Lapuente\n The Supernova Cosmology Project\n \n \n N. Walton\n The Supernova Cosmology Project\n \n \n B. Schaefer\n The Supernova Cosmology Project\n \n \n B. J. Boyle\n The Supernova Cosmology Project\n \n \n A. V. Filippenko\n The Supernova Cosmology Project\n \n \n T. Matheson\n The Supernova Cosmology Project\n \n \n A. S. Fruchter\n The Supernova Cosmology Project\n \n \n N. Panagia\n The Supernova Cosmology Project\n \n \n H. J. M. Newberg\n The Supernova Cosmology Project\n \n \n W. J. Couch\n The Supernova Cosmology Project\n \n 10.1086/307221\n \n 21 pages and 10 figures. Accepted for publication in the\n Astrophysical Journal. Individual color figures, supplementary tables, and\n preprint also available at http://www-supernova.lbl.gov/\n Astrophys.J.517:565-586,1999\n \n \n \n \n \n \n \n\n",
200,
null
],
@@ -140,7 +192,7 @@
"https://export.arxiv.org/api/query?id_list=astro-ph/9812133"
],
{},
- "\n\n \n ArXiv Query: search_query=&id_list=astro-ph/9812133&start=0&max_results=10\n http://arxiv.org/api/SfKekabpSjI/htnxCLpK3q9AsUs\n 2018-08-14T00:00:00-04:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/astro-ph/9812133v1\n 1998-12-08T03:27:34Z\n 1998-12-08T03:27:34Z\n Measurements of Omega and Lambda from 42 High-Redshift Supernovae\n We report measurements of the mass density, Omega_M, and\ncosmological-constant energy density, Omega_Lambda, of the universe based on\nthe analysis of 42 Type Ia supernovae discovered by the Supernova Cosmology\nProject. The magnitude-redshift data for these SNe, at redshifts between 0.18\nand 0.83, are fit jointly with a set of SNe from the Calan/Tololo Supernova\nSurvey, at redshifts below 0.1, to yield values for the cosmological\nparameters. All SN peak magnitudes are standardized using a SN Ia lightcurve\nwidth-luminosity relation. The measurement yields a joint probability\ndistribution of the cosmological parameters that is approximated by the\nrelation 0.8 Omega_M - 0.6 Omega_Lambda ~= -0.2 +/- 0.1 in the region of\ninterest (Omega_M <~ 1.5). For a flat (Omega_M + Omega_Lambda = 1) cosmology we\nfind Omega_M = 0.28{+0.09,-0.08} (1 sigma statistical) {+0.05,-0.04}\n(identified systematics). The data are strongly inconsistent with a Lambda = 0\nflat cosmology, the simplest inflationary universe model. An open, Lambda = 0\ncosmology also does not fit the data well: the data indicate that the\ncosmological constant is non-zero and positive, with a confidence of P(Lambda >\n0) = 99%, including the identified systematic uncertainties. The best-fit age\nof the universe relative to the Hubble time is t_0 = 14.9{+1.4,-1.1} (0.63/h)\nGyr for a flat cosmology. The size of our sample allows us to perform a variety\nof statistical tests to check for possible systematic errors and biases. We\nfind no significant differences in either the host reddening distribution or\nMalmquist bias between the low-redshift Calan/Tololo sample and our\nhigh-redshift sample. The conclusions are robust whether or not a\nwidth-luminosity relation is used to standardize the SN peak magnitudes.\n\n \n S. Perlmutter\n The Supernova Cosmology Project\n \n \n G. Aldering\n The Supernova Cosmology Project\n \n \n G. Goldhaber\n The Supernova Cosmology Project\n \n \n R. A. Knop\n The Supernova Cosmology Project\n \n \n P. Nugent\n The Supernova Cosmology Project\n \n \n P. G. Castro\n The Supernova Cosmology Project\n \n \n S. Deustua\n The Supernova Cosmology Project\n \n \n S. Fabbro\n The Supernova Cosmology Project\n \n \n A. Goobar\n The Supernova Cosmology Project\n \n \n D. E. Groom\n The Supernova Cosmology Project\n \n \n I. M. Hook\n The Supernova Cosmology Project\n \n \n A. G. Kim\n The Supernova Cosmology Project\n \n \n M. Y. Kim\n The Supernova Cosmology Project\n \n \n J. C. Lee\n The Supernova Cosmology Project\n \n \n N. J. Nunes\n The Supernova Cosmology Project\n \n \n R. Pain\n The Supernova Cosmology Project\n \n \n C. R. Pennypacker\n The Supernova Cosmology Project\n \n \n R. Quimby\n The Supernova Cosmology Project\n \n \n C. Lidman\n The Supernova Cosmology Project\n \n \n R. S. Ellis\n The Supernova Cosmology Project\n \n \n M. Irwin\n The Supernova Cosmology Project\n \n \n R. G. McMahon\n The Supernova Cosmology Project\n \n \n P. Ruiz-Lapuente\n The Supernova Cosmology Project\n \n \n N. Walton\n The Supernova Cosmology Project\n \n \n B. Schaefer\n The Supernova Cosmology Project\n \n \n B. J. Boyle\n The Supernova Cosmology Project\n \n \n A. V. Filippenko\n The Supernova Cosmology Project\n \n \n T. Matheson\n The Supernova Cosmology Project\n \n \n A. S. Fruchter\n The Supernova Cosmology Project\n \n \n N. Panagia\n The Supernova Cosmology Project\n \n \n H. J. M. Newberg\n The Supernova Cosmology Project\n \n \n W. J. Couch\n The Supernova Cosmology Project\n \n 10.1086/307221\n \n 21 pages and 10 figures. Accepted for publication in the\n Astrophysical Journal. Individual color figures, supplementary tables, and\n preprint also available at http://www-supernova.lbl.gov/\n Astrophys.J.517:565-586,1999\n \n \n \n \n \n \n \n\n",
+ "\n\n \n ArXiv Query: search_query=&id_list=astro-ph/9812133&start=0&max_results=10\n http://arxiv.org/api/SfKekabpSjI/htnxCLpK3q9AsUs\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/astro-ph/9812133v1\n 1998-12-08T03:27:34Z\n 1998-12-08T03:27:34Z\n Measurements of Omega and Lambda from 42 High-Redshift Supernovae\n We report measurements of the mass density, Omega_M, and\ncosmological-constant energy density, Omega_Lambda, of the universe based on\nthe analysis of 42 Type Ia supernovae discovered by the Supernova Cosmology\nProject. The magnitude-redshift data for these SNe, at redshifts between 0.18\nand 0.83, are fit jointly with a set of SNe from the Calan/Tololo Supernova\nSurvey, at redshifts below 0.1, to yield values for the cosmological\nparameters. All SN peak magnitudes are standardized using a SN Ia lightcurve\nwidth-luminosity relation. The measurement yields a joint probability\ndistribution of the cosmological parameters that is approximated by the\nrelation 0.8 Omega_M - 0.6 Omega_Lambda ~= -0.2 +/- 0.1 in the region of\ninterest (Omega_M <~ 1.5). For a flat (Omega_M + Omega_Lambda = 1) cosmology we\nfind Omega_M = 0.28{+0.09,-0.08} (1 sigma statistical) {+0.05,-0.04}\n(identified systematics). The data are strongly inconsistent with a Lambda = 0\nflat cosmology, the simplest inflationary universe model. An open, Lambda = 0\ncosmology also does not fit the data well: the data indicate that the\ncosmological constant is non-zero and positive, with a confidence of P(Lambda >\n0) = 99%, including the identified systematic uncertainties. The best-fit age\nof the universe relative to the Hubble time is t_0 = 14.9{+1.4,-1.1} (0.63/h)\nGyr for a flat cosmology. The size of our sample allows us to perform a variety\nof statistical tests to check for possible systematic errors and biases. We\nfind no significant differences in either the host reddening distribution or\nMalmquist bias between the low-redshift Calan/Tololo sample and our\nhigh-redshift sample. The conclusions are robust whether or not a\nwidth-luminosity relation is used to standardize the SN peak magnitudes.\n\n \n S. Perlmutter\n The Supernova Cosmology Project\n \n \n G. Aldering\n The Supernova Cosmology Project\n \n \n G. Goldhaber\n The Supernova Cosmology Project\n \n \n R. A. Knop\n The Supernova Cosmology Project\n \n \n P. Nugent\n The Supernova Cosmology Project\n \n \n P. G. Castro\n The Supernova Cosmology Project\n \n \n S. Deustua\n The Supernova Cosmology Project\n \n \n S. Fabbro\n The Supernova Cosmology Project\n \n \n A. Goobar\n The Supernova Cosmology Project\n \n \n D. E. Groom\n The Supernova Cosmology Project\n \n \n I. M. Hook\n The Supernova Cosmology Project\n \n \n A. G. Kim\n The Supernova Cosmology Project\n \n \n M. Y. Kim\n The Supernova Cosmology Project\n \n \n J. C. Lee\n The Supernova Cosmology Project\n \n \n N. J. Nunes\n The Supernova Cosmology Project\n \n \n R. Pain\n The Supernova Cosmology Project\n \n \n C. R. Pennypacker\n The Supernova Cosmology Project\n \n \n R. Quimby\n The Supernova Cosmology Project\n \n \n C. Lidman\n The Supernova Cosmology Project\n \n \n R. S. Ellis\n The Supernova Cosmology Project\n \n \n M. Irwin\n The Supernova Cosmology Project\n \n \n R. G. McMahon\n The Supernova Cosmology Project\n \n \n P. Ruiz-Lapuente\n The Supernova Cosmology Project\n \n \n N. Walton\n The Supernova Cosmology Project\n \n \n B. Schaefer\n The Supernova Cosmology Project\n \n \n B. J. Boyle\n The Supernova Cosmology Project\n \n \n A. V. Filippenko\n The Supernova Cosmology Project\n \n \n T. Matheson\n The Supernova Cosmology Project\n \n \n A. S. Fruchter\n The Supernova Cosmology Project\n \n \n N. Panagia\n The Supernova Cosmology Project\n \n \n H. J. M. Newberg\n The Supernova Cosmology Project\n \n \n W. J. Couch\n The Supernova Cosmology Project\n \n 10.1086/307221\n \n 21 pages and 10 figures. Accepted for publication in the\n Astrophysical Journal. Individual color figures, supplementary tables, and\n preprint also available at http://www-supernova.lbl.gov/\n Astrophys.J.517:565-586,1999\n \n \n \n \n \n \n \n\n",
200,
null
],
@@ -149,7 +201,87 @@
"https://export.arxiv.org/api/query?id_list=math/0211159"
],
{},
- "\n\n \n ArXiv Query: search_query=&id_list=math/0211159&start=0&max_results=10\n http://arxiv.org/api/4nVRTcAL5Np4oaGFQnqVPG0+c5k\n 2018-08-14T00:00:00-04:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/math/0211159v1\n 2002-11-11T16:11:49Z\n 2002-11-11T16:11:49Z\n The entropy formula for the Ricci flow and its geometric applications\n We present a monotonic expression for the Ricci flow, valid in all dimensions\nand without curvature assumptions. It is interpreted as an entropy for a\ncertain canonical ensemble. Several geometric applications are given. In\nparticular, (1) Ricci flow, considered on the space of riemannian metrics\nmodulo diffeomorphism and scaling, has no nontrivial periodic orbits (that is,\nother than fixed points); (2) In a region, where singularity is forming in\nfinite time, the injectivity radius is controlled by the curvature; (3) Ricci\nflow can not quickly turn an almost euclidean region into a very curved one, no\nmatter what happens far away. We also verify several assertions related to\nRichard Hamilton's program for the proof of Thurston geometrization conjecture\nfor closed three-manifolds, and give a sketch of an eclectic proof of this\nconjecture, making use of earlier results on collapsing with local lower\ncurvature bound.\n\n \n Grisha Perelman\n \n 39 pages\n \n \n \n \n \n \n\n",
+ "\n\n \n ArXiv Query: search_query=&id_list=math/0211159&start=0&max_results=10\n http://arxiv.org/api/4nVRTcAL5Np4oaGFQnqVPG0+c5k\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/math/0211159v1\n 2002-11-11T16:11:49Z\n 2002-11-11T16:11:49Z\n The entropy formula for the Ricci flow and its geometric applications\n We present a monotonic expression for the Ricci flow, valid in all dimensions\nand without curvature assumptions. It is interpreted as an entropy for a\ncertain canonical ensemble. Several geometric applications are given. In\nparticular, (1) Ricci flow, considered on the space of riemannian metrics\nmodulo diffeomorphism and scaling, has no nontrivial periodic orbits (that is,\nother than fixed points); (2) In a region, where singularity is forming in\nfinite time, the injectivity radius is controlled by the curvature; (3) Ricci\nflow can not quickly turn an almost euclidean region into a very curved one, no\nmatter what happens far away. We also verify several assertions related to\nRichard Hamilton's program for the proof of Thurston geometrization conjecture\nfor closed three-manifolds, and give a sketch of an eclectic proof of this\nconjecture, making use of earlier results on collapsing with local lower\ncurvature bound.\n\n \n Grisha Perelman\n \n 39 pages\n \n \n \n \n \n \n\n",
+ 200,
+ null
+ ],
+ [
+ [
+ "https://export.arxiv.org/api/query?id_list=math/9501234"
+ ],
+ {},
+ "\n\n \n ArXiv Query: search_query=&id_list=math/9501234&start=0&max_results=10\n http://arxiv.org/api/7jH0+0cTfQ0YcTJCQMYE9FyHjoA\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/math/9501234v1\n 1995-01-23T00:00:00Z\n 1995-01-23T00:00:00Z\n Aztec diamonds, checkerboard graphs, and spanning trees\n This note derives the characteristic polynomial of a graph that represents\nnonjump moves in a generalized game of checkers. The number of spanning trees\nis also determined.\n\n \n Donald E. Knuth\n \n J. Algebraic Combin. 6 (1997), no. 3, 253--257\n \n \n \n \n \n\n",
+ 200,
+ null
+ ],
+ [
+ [
+ "https://export.arxiv.org/api/query?id_list=math/9501234"
+ ],
+ {},
+ "\n\n \n ArXiv Query: search_query=&id_list=math/9501234&start=0&max_results=10\n http://arxiv.org/api/7jH0+0cTfQ0YcTJCQMYE9FyHjoA\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/math/9501234v1\n 1995-01-23T00:00:00Z\n 1995-01-23T00:00:00Z\n Aztec diamonds, checkerboard graphs, and spanning trees\n This note derives the characteristic polynomial of a graph that represents\nnonjump moves in a generalized game of checkers. The number of spanning trees\nis also determined.\n\n \n Donald E. Knuth\n \n J. Algebraic Combin. 6 (1997), no. 3, 253--257\n \n \n \n \n \n\n",
+ 200,
+ null
+ ],
+ [
+ [
+ "https://export.arxiv.org/api/query?id_list=math/9501234"
+ ],
+ {},
+ "\n\n \n ArXiv Query: search_query=&id_list=math/9501234&start=0&max_results=10\n http://arxiv.org/api/7jH0+0cTfQ0YcTJCQMYE9FyHjoA\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/math/9501234v1\n 1995-01-23T00:00:00Z\n 1995-01-23T00:00:00Z\n Aztec diamonds, checkerboard graphs, and spanning trees\n This note derives the characteristic polynomial of a graph that represents\nnonjump moves in a generalized game of checkers. The number of spanning trees\nis also determined.\n\n \n Donald E. Knuth\n \n J. Algebraic Combin. 6 (1997), no. 3, 253--257\n \n \n \n \n \n\n",
+ 200,
+ null
+ ],
+ [
+ [
+ "https://export.arxiv.org/api/query?id_list=math/9501234"
+ ],
+ {},
+ "\n\n \n ArXiv Query: search_query=&id_list=math/9501234&start=0&max_results=10\n http://arxiv.org/api/7jH0+0cTfQ0YcTJCQMYE9FyHjoA\n 2019-01-04T00:00:00-05:00\n 1\n 0\n 10\n \n http://arxiv.org/abs/math/9501234v1\n 1995-01-23T00:00:00Z\n 1995-01-23T00:00:00Z\n Aztec diamonds, checkerboard graphs, and spanning trees\n This note derives the characteristic polynomial of a graph that represents\nnonjump moves in a generalized game of checkers. The number of spanning trees\nis also determined.\n\n \n Donald E. Knuth\n \n J. Algebraic Combin. 6 (1997), no. 3, 253--257\n \n \n \n \n \n\n",
+ 200,
+ null
+ ],
+ [
+ [
+ "https://www.ottobib.com/isbn/978-0822324669/bibtex"
+ ],
+ {
+ "headers": null
+ },
+ "\n\n\n\n \n
\n \n \n \n \n \n \n\n \n\n Bibliography and Works Cited Generator for MLA, APA, Wikipedia and Bibtex - OttoBib.com \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n
Did OttoBib help you? Then help us and Like us on Facebook!
\n\n
\n\n\n
\n\n\n\n\n
\n \n\n \n",
200,
null
]
diff --git a/tests/test_repo.py b/tests/test_repo.py
index e02f1b0..5bf12d1 100644
--- a/tests/test_repo.py
+++ b/tests/test_repo.py
@@ -29,10 +29,12 @@ class TestCitekeyGeneration(TestRepo):
def test_generated_key_is_unique(self):
self.repo.push_paper(Paper.from_bibentry(fixtures.doe_bibentry))
- c = self.repo.unique_citekey('Doe2013')
+ c = self.repo.unique_citekey('Doe2013', fixtures.doe_bibentry)
self.repo.push_paper(Paper.from_bibentry(fixtures.doe_bibentry,
citekey='Doe2013a'))
- c = self.repo.unique_citekey('Doe2013')
+ c = self.repo.unique_citekey('Doe2013', fixtures.doe_bibentry)
+ self.assertEqual(c, 'Doe2013b')
+ c = self.repo.unique_citekey('bla/bla', fixtures.doe_bibentry)
self.assertEqual(c, 'Doe2013b')
diff --git a/tests/test_usecase.py b/tests/test_usecase.py
index a1ab146..0729990 100644
--- a/tests/test_usecase.py
+++ b/tests/test_usecase.py
@@ -10,10 +10,13 @@ import mock
import six
import ddt
+import certifi
+import mock
from pyfakefs.fake_filesystem import FakeFileOpen
import dotdot
import fake_env
+import mock_requests
from pubs import pubs_cmd, color, content, uis, p3, endecoder
from pubs.config import conf
@@ -153,9 +156,10 @@ class DataCommandTestCase(CommandTestCase):
super(DataCommandTestCase, self).setUp(nsec_stat=nsec_stat)
self.fs.add_real_directory(os.path.join(self.rootpath, 'data'), read_only=False)
self.fs.add_real_directory(os.path.join(self.rootpath, 'bibexamples'), read_only=False)
+ # add certificate for web querries
+ self.fs.add_real_file(certifi.where(), read_only=True)
+ self.fs.add_real_file(mock_requests._data_filepath, read_only=False)
- # fake_env.copy_dir(self.fs, os.path.join(os.path.dirname(__file__), 'data'), 'data')
- # fake_env.copy_dir(self.fs, os.path.join(os.path.dirname(__file__), 'bibexamples'), 'bibexamples')
def assertFileContentEqual(self, path, expected_content):
self.assertTrue(os.path.isfile(path))
@@ -849,7 +853,7 @@ class TestUsecase(DataCommandTestCase):
]
outs = self.execute_cmds(cmds)
- self.assertEqual(4 + 1, len(outs[-1].split('\n')))
+ self.assertEqual(8, len(outs[-1].split('\n')))
def test_import_one(self):
cmds = ['pubs init',
@@ -1002,10 +1006,10 @@ class TestUsecase(DataCommandTestCase):
self.assertEqual(lines[2], 'Total tags: 3, 2 (50%) of papers have at least one tag')
def test_add_no_extension(self):
- # This tests checks that a paper which document has no
- # extension does not raise issues when listing. This test might
- # be removed if decided to prevent such documents. It would then need
- # to be replaced by a check that this is prevented.
+ """This tests checks that a paper which document has no extension does
+ not raise issues when listing. This test might be removed if decided to
+ prevent such documents. It would then need to be replaced by a check
+ that this is prevented."""
self.fs.add_real_file(os.path.join(self.rootpath, 'data', 'pagerank.pdf'),
target_path=os.path.join('data', 'no-ext'))
correct = ['Initializing pubs in /pubs\n',
@@ -1019,6 +1023,26 @@ class TestUsecase(DataCommandTestCase):
]
self.assertEqual(correct, self.execute_cmds(cmds, capture_output=True))
+ @mock.patch('pubs.apis.requests.get', side_effect=mock_requests.mock_requests_get)
+ def test_readme(self, reqget):
+ """Test that the readme example work."""
+ self.fs.add_real_file(os.path.join(self.rootpath, 'data/pagerank.pdf'), target_path='data/Loeb_2012.pdf')
+ self.fs.add_real_file(os.path.join(self.rootpath, 'data/pagerank.pdf'), target_path='data/oyama2000the.pdf')
+ self.fs.add_real_file(os.path.join(self.rootpath, 'data/pagerank.pdf'), target_path='data/Knuth1995.pdf')
+
+ cmds = ['pubs init',
+ 'pubs import data/collection.bib',
+ 'pubs add data/pagerank.bib -d data/pagerank.pdf',
+ #'pubs add -D 10.1007/s00422-012-0514-6 -d data/pagerank.pdf',
+ 'pubs add -I 978-0822324669 -d data/oyama2000the.pdf',
+ 'pubs add -X math/9501234 -d data/Knuth1995.pdf',
+ 'pubs add -D 10.1007/s00422-012-0514-6',
+ 'pubs doc add data/Loeb_2012.pdf Loeb_2012',
+ ]
+ self.execute_cmds(cmds, capture_output=True)
+# self.assertEqual(correct, self.execute_cmds(cmds, capture_output=True))
+
+
@ddt.ddt
class TestCache(DataCommandTestCase):