Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbuntemeyer committed Apr 10, 2024
1 parent 32581cb commit 3e7b678
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmor_check/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from . import cmor_check
import click

from .cmor_check import check_file

def check():
cmor_check()

@click.command()
@click.option("--cv", help="path to CV table")
@click.argument("filename")
def check(filename, cv):
check_file(filename, cv)
7 changes: 7 additions & 0 deletions cmor_check/cmor_check.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import xarray as xr

from . import log
from .log import get_logger
from .utils import read_json
Expand Down Expand Up @@ -25,3 +27,8 @@ def cmor_check(ds, cv_table=None):
lev = log.levels[v]
logger.log(lev, f"{k}: {v}")
print("cmor check")


def check_file(filename, cv_table=None):
ds = xr.open_dataset(filename)
cmor_check(ds, cv_table)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ classifiers = [
dependencies = [
"numpy",
"xarray",
"click",
]
dynamic = ["version"]

Expand Down

0 comments on commit 3e7b678

Please sign in to comment.