ReScience / articles

ReScience C published articles
6 stars 5 forks source link

Where do I run the script? #2

Open oliviaguest opened 4 years ago

oliviaguest commented 4 years ago
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?

rougier commented 4 years ago

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).

oliviaguest commented 4 years ago

This should be clarified somewhere for people like me who have no idea, I guess. :laughing:

rougier commented 4 years ago

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

oliviaguest commented 4 years ago

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! https://github.com/ReScience/articles/commit/42fb65eb8e522042f4ed2a0340c2716ddc8b72e6

rougier commented 4 years ago

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 ?

oliviaguest commented 4 years ago

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

rougier commented 4 years ago

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.

oliviaguest commented 4 years ago

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?

rougier commented 4 years ago

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.

oliviaguest commented 4 years ago

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?

oliviaguest commented 4 years ago

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?

oliviaguest commented 4 years ago

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...

oliviaguest commented 4 years ago

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 ... 
                                         ^
rougier commented 4 years ago

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

oliviaguest commented 4 years ago

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.
rougier commented 4 years ago

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

oliviaguest commented 4 years ago

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

rougier commented 4 years ago

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

oliviaguest commented 4 years ago

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 ...
oliviaguest commented 4 years ago

The line in the metadata is now:

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

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

rougier commented 4 years ago

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).

oliviaguest commented 4 years ago

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
rougier commented 4 years ago

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

oliviaguest commented 4 years ago

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

rougier commented 4 years ago

Even without escaping it at all ?

oliviaguest commented 4 years ago

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 ...
oliviaguest commented 4 years ago

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

rougier commented 4 years ago

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.

oliviaguest commented 4 years ago

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

oliviaguest commented 4 years ago

And: https://zenodo.org/record/3545905 :100: