Skip to content

Commit

Permalink
pbp-plot now explicitly uses h5netcdf as engine
Browse files Browse the repository at this point in the history
And new option `--engine name` allows to specify the engine to use
  • Loading branch information
carueda committed Aug 19, 2024
1 parent 8c99253 commit f2d7637
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

2024-08

- 1.2.5 `pbp-plot` now explicitly uses `h5netcdf` when calling `xarray.open_dataset`.
But a new option `--engine name` allows to specify the engine to use.

- 1.2.3 `HmbGen` adjustments:
- `check_parameters` now returns `str | None`, with string indicating any errors.
- `process_date` now returns `ProcessDayResult | str`, with string indicating any errors.
Expand Down
10 changes: 9 additions & 1 deletion pbp/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ def parse_arguments():
help="Only show the plot (do not generate .jpg files)",
)

parser.add_argument(
"--engine",
type=str,
metavar="name",
default="h5netcdf",
help="Engine given to xarray.open_dataset. Default: %(default)s",
)

parser.add_argument("netcdf", nargs="+", help="netcdf file(s) to plot")

return parser.parse_args()
Expand All @@ -93,7 +101,7 @@ def main():
show = opts.show or opts.only_show
for nc_filename in opts.netcdf:
print(f"plotting {nc_filename} at {opts.dpi} dpi")
ds = xr.open_dataset(nc_filename)
ds = xr.open_dataset(nc_filename, engine=opts.engine)
jpeg_filename = None if opts.only_show else nc_filename.replace(".nc", ".jpg")
plot_dataset_summary(
ds,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "mbari-pbp"
version = "1.2.4"
version = "1.2.5"
description = "PyPAM based Processing"
authors = [
"Carlos Rueda <carueda@mbari.org>",
Expand Down

0 comments on commit f2d7637

Please sign in to comment.