diff --git a/include/fastscapelib/eroders/diffusion_adi.hpp b/include/fastscapelib/eroders/diffusion_adi.hpp index 6c7b51c7..d85627bc 100644 --- a/include/fastscapelib/eroders/diffusion_adi.hpp +++ b/include/fastscapelib/eroders/diffusion_adi.hpp @@ -336,8 +336,8 @@ namespace fastscapelib template - auto diffusion_adi_eroder::erode(const data_array_type& elevation, double dt) - -> const data_array_type& + auto diffusion_adi_eroder::erode(const data_array_type& elevation, + double dt) -> const data_array_type& { // solve for rows resize_tridiagonal(m_ncols); diff --git a/include/fastscapelib/flow/flow_router.hpp b/include/fastscapelib/flow/flow_router.hpp index c5783324..73a9d710 100644 --- a/include/fastscapelib/flow/flow_router.hpp +++ b/include/fastscapelib/flow/flow_router.hpp @@ -27,7 +27,7 @@ namespace fastscapelib public: single_flow_router() = default; single_flow_router(int n_threads) - : m_threads_count(n_threads){}; + : m_threads_count(n_threads) {}; inline std::string name() const noexcept override { @@ -70,7 +70,7 @@ namespace fastscapelib public: flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; void apply(graph_impl_type& graph_impl, data_array_type& elevation, @@ -268,7 +268,7 @@ namespace fastscapelib using thread_pool_type = thread_pool; flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; void apply(graph_impl_type& graph_impl, data_array_type& elevation, diff --git a/include/fastscapelib/flow/flow_snapshot.hpp b/include/fastscapelib/flow/flow_snapshot.hpp index fe246b04..3a8884b7 100644 --- a/include/fastscapelib/flow/flow_snapshot.hpp +++ b/include/fastscapelib/flow/flow_snapshot.hpp @@ -75,7 +75,7 @@ namespace fastscapelib using elevation_map = std::map>; flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; void save(const FG& graph_impl, graph_impl_map& graph_impl_snapshots, diff --git a/include/fastscapelib/flow/sink_resolver.hpp b/include/fastscapelib/flow/sink_resolver.hpp index 136af01d..d5538645 100644 --- a/include/fastscapelib/flow/sink_resolver.hpp +++ b/include/fastscapelib/flow/sink_resolver.hpp @@ -65,7 +65,7 @@ namespace fastscapelib using thread_pool_type = thread_pool; flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; void apply(graph_impl_type& graph_impl, data_array_type& elevation, @@ -182,7 +182,7 @@ namespace fastscapelib using thread_pool_type = thread_pool; flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; void apply(graph_impl_type& graph_impl, data_array_type& elevation, diff --git a/include/fastscapelib/grid/base.hpp b/include/fastscapelib/grid/base.hpp index 846f1f77..e54bfc8b 100644 --- a/include/fastscapelib/grid/base.hpp +++ b/include/fastscapelib/grid/base.hpp @@ -363,7 +363,7 @@ namespace fastscapelib typename neighbors_cache_type::template storage_type; grid(std::size_t size) - : m_neighbors_indices_cache(neighbors_cache_type(size)){}; + : m_neighbors_indices_cache(neighbors_cache_type(size)) {}; ~grid() = default; const derived_grid_type& derived_grid() const noexcept; @@ -585,9 +585,8 @@ namespace fastscapelib * @param neighbors_indices Reference to the container to be updated with the neighbors indices. */ template - inline auto grid::neighbors_indices(const size_type& idx, - neighbors_indices_type& neighbors_indices) - -> neighbors_indices_type& + inline auto grid::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); @@ -647,8 +646,8 @@ namespace fastscapelib * @param neighbors Reference to the vector to be updated with the neighbor objects. */ template - inline auto grid::neighbors(const size_type& idx, neighbors_type& neighbors) - -> neighbors_type& + inline auto grid::neighbors(const size_type& idx, + neighbors_type& neighbors) -> neighbors_type& { size_type n_idx; const auto& n_count = neighbors_count(idx); diff --git a/include/fastscapelib/grid/raster_grid.hpp b/include/fastscapelib/grid/raster_grid.hpp index d99c93d1..62c7df7b 100644 --- a/include/fastscapelib/grid/raster_grid.hpp +++ b/include/fastscapelib/grid/raster_grid.hpp @@ -196,8 +196,10 @@ namespace fastscapelib * 5 6 7 3 4 2 3 4 */ inline auto raster_neighbors::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 { std::array mask{ (up != 0 && left != 0), up != 0, (up != 0 && right != 0), left != 0, right != 0, @@ -282,8 +284,10 @@ namespace fastscapelib * 3 2 2 */ inline auto raster_neighbors::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 { std::array mask{ up != 0, left != 0, right != 0, down != 0 }; @@ -359,8 +363,10 @@ namespace fastscapelib * 2 3 1 0 1 */ inline auto raster_neighbors::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 { std::array mask{ (up != 0 && left != 0), (up != 0 && right != 0), @@ -932,8 +938,8 @@ namespace fastscapelib * @return A vector of neighbor node objects. */ template - inline auto raster_grid::neighbors(const size_type& row, const size_type& col) - -> neighbors_raster_type + inline auto raster_grid::neighbors(const size_type& row, + const size_type& col) -> neighbors_raster_type { neighbors_raster_type nb; neighbors(row, col, nb); diff --git a/python/fastscapelib/flow/numba_flow_kernel.py b/python/fastscapelib/flow/numba_flow_kernel.py index 401653a2..cb4ebbbc 100644 --- a/python/fastscapelib/flow/numba_flow_kernel.py +++ b/python/fastscapelib/flow/numba_flow_kernel.py @@ -90,11 +90,9 @@ def visit_AugAssign(self, node: ast.AugAssign): class NumbaJittedFunc(Protocol[P, R]): - def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R: - ... + def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R: ... - def get_compile_result(self, sig: Any) -> Any: - ... + def get_compile_result(self, sig: Any) -> Any: ... # simplified type annotation for numba.experimental.jitclass decorated class diff --git a/python/src/flow_graph.hpp b/python/src/flow_graph.hpp index 821a770c..6bc2dd31 100644 --- a/python/src/flow_graph.hpp +++ b/python/src/flow_graph.hpp @@ -64,7 +64,7 @@ namespace fastscapelib using basins_type = fixed_shape_container_t; - virtual ~flow_graph_impl_wrapper_base(){}; + virtual ~flow_graph_impl_wrapper_base() {}; virtual bool single_flow() const = 0; @@ -96,7 +96,7 @@ namespace fastscapelib class flow_graph_impl_wrapper : public flow_graph_impl_wrapper_base { public: - virtual ~flow_graph_impl_wrapper(){}; + virtual ~flow_graph_impl_wrapper() {}; flow_graph_impl_wrapper(const std::shared_ptr& graph_impl_ptr) : m_graph_impl_ptr(graph_impl_ptr) @@ -192,7 +192,7 @@ namespace fastscapelib template py_flow_graph_impl(const std::shared_ptr& graph_impl_ptr) : m_wrapper_ptr( - std::make_unique>(graph_impl_ptr)){}; + std::make_unique>(graph_impl_ptr)){}; bool single_flow() const { @@ -388,7 +388,7 @@ namespace fastscapelib using shape_type = data_array_type::shape_type; using data_array_size_type = dynamic_shape_container_t; - virtual ~flow_graph_wrapper_base(){}; + virtual ~flow_graph_wrapper_base() {}; virtual bool single_flow() const = 0; virtual size_type size() const = 0; @@ -442,7 +442,7 @@ namespace fastscapelib = std::make_unique(m_snapshot_graph_ptr->impl_ptr()); } - virtual ~flow_graph_wrapper(){}; + virtual ~flow_graph_wrapper() {}; bool single_flow() const { diff --git a/test/test_flow_operator.cpp b/test/test_flow_operator.cpp index e7ddce30..7929bad7 100644 --- a/test/test_flow_operator.cpp +++ b/test/test_flow_operator.cpp @@ -55,7 +55,7 @@ namespace fastscapelib using base_type = flow_operator_impl_base; flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; }; } @@ -91,7 +91,7 @@ namespace fastscapelib using thread_pool_type = thread_pool; flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; void apply(graph_impl_type& /*graph_impl*/, data_array_type& elevation, diff --git a/test/test_flow_router.cpp b/test/test_flow_router.cpp index c8e541cf..0bbdce72 100644 --- a/test/test_flow_router.cpp +++ b/test/test_flow_router.cpp @@ -45,7 +45,7 @@ namespace fastscapelib using base_type = flow_operator_impl; flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; }; template @@ -56,7 +56,7 @@ namespace fastscapelib using base_type = flow_operator_impl; flow_operator_impl(std::shared_ptr ptr) - : base_type(std::move(ptr)){}; + : base_type(std::move(ptr)) {}; }; }