Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reference section in config-references.yml #1545

Merged
merged 23 commits into from Mar 31, 2020

Conversation

SarahAlidoost
Copy link
Contributor

@SarahAlidoost SarahAlidoost commented Feb 26, 2020

Before you start, read CONTRIBUTING.md and the guide for diagnostic developers.

Please discuss your idea with the development team before getting started, to avoid disappointment later. The way to do this is to open a new issue on GitHub. If you are planning to modify an existing functionality, please discuss it with the original author(s) by tagging them in the issue.


Tasks

  • Create an issue to discuss what you are going to do, if you haven't done so already (and add the link at the bottom)
  • Give this pull request a descriptive title that can be used as a one line summary in a changelog
  • Make sure your code is composed of functions of no more than 50 lines and uses meaningful names for variables
  • Circle/CI tests pass. Status can be seen below your pull request. If the tests are failing, click the link to find out why.
  • Preferably Codacy code quality checks pass, however a few remaining hard to solve Codacy issues are still acceptable. Status can be seen below your pull request. If there is an error, click the link to find out why. If you suspect Codacy may be wrong, please ask by commenting.
  • Please use yamllint to check that your YAML files do not contain mistakes
    If you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.

Closes #1513
It is related to ESMValGroup/ESMValCore#402

@SarahAlidoost SarahAlidoost requested a review from bouweandela Feb 26, 2020
@SarahAlidoost SarahAlidoost changed the title Rm reference entry Remove reference section in config-references.yml Feb 26, 2020
@SarahAlidoost SarahAlidoost marked this pull request as ready for review Feb 27, 2020
@bouweandela
Copy link
Member

bouweandela commented Feb 27, 2020

As discussed offline, the cmorizers also need to be updated so the tags from their configuration files are replaced with a nice string generated from the bibtex.

@SarahAlidoost
Copy link
Contributor Author

SarahAlidoost commented Mar 10, 2020

As discussed offline, the cmorizers also need to be updated so the tags from their configuration files are replaced with a nice string generated from the bibtex.

thanks. This option will be added to this PR ESMValGroup/ESMValCore#402

Copy link
Member

@bouweandela bouweandela left a comment

Thanks for the improvements! Here are a few more comments

doc/sphinx/source/community/diagnostic.rst Outdated Show resolved Hide resolved
def _test_reference_tags(recipe_file):
recipe = yaml.safe_load(recipe_file.read_text())
value = recipe['documentation']['references']
_check_bibtex_exist(value)


def _check_bibtex_exist(tag):
"""Check bibtex file is added to REFERENCES_PATH."""
bibtex_file = REFERENCES_PATH / f'{tag}.bibtex'
assert not bibtex_file.is_file()
Copy link
Member

@bouweandela bouweandela Mar 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _test_reference_tags(recipe_file):
recipe = yaml.safe_load(recipe_file.read_text())
value = recipe['documentation']['references']
_check_bibtex_exist(value)
def _check_bibtex_exist(tag):
"""Check bibtex file is added to REFERENCES_PATH."""
bibtex_file = REFERENCES_PATH / f'{tag}.bibtex'
assert not bibtex_file.is_file()
def test_reference_tags(recipe_file):
recipe = yaml.safe_load(recipe_file.read_text())
tags = recipe.get('documentation', {}).get('references', [])
for tag in tags:
bibtex_file = REFERENCES_PATH / f'{tag}.bibtex'
assert not bibtex_file.is_file()
  • The name of the function has to start with test_ so pytest knows it is a test.
  • It would be good to write the test in such a way that recipes without a documentation/references list do not cause the test to fail, because that is not what we are checking here
  • Note that the content of references in the recipe is a list of strings, not a single string
  • It would be great if you could make a nice error message with a link to the documentation on adding a bibtex file to esmvaltool/references

Copy link
Contributor Author

@SarahAlidoost SarahAlidoost Mar 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bouweandela Thanks a lot. the error message is added. Also, running this test shows that some bibtex files are missing in the references folder. I added those.

@mattiarighi there are two tags in the current config-references.yml: cds-satellite-albedo, and mls-aura. I couldn't find any citation information about the first tag. It seems that the provided link is for data in zip format rather than a reference entry. For the second one, I made its bibtex file. Could you please check these two tags? Thanks.

esmvaltool/cmorizers/obs/utilities.py Outdated Show resolved Hide resolved
@SarahAlidoost SarahAlidoost requested a review from bouweandela Mar 24, 2020
@bouweandela
Copy link
Member

bouweandela commented Mar 30, 2020

A new release of ESMValCore including ESMValGroup/ESMValCore#402 is needed before this can be merged, also for making the tests pass. Ready for testing though, @mattiarighi.

Co-Authored-By: Mattia Righi <mattia.righi@dlr.de>
@bouweandela bouweandela merged commit cbffc58 into master Mar 31, 2020
4 checks passed
@bouweandela bouweandela deleted the rm_reference_entry branch Mar 31, 2020
@mattiarighi mattiarighi mentioned this pull request Mar 31, 2020
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improving the reference template in the config-references.yml
3 participants