Skip to content

Commit

Permalink
find grib files
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed May 1, 2024
1 parent b26ea56 commit 1fe9bbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ repos:
rev: 24.1.1
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/pycqa/isort
rev: 5.13.0
hooks:
Expand Down
8 changes: 8 additions & 0 deletions climetlab/readers/grib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ def reader(source, path, magic=None, deeper_check=False):
from .reader import GRIBReader

return GRIBReader(source, path)

if deeper_check:
with open(path, "rb") as f:
magic = f.read(1024)
if b"GRIB" in magic:
from .reader import GRIBReader

return GRIBReader(source, path)

0 comments on commit 1fe9bbb

Please sign in to comment.