What happens
help(arr.xrs.slope) shows a bare slope(**kwargs) with no parameter docs, while help(slope) (from from xrspatial import slope) shows the full docstring. The .xrs accessor methods are thin wrappers that delegate to the standalone functions but carry no docstrings of their own, so anyone exploring the API through the accessor gets nothing useful.
What I'd expect
help(arr.xrs.slope) should show the same documentation as help(slope) — the parameters, notes, and examples.
A bug I hit while looking into this
17 hydrology accessor methods raise ModuleNotFoundError when called. They still import from per-algorithm modules (from .fill import fill, .watershed, .basin, and so on) that were consolidated into xrspatial/hydro.py. Nothing in the accessor tests calls them, so it slipped through.
Affected: flow_direction, flow_direction_dinf, flow_direction_mfd, flow_accumulation, flow_accumulation_mfd, watershed, basin, basins, sink, fill, stream_order, stream_link, snap_pour_point, flow_path, flow_length, twi, hand.
import numpy as np, xarray as xr, xrspatial
da = xr.DataArray(np.abs(np.random.rand(8, 8)) * 100, dims=['y', 'x'],
coords={'y': np.arange(8.), 'x': np.arange(8.)})
da.xrs.fill() # ModuleNotFoundError: No module named 'xrspatial.fill'
Fix
Repoint the broken hydrology delegations at xrspatial.hydro, then copy each standalone function's docstring onto its accessor method so help() works. The hydrology unified wrappers only carry a generic dispatcher docstring, so for those, take the help text from the documented default-algorithm *_d8 variants instead. Add accessor tests for both the docstrings and the hydrology calls.
What happens
help(arr.xrs.slope)shows a bareslope(**kwargs)with no parameter docs, whilehelp(slope)(fromfrom xrspatial import slope) shows the full docstring. The.xrsaccessor methods are thin wrappers that delegate to the standalone functions but carry no docstrings of their own, so anyone exploring the API through the accessor gets nothing useful.What I'd expect
help(arr.xrs.slope)should show the same documentation ashelp(slope)— the parameters, notes, and examples.A bug I hit while looking into this
17 hydrology accessor methods raise
ModuleNotFoundErrorwhen called. They still import from per-algorithm modules (from .fill import fill,.watershed,.basin, and so on) that were consolidated intoxrspatial/hydro.py. Nothing in the accessor tests calls them, so it slipped through.Affected:
flow_direction,flow_direction_dinf,flow_direction_mfd,flow_accumulation,flow_accumulation_mfd,watershed,basin,basins,sink,fill,stream_order,stream_link,snap_pour_point,flow_path,flow_length,twi,hand.Fix
Repoint the broken hydrology delegations at
xrspatial.hydro, then copy each standalone function's docstring onto its accessor method sohelp()works. The hydrology unified wrappers only carry a generic dispatcher docstring, so for those, take the help text from the documented default-algorithm*_d8variants instead. Add accessor tests for both the docstrings and the hydrology calls.