Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions checksit/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ def _get_ncas_specs(
template = "auto"
specs = None
# find appropriate specs depending on convention
if file_path.split(".")[-1] == "nc" and ":Conventions" in file_content.cdl:
if file_path.split(".")[-1] == "nc" and ":conventions" in file_content.cdl.lower():
conventions = (
file_content.cdl.split(":Conventions =")[1].split(";")[0].strip()
file_content.cdl.lower().split(":conventions =")[1].split(";")[0].strip()
)
# NCAS-GENERAL file
if any(
Expand All @@ -367,7 +367,7 @@ def _get_ncas_specs(
print("\nNCAS-AMOF file detected, finding correct spec files")
print("Finding correct AMOF version...")
version_number = (
conventions[conventions.index("NCAS-") :]
conventions[conventions.upper().index("NCAS-") :]
.split("-")[2]
.replace('"', "")
)
Expand Down Expand Up @@ -591,6 +591,9 @@ def check_file(
(
"Conventions" in file_content.global_attrs.keys() and
"ncas-" in file_content.global_attrs["Conventions"].lower()
) or (
"conventions" in file_content.global_attrs.keys() and
"ncas-" in file_content.global_attrs["conventions"].lower()
) or (
"XMP-photoshop:Instructions" in file_content.global_attrs.keys() and
"national centre for atmospheric science" in file_content.global_attrs["XMP-photoshop:Instructions"].lower()
Expand Down
4 changes: 2 additions & 2 deletions checksit/etc/checksit.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ rule_splitter = |
format_checks_dir = %(basedir)s/fmt_checks
excludes =
#global_attributes:creation_date global_attributes:version
default_template_cache_dir = %(basedir)stemplate-cache
default_template_cache_dir = %(basedir)s/data/template-cache
template_cache_dirs = template-cache other-cache
default_template = template-cache/ceda-base.yml
default_template = %(basedir)s/data/template-cache/ceda-base.yml
specs_dir = %(basedir)s/data/specs

[dataset:ukmo-assim]
Expand Down