Commit 19a1d1f2 authored by Willi Rath's avatar Willi Rath

Be sure to provide proper credit

This rewrites the rendered README to include statements on how to
properly acknowledge the original authors of the data set.
parent 93ab4311
......@@ -351,11 +351,19 @@ class ReadmeRenderer(Renderer):
"""\
# {{repo_name}}
People: {{people}}
{{repo_description}}
{{acknowledgement_parsed}}
{{citations_parsed}}
**Note:** *This dataset is just a mirror of an external source.
Please make sure to properly credit the original creators of the data
set.*
{{maybe_acknowledgements}}
{{maybe_citations}}
## People who might now
To learn more, you can ask the following people:
{{people}}
## Known problems
......@@ -420,7 +428,7 @@ class ReadmeRenderer(Renderer):
@staticmethod
def _maybe_include_acknowledgements(yaml_dict):
if "acknowledgements" not in yaml_dict:
yaml_dict["acknowledgements_parsed"] = ""
yaml_dict["maybe_acknowledgements"] = ""
else:
ack_string = """\
## How to acknowledge the original data set?
......@@ -429,9 +437,8 @@ class ReadmeRenderer(Renderer):
acknowledgements of any manuscript that uses the data:
> {acknowledgements}
""".format(yaml_dict["acknowledgements"])
yaml_dict["acknowledgements_parsed"] = textwrap.dedent(
""".format(**yaml_dict)
yaml_dict["maybe_acknowledgements"] = textwrap.dedent(
ack_string)
return yaml_dict
......@@ -439,21 +446,18 @@ class ReadmeRenderer(Renderer):
def _maybe_include_citations(yaml_dict):
if ("citations" not in yaml_dict or
len(yaml_dict["citations"]) == 0):
yaml_dict["citations_parsed"] = ""
yaml_dict["maybe_citations"] = ""
else:
cite_string = """\
cite_string = textwrap.dedent("""\
## How to cite the data set?
The following references provide details about the data
set:
""".format(yaml_dict["citations"])
yaml_dict["citations_parsed"] = textwrap.dedent(
cite_string)
""".format(yaml_dict["citations"]))
for ct in yaml_dict["citations"]:
yaml_dict["citations_parsed"] += """\
- {text}, doi:{doi}
""".format(ct)
cite_string += "\n- {text}, doi:{doi}\n".format(**ct)
yaml_dict["maybe_citations"] = textwrap.dedent(cite_string)
return yaml_dict
......
......@@ -25,7 +25,7 @@ repo_description: |
asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf
acknowledgement: |
acknowledgements: |
The TEST_REPO data was provided by EXAMPLE.COM.
citations:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment