-
Notifications
You must be signed in to change notification settings - Fork 128
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
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements! Here are a few more comments
tests/unit/test_recipes.py
Outdated
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_
sopytest
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
There was a problem hiding this comment.
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.
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>
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
yamllint
to check that your YAML files do not contain mistakesIf 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