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

Error with template cache and parser #12

Open
agstephens opened this issue May 19, 2022 · 0 comments
Open

Error with template cache and parser #12

agstephens opened this issue May 19, 2022 · 0 comments
Assignees

Comments

@agstephens
Copy link
Member

Using:

[template-caches]
default_cache_dir = template-cache
cache_dirs = template-cache other-cache ukcp-cache
auto_add_to_cache = true

The auto_add_to_cache tells the tool to write to the default_cache_dir.

Got an error!

(venv) [astephen@cron1 file-check-by-template]$ vi template-cache/ukmo-nwp-strat_gbl-std_2022010112_u-v-gph-t-w.yml                         (venv) [astephen@cron1 file-check-by-template]$ checksit check --template=template-cache/ukmo-nwp-strat_gbl-std_2022010112_u-v-gph-t-w.yml /badc/ukmo-assim/data/standard/2022/ukmo-nwp-strat_gbl-std_2022020112_u-v-gph-t-w.pp
Traceback (most recent call last):
  File "/home/users/astephen/file-check-by-template/venv/bin/checksit", line 33, in <module>
    sys.exit(load_entry_point('checksit', 'console_scripts', 'checksit')())
  File "/home/users/astephen/file-check-by-template/venv/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/users/astephen/file-check-by-template/venv/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/users/astephen/file-check-by-template/venv/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/users/astephen/file-check-by-template/venv/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/users/astephen/file-check-by-template/venv/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/users/astephen/file-check-by-template/checksit/cli.py", line 45, in check
    return check_file(file_path, template, mappings=mappings, ignore_attrs=ignore_attrs,
  File "/home/users/astephen/file-check-by-template/checksit/check.py", line 228, in check_file
    tmpl = parse_file_header(template, auto_cache=auto_cache, verbose=verbose)
  File "/home/users/astephen/file-check-by-template/checksit/check.py", line 186, in parse_file_header
    raise Exception(f"No known reader for file with extension: {ext}")
Exception: No known reader for file with extension: yml

Maybe need to call them: .pp.yml and .nc.cdl ?

@agstephens agstephens self-assigned this May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant