def METHOD_NAME(demda, flwdir):
    flwda1 = flw.d8_from_dem(demda, outlets="min")
    assert np.all(
        np.where(flwda1.values.ravel() == 0)[0] == 6
    )  # single outlet position
    # with river shape (simplistic example)
    upgrid = flwdir.upstream_area("cell")
    gdf_stream = gpd.GeoDataFrame.from_features(
        flwdir.vectorize(uparea=upgrid, mask=upgrid > 5)
    )
    flwda2 = flw.d8_from_dem(demda, gdf_stream=gdf_stream, outlets="min")
    upg_max = flw.flwdir_from_da(flwda2).upstream_area("cell").max()
    assert upg_max == upgrid.max()