Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 8, 2024
1 parent e2a06b2 commit 706b569
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions include/fastscapelib/eroders/diffusion_adi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ namespace fastscapelib


template <class G, class S>
auto diffusion_adi_eroder<G, S>::erode(const data_array_type& elevation, double dt)
-> const data_array_type&
auto diffusion_adi_eroder<G, S>::erode(const data_array_type& elevation,
double dt) -> const data_array_type&
{
// solve for rows
resize_tridiagonal(m_ncols);
Expand Down
9 changes: 4 additions & 5 deletions include/fastscapelib/grid/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,8 @@ namespace fastscapelib
* @param neighbors_indices Reference to the container to be updated with the neighbors indices.
*/
template <class G>
inline auto grid<G>::neighbors_indices(const size_type& idx,
neighbors_indices_type& neighbors_indices)
-> neighbors_indices_type&
inline auto grid<G>::neighbors_indices(
const size_type& idx, neighbors_indices_type& neighbors_indices) -> neighbors_indices_type&
{
const auto& n_count = neighbors_count(idx);
const auto& n_indices = get_nb_indices_from_cache(idx);
Expand Down Expand Up @@ -645,8 +644,8 @@ namespace fastscapelib
* @param neighbors Reference to the vector to be updated with the neighbor objects.
*/
template <class G>
inline auto grid<G>::neighbors(const size_type& idx, neighbors_type& neighbors)
-> neighbors_type&
inline auto grid<G>::neighbors(const size_type& idx,
neighbors_type& neighbors) -> neighbors_type&
{
size_type n_idx;
const auto& n_count = neighbors_count(idx);
Expand Down
37 changes: 20 additions & 17 deletions include/fastscapelib/grid/raster_grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ namespace fastscapelib
* 5 6 7 3 4 2 3 4
*/
inline auto raster_neighbors<raster_connect::queen>::node_neighbors_offsets(
std::ptrdiff_t up, std::ptrdiff_t down, std::ptrdiff_t left, std::ptrdiff_t right) const
-> neighbors_offsets_type
std::ptrdiff_t up,
std::ptrdiff_t down,
std::ptrdiff_t left,
std::ptrdiff_t right) const -> neighbors_offsets_type
{
xt::xtensor<bool, 1> mask{
(up != 0 && left != 0), up != 0, (up != 0 && right != 0), left != 0, right != 0,
Expand Down Expand Up @@ -271,8 +273,10 @@ namespace fastscapelib
* 3 2 2
*/
inline auto raster_neighbors<raster_connect::rook>::node_neighbors_offsets(
std::ptrdiff_t up, std::ptrdiff_t down, std::ptrdiff_t left, std::ptrdiff_t right) const
-> neighbors_offsets_type
std::ptrdiff_t up,
std::ptrdiff_t down,
std::ptrdiff_t left,
std::ptrdiff_t right) const -> neighbors_offsets_type
{
xt::xtensor<bool, 1> mask{ up != 0, left != 0, right != 0, down != 0 };

Expand Down Expand Up @@ -340,8 +344,10 @@ namespace fastscapelib
* 2 3 1 0 1
*/
inline auto raster_neighbors<raster_connect::bishop>::node_neighbors_offsets(
std::ptrdiff_t up, std::ptrdiff_t down, std::ptrdiff_t left, std::ptrdiff_t right) const
-> neighbors_offsets_type
std::ptrdiff_t up,
std::ptrdiff_t down,
std::ptrdiff_t left,
std::ptrdiff_t right) const -> neighbors_offsets_type
{
xt::xtensor<bool, 1> mask{ (up != 0 && left != 0),
(up != 0 && right != 0),
Expand Down Expand Up @@ -634,9 +640,8 @@ namespace fastscapelib
//@}

template <class S, raster_connect RC, class C>
inline auto raster_grid_xt<S, RC, C>::ravel_idx(const size_type& row,
const size_type& col) const noexcept
-> size_type
inline auto raster_grid_xt<S, RC, C>::ravel_idx(
const size_type& row, const size_type& col) const noexcept -> size_type
{
// TODO: assumes row-major layout -> support col-major?
return row * m_shape[1] + col;
Expand Down Expand Up @@ -822,9 +827,8 @@ namespace fastscapelib
* 6 -- 7 -- 8
*/
template <class S, raster_connect RC, class C>
inline auto raster_grid_xt<S, RC, C>::nodes_codes(const size_type& row,
const size_type& col) const noexcept
-> code_type
inline auto raster_grid_xt<S, RC, C>::nodes_codes(
const size_type& row, const size_type& col) const noexcept -> code_type
{
return m_nodes_codes[ravel_idx(row, col)];
}
Expand Down Expand Up @@ -860,9 +864,8 @@ namespace fastscapelib
* @param col The grid node column index.
*/
template <class S, raster_connect RC, class C>
inline auto raster_grid_xt<S, RC, C>::neighbors_indices(const size_type& row,
const size_type& col)
-> neighbors_indices_raster_type
inline auto raster_grid_xt<S, RC, C>::neighbors_indices(
const size_type& row, const size_type& col) -> neighbors_indices_raster_type
{
neighbors_indices_raster_type indices;
neighbors_indices(row, col, indices);
Expand Down Expand Up @@ -914,8 +917,8 @@ namespace fastscapelib
* @return A vector of neighbor node objects.
*/
template <class S, raster_connect RC, class C>
inline auto raster_grid_xt<S, RC, C>::neighbors(const size_type& row, const size_type& col)
-> neighbors_raster_type
inline auto raster_grid_xt<S, RC, C>::neighbors(const size_type& row,
const size_type& col) -> neighbors_raster_type
{
neighbors_raster_type nb;
neighbors(row, col, nb);
Expand Down
2 changes: 1 addition & 1 deletion python/src/flow_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace fastscapelib
template <class FG>
py_flow_graph_impl(const std::shared_ptr<FG>& graph_impl_ptr)
: m_wrapper_ptr(
std::make_unique<detail::flow_graph_impl_wrapper<FG>>(graph_impl_ptr)){};
std::make_unique<detail::flow_graph_impl_wrapper<FG>>(graph_impl_ptr)){};

bool single_flow() const
{
Expand Down

0 comments on commit 706b569

Please sign in to comment.