Skip to content

Commit

Permalink
write doc for check_compat
Browse files Browse the repository at this point in the history
  • Loading branch information
MaceKuailv committed Nov 18, 2024
1 parent 76f4884 commit 3ec5d07
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions seaduck/lagrangian_budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,34 @@ def check_particle_data_compat(
debug=False,
allclose_kwarg={},
):
"""Check if you could use Lagrangian budget functionality.
Parameters
----------
xrpt: xr.Dataset
A dataset generated by seaduck that contains the location and velocity info.
xrslc: xr.Dataset
The ocean model (including budget terms) at a time step.
tp: sd.Topology
The topology object for the model
use_tracer_name: string
if specified, use cx,cy,cz as wall name
wall_names: tuple of string
Name of variables if use_tracer_name is not defined.
conv_name: string
The variable from xrslc to be compared against.
debug: bool
Whether to return additional debug information.
allclose_kwarg:
Keyword arguments for np.allclose.
Returns
-------
OK_or_not: bool
Is it OK to preceed?
extra: None or tuple
Extra information to help with debugging.
"""
if "iz" not in xrpt.data_vars: # pragma: no cover
raise NotImplementedError(
"This functionality only support 3D simulation at the moment."
Expand Down

0 comments on commit 3ec5d07

Please sign in to comment.