Skip to content

Where do I run the script? #2

Open

Description

@oliviaguest
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?

Activity

  1. rougier commented on Nov 28, 2019

    @rougier
    Member

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

  2. oliviaguest commented on Nov 28, 2019

    @oliviaguest
    MemberAuthor

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

  3. rougier commented on Nov 28, 2019

    @rougier
    Member

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

  4. oliviaguest commented on Nov 30, 2019

    @oliviaguest
    MemberAuthor

    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

  5. rougier commented on Dec 1, 2019

    @rougier
    Member

    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 ?

  6. oliviaguest commented on Dec 1, 2019

    @oliviaguest
    MemberAuthor

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

  7. rougier commented on Dec 1, 2019

    @rougier
    Member

    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.

  8. oliviaguest commented on Dec 2, 2019

    @oliviaguest
    MemberAuthor

    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?

  9. rougier commented on Dec 2, 2019

    @rougier
    Member

    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.

  10. oliviaguest commented on Dec 2, 2019

    @oliviaguest
    MemberAuthor

    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?

  11. oliviaguest commented on Dec 2, 2019

    @oliviaguest
    MemberAuthor

    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?

  12. oliviaguest commented on Dec 4, 2019

    @oliviaguest
    MemberAuthor

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

  13. oliviaguest commented on Dec 4, 2019

    @oliviaguest
    MemberAuthor

    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 ... 
                                             ^
    
  14. rougier commented on Dec 5, 2019

    @rougier
    Member

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

  15. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

    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.
    
  16. 1 remaining item

  17. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

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

  18. rougier commented on Dec 9, 2019

    @rougier
    Member

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

  19. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

    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 ...
    
  20. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

    The line in the metadata is now:

    title: "[Re] The Wisconsin Card Sorting Test\: an implementation of Dehaene and Changeux Neuronal Network Model"
  21. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

    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

  22. rougier commented on Dec 9, 2019

    @rougier
    Member

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

  23. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

    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
    
  24. rougier commented on Dec 9, 2019

    @rougier
    Member

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

  25. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

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

  26. rougier commented on Dec 9, 2019

    @rougier
    Member

    Even without escaping it at all ?

  27. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

    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 ...
    
  28. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

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

  29. rougier commented on Dec 9, 2019

    @rougier
    Member

    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.

  30. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor

    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

  31. oliviaguest commented on Dec 9, 2019

    @oliviaguest
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions