Skip to content

Commit e18dae6

Browse files
committed
more pylint cleanup
1 parent bff355d commit e18dae6

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

cmip7_prep/cli.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ def make_target(out: Path) -> None:
1717
ds.to_netcdf(out)
1818

1919
def prepare(
20+
*,
2021
var: str,
2122
in_files: list[Path],
2223
realm: str,
23-
mapping_yaml: Path,
2424
cmor_tables: Path,
2525
dataset_json: Path,
2626
outdir: Path,
@@ -36,23 +36,28 @@ def prepare(
3636
cm.write_variable(ds_out, var, vdef, outdir=outdir)
3737

3838
def main(argv: list[str] | None = None) -> int:
39+
"""Entry point for the cmip7_prep command-line interface."""
3940
p = argparse.ArgumentParser(prog="cmip7-prep")
4041
sub = p.add_subparsers(dest="cmd", required=True)
4142

42-
p_make = sub.add_parser("make-target")
43-
p_make.add_argument("out", type=Path)
43+
p_make = sub.add_parser("make-target", help="Write a simple 1° lat/lon grid file.")
44+
p_make.add_argument("out", type=Path, help="Output NetCDF path for the target grid.")
4445
p_make.set_defaults(func=lambda a: make_target(a.out))
4546

46-
p_prep = sub.add_parser("prepare")
47-
p_prep.add_argument("--var", required=True)
48-
p_prep.add_argument("--in-file", "-i", action="append", required=True, type=Path)
49-
p_prep.add_argument("--realm", required=True)
50-
p_prep.add_argument("--mapping-yaml", required=True, type=Path)
51-
p_prep.add_argument("--cmor-tables", required=True, type=Path)
52-
p_prep.add_argument("--dataset-json", required=True, type=Path)
53-
p_prep.add_argument("--outdir", default=Path("out"), type=Path)
47+
p_prep = sub.add_parser("prepare", help="Regrid one variable and write CMOR output.")
48+
p_prep.add_argument("--var", required=True, help="Variable name in input files.")
49+
p_prep.add_argument("--in-file", "-i", action="append", required=True, type=Path, help="Input files (repeatable).")
50+
p_prep.add_argument("--realm", required=True, help="CMOR realm/table, e.g., Amon.")
51+
p_prep.add_argument("--cmor-tables", required=True, type=Path, help="Path to CMOR Tables directory.")
52+
p_prep.add_argument("--dataset-json", required=True, type=Path, help="Path to cmor_dataset.json.")
53+
p_prep.add_argument("--outdir", default=Path("out"), type=Path, help="Output directory for CMORized files.")
5454
p_prep.set_defaults(func=lambda a: prepare(
55-
a.var, a.in_file, a.realm, a.mapping_yaml, a.cmor_tables, a.dataset_json, a.outdir
55+
var=a.var,
56+
in_files=a.in_file,
57+
realm=a.realm,
58+
cmor_tables=a.cmor_tables,
59+
dataset_json=a.dataset_json,
60+
outdir=a.outdir,
5661
))
5762

5863
args = p.parse_args(argv)

cmip7_prep/dreq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
"""Utilities for reading and querying a CMIP Data Request export.
2+
r"""Utilities for reading and querying a CMIP Data Request export.
33
44
Supports Airtable-style JSON (with a top-level ``records`` list) and CSV exports.
55
Provides a small helper class :class:`DReq` to select variables by table (e.g., Amon)

0 commit comments

Comments
 (0)