From 59b06e996ffe1566c7f2ef05ace665331db5cc9a Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 28 Feb 2023 20:06:52 +0100 Subject: [PATCH] hack to fix bibtex months. Adressing #27 --- commonmeta/date_utils.py | 1 + tests/test-bibtex_writer.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/commonmeta/date_utils.py b/commonmeta/date_utils.py index 90eba16..9ed6088 100644 --- a/commonmeta/date_utils.py +++ b/commonmeta/date_utils.py @@ -22,6 +22,7 @@ "12": "dec", } +MONTH_SHORT_NAMES = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"] ISO8601_DATE_FORMAT = "%Y-%m-%d" diff --git a/tests/test-bibtex_writer.py b/tests/test-bibtex_writer.py index e0b2402..8a364ca 100644 --- a/tests/test-bibtex_writer.py +++ b/tests/test-bibtex_writer.py @@ -23,7 +23,7 @@ def test_doi_with_data_citation(): issn = {2050-084X}, journal = {eLife}, language = {en}, - month = {feb}, + month = feb, title = {Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth}, url = {https://elifesciences.org/articles/01567}, urldate = {2014-02-11}, @@ -48,7 +48,7 @@ def test_doi_for_blog_post(): author = {Fenner, Martin}, copyright = {https://creativecommons.org/licenses/by/4.0/legalcode}, doi = {10.53731/avg2ykg-gdxppcd}, - month = {jan}, + month = jan, title = {Do we need to fix science blogs?}, url = {https://blog.front-matter.io/posts/need-to-fix-science-blogs}, urldate = {2023-01-25}, @@ -75,7 +75,7 @@ def test_blog_post(): doi = {10.54900/rckn8ey-1fm76va-qsrnf}, journal = {Upstream}, language = {en}, - month = {nov}, + month = nov, title = {Welcome to Upstream: the new space for scholarly community discussion on all things open}, url = {https://upstream.force11.org/welcome-to-upstream}, urldate = {2021-11-22}, @@ -103,7 +103,7 @@ def test_article_with_pages(): issue = {1}, journal = {PLOS Pathogens}, language = {en}, - month = {jan}, + month = jan, pages = {e1008184}, title = {An RNA thermometer dictates production of a secreted bacterial toxin}, url = {https://dx.plos.org/10.1371/journal.ppat.1008184}, @@ -131,7 +131,7 @@ def test_article_dlib_magazine(): issue = {1/2}, journal = {D-Lib Magazine}, language = {en}, - month = {jan}, + month = jan, title = {The Scholix Framework for Interoperability in Data-Literature Information Exchange}, url = {http://www.dlib.org/dlib/january17/burton/01burton.html}, urldate = {2017-01}, @@ -155,7 +155,7 @@ def test_book_chapter(): booktitle = {Shoulder Stiffness}, copyright = {https://www.springernature.com/gp/researchers/text-and-data-mining}, doi = {10.1007/978-3-662-46370-3_13}, - month = {feb}, + month = feb, pages = {155-158}, publisher = {Springer Science and Business Media LLC}, title = {Clinical Symptoms and Physical Examinations}, @@ -181,7 +181,7 @@ def test_conference_proceedings(): author = {Sinop, Ali Kemal and Grady, Leo}, booktitle = {2007 IEEE 11th International Conference on Computer Vision}, doi = {10.1109/iccv.2007.4408927}, - month = {feb}, + month = feb, publisher = {Institute of Electrical and Electronics Engineers (IEEE)}, title = {A Seeded Image Segmentation Framework Unifying Graph Cuts And Random Walker Which Yields A New Algorithm}, url = {http://ieeexplore.ieee.org/document/4408927}, @@ -206,7 +206,7 @@ def test_phd_thesis(): author = {Collingwood, Patricia Maree}, doi = {10.14264/uql.2020.791}, institution = {University of Queensland Library}, - month = {jun}, + month = jun, title = {School truancy and financial independence during emerging adulthood: a longitudinal analysis of receipt of and reliance on cash transfers}, url = {http://espace.library.uq.edu.au/view/UQ:23a1e74}, urldate = {2020-06-08},