elifesciences / elife-crossref-xml-generation

Crossref deposit of journal articles
MIT License
4 stars 3 forks source link

Peer review deposits #73

Closed gnott closed 5 years ago

gnott commented 5 years ago

The end goal here is to generate XML output like the test data fixture tests/test_data/elife-crossref-peer_review-00666-20170717071707.xml.

Continuing some of the earlier refactoring of this library, in order to reuse some of the logic for generating journal article deposits, I moved around and adapted functions that generate contributor data, dates, doi, titles, and related items so they could be used for both article deposits and for peer review deposits.

The CrossrefXML class (defined in generate.py) was changed to produce different types of output by specifying the submission_type value. The batch id generation was refactored out and made to generate two types of batch id values.

I made it so when calling crossref_xml() (also in generate.py) you can ask for pretty XML output and specify the indent. This made it possible to make the test data in a multi-line, readable, pretty format for the peer_review deposit sample.

No other test scenarios were materially changed, and since the tests are passing, I will conclude that there are no regressions for generating journal article deposits.

The sample_data() (in tests/test_generate_peer_review.py) may or may not stay in the end. This was the quickest way to populate Article objects with data to produce the desired output. My next step in this feature is to parse the data out of the real article XML files and then that can be used to generate peer_review deposits.

gnott commented 5 years ago

In reference to issue https://github.com/elifesciences/elife-crossref-feed/issues/123

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.01%) to 99.851% when pulling 45fc5ad53a154b91fb45e7e0669b9c28527fd5c5 on peer_review into b99db21ec4f025d57f39d3a3275b7349f4f9e24a on develop.