ReScience / articles

ReScience C published articles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Where do I run the script?

oliviaguest opened this issue Β· comments

In order to publish a new article (after acceptance), you'll need to have the article metadata file (YAML format) and the corresponding article (PDF format). 

Is best practice to take the YAML and PDF and drop them in the same directory as the Python scripts?

Yes, it makes the command line shorter to write but you're actually free to put them anywhere. But you'll have to run the sciprt from the "articles" directory because it will create a local archive of the paper (through some automatic github command).

This should be clarified somewhere for people like me who have no idea, I guess. πŸ˜†

Yes, I realize the procedure needs more explanation. After you finished editing this one, I'll try to update explanation based on your feedback.

I added this, but I am not sure how to clarify the rest since I am not sure I understand the rest enough, yet... Sorry! 42fb65e

Thanks. I'll try to update by next week based on your (bad) experience. Sorry for all the mess. Did you manage to publish the article finally ?

I'm not sure what I'm supposed to do next... is the author meant to take over at some point?

You have to check the final PDF is ok (DOI, editors, replication (and not editorial)), lnks, etc. If it's fine, you can now publish it on Zeonodo using the script. Note that in cas of problem, you still have the option to edit it directly on Zenodo.

A good thing would be to make very clear which bits the editor needs to do and which the authors and possibly send the authors a link to it (if we don't already?) so they can prep their end as soon as they can... would that be useful?

Yes. One question we had with @khinsen is whether the editor fills up the metadata and make a PR to author's repository or whether the author fills up metadata and rebuild the PDF. Since editor is more experienced, the first solution might be easier.

Another thing is the situation I am in now where I cannot compile the PDF. Is this OK or does it just mean asking the authors to do too much back-and-forth and taking too long?

Also a link to a fully working (toy?) example would be good for the YAML file. Maybe even for the whole article repo? So we can know what it should look like?

I'm getting a bug (?):

Metadata is newer than PDF, probably PDF needs to be rebuild

Apart from the typo which I'll fix now, I don't think it's correct to have this blocking since I can't build the PDF from the Metadata in this case anyway...

And now I get this issue β€” any ideas?

(base) olivia@olivia-HP-Z2-Tower-G4-Workstation:~/Code/articles$ python publish.py --sandbox --metadata ../WCSTDehaeneChangeux/Metadata.yaml --pdf ../WCSTDehaeneChangeux/ReScience_Dehaene.pdf 
Traceback (most recent call last):
  File "publish.py", line 196, in <module>
    article = Article(file.read())
  File "/home/olivia/Code/articles/article.py", line 135, in __init__
    self.parse(data)
  File "/home/olivia/Code/articles/article.py", line 170, in parse
    document = yaml.safe_load(data)
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/__init__.py", line 162, in safe_load
    return load(stream, SafeLoader)
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/constructor.py", line 41, in get_single_data
    node = self.get_single_node()
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/scanner.py", line 223, in fetch_more_tokens
    return self.fetch_value()
  File "/home/olivia/anaconda3/lib/python3.7/site-packages/yaml/scanner.py", line 579, in fetch_value
    self.get_mark())
yaml.scanner.ScannerError: mapping values are not allowed here
  in "<unicode string>", line 62, column 80:
     ...  The Wisconsin Card Sorting Test: Theoretical analysis and model ... 
                                         ^

Maybe missing quote around the string or maybe you need to escape the : (β†’ \:)

OK, but now I get this...

(base) olivia@olivia-HP-Z2-Tower-G4-Workstation:~/Code/articles$ echo $ZENODO_SANDBOX_TOKEN
[redacted]
(base) olivia@olivia-HP-Z2-Tower-G4-Workstation:~/Code/articles$ python publish.py --sandbox --metadata ../../Articles/WCSTDehaeneChangeux/Metadata.yaml --pdf ../../A
rticles/WCSTDehaeneChangeux/ReScience_Dehaene.pdf
Uploading content to Zenodo... Traceback (most recent call last):
  File "publish.py", line 204, in <module>
    upload_content(server, token, article_id, article_file)
  File "publish.py", line 25, in upload_content
    raise IOError("%s: " % response.status_code + response.json()["message"])
OSError: 405: The method is not allowed for the requested URL.

You're using the Zenodo sandbox with the sandbox DOI or the actual DOI ?

Ah, to test this I need to generate/paste a sandbox DOI and edit the metadata and PDF files?

Yes, the DOI you get from sandbox and actual server are not the same and might be the problem.

Fixed DOI, etc., now I get this:

found unknown escape character ':'
  in "<unicode string>", line 8, column 46:
     ... The Wisconsin Card Sorting Test\: an implementation of Dehaene a ...

The line in the metadata is now:

title: "[Re] The Wisconsin Card Sorting Test\: an implementation of Dehaene and Changeux Neuronal Network Model"

I have tried various ways of escaping the colon to no success! πŸ˜• All here have been tested: https://stackoverflow.com/questions/11301650/how-to-escape-indicator-characters-i-e-or-in-yaml

Ok, we need to change the title that is wrong anyway. The title of the replication should be "[Re] original title" (this is for search engines to (also) match the replication when people look for the original article).

So the title should be, which still has a colon in it:

[Re] The Wisconsin Card Sorting Test: Theoretical analysis and modeling in a neuronal network

Arrrggg.... Can you try with this :(unicode fullwidth colon, make sure to copy it), or else, we can use a comma instead

Same error(s) with the different combinations of escaping the Unicode colon.

Even without escaping it at all ?

Yup, the error is then:

yaml.scanner.ScannerError: mapping values are not allowed here
  in "<unicode string>", line 62, column 80:
     ...  The Wisconsin Card Sorting Test: Theoretical analysis and model ...

It doesn't care about the pasted single-space Unicode colon at all. It just replaces it β€” it seems β€” with a standard colon.

So let's use a comma and you can keep the right title in the tex/pdf and change the title later directly on Zenodo. I'll need to fix the problem at some point.

Aaaahhh, I figured it out. I was confusing the line numbers! Both original and current title had colons! OK, I used the standard way of fixing both colons, and it's fine! https://sandbox.zenodo.org/record/416801