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 Sep 30, 2024
1 parent d5d298a commit 5c04e53
Show file tree
Hide file tree
Showing 17 changed files with 1,809 additions and 2,059 deletions.
583 changes: 267 additions & 316 deletions doc/source/examples/catchment_py.ipynb

Large diffs are not rendered by default.

463 changes: 214 additions & 249 deletions doc/source/examples/escarpment_py.ipynb

Large diffs are not rendered by default.

549 changes: 253 additions & 296 deletions doc/source/examples/inner_base_levels_py.ipynb

Large diffs are not rendered by default.

550 changes: 253 additions & 297 deletions doc/source/examples/mountain_py.ipynb

Large diffs are not rendered by default.

495 changes: 227 additions & 268 deletions doc/source/examples/river_profile_py.ipynb

Large diffs are not rendered by default.

528 changes: 256 additions & 272 deletions examples/eroder_kernel.ipynb

Large diffs are not rendered by default.

648 changes: 316 additions & 332 deletions examples/flow_kernel.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions include/fastscapelib/flow/flow_router.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -70,7 +70,7 @@ namespace fastscapelib

public:
flow_operator_impl(std::shared_ptr<single_flow_router> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};

void apply(graph_impl_type& graph_impl,
data_array_type& elevation,
Expand Down Expand Up @@ -268,7 +268,7 @@ namespace fastscapelib
using thread_pool_type = thread_pool<size_type>;

flow_operator_impl(std::shared_ptr<multi_flow_router> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};

void apply(graph_impl_type& graph_impl,
data_array_type& elevation,
Expand Down
2 changes: 1 addition & 1 deletion include/fastscapelib/flow/flow_snapshot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace fastscapelib
using elevation_map = std::map<std::string, std::unique_ptr<data_array_type>>;

flow_operator_impl(std::shared_ptr<flow_snapshot> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};

void save(const FG& graph_impl,
graph_impl_map& graph_impl_snapshots,
Expand Down
4 changes: 2 additions & 2 deletions include/fastscapelib/flow/sink_resolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace fastscapelib
using thread_pool_type = thread_pool<size_type>;

flow_operator_impl(std::shared_ptr<pflood_sink_resolver> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};

void apply(graph_impl_type& graph_impl,
data_array_type& elevation,
Expand Down Expand Up @@ -182,7 +182,7 @@ namespace fastscapelib
using thread_pool_type = thread_pool<size_type>;

flow_operator_impl(std::shared_ptr<mst_sink_resolver> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};

void apply(graph_impl_type& graph_impl,
data_array_type& elevation,
Expand Down
2 changes: 1 addition & 1 deletion include/fastscapelib/grid/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ namespace fastscapelib
typename neighbors_cache_type::template storage_type<grid_data_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;
Expand Down
6 changes: 2 additions & 4 deletions python/fastscapelib/flow/numba_flow_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions python/src/flow_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ add_flow_graph_bindings(py::module& m)
)doc");
mrouter_op.def_readwrite(
"slope_exp", &fs::multi_flow_router::m_slope_exp, "Flow partition slope exponent.");
mrouter_op.def("__repr__",
[](const fs::multi_flow_router& op) {
return "MultiFlowRouter (slope_exp=" + std::to_string(op.m_slope_exp) + ")";
});
mrouter_op.def(
"__repr__",
[](const fs::multi_flow_router& op)
{ return "MultiFlowRouter (slope_exp=" + std::to_string(op.m_slope_exp) + ")"; });

py::class_<fs::pflood_sink_resolver,
fs::flow_operator,
Expand Down
10 changes: 5 additions & 5 deletions python/src/flow_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace fastscapelib

using basins_type = fixed_shape_container_t<xt_python_selector, size_type, 1>;

virtual ~flow_graph_impl_wrapper_base(){};
virtual ~flow_graph_impl_wrapper_base() {};

virtual bool single_flow() const = 0;

Expand Down Expand Up @@ -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<FG>& graph_impl_ptr)
: m_graph_impl_ptr(graph_impl_ptr)
Expand Down Expand Up @@ -192,7 +192,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 Expand Up @@ -388,7 +388,7 @@ namespace fastscapelib
using shape_type = data_array_type::shape_type;
using data_array_size_type = dynamic_shape_container_t<xt_python_selector, size_type>;

virtual ~flow_graph_wrapper_base(){};
virtual ~flow_graph_wrapper_base() {};

virtual bool single_flow() const = 0;
virtual size_type size() const = 0;
Expand Down Expand Up @@ -442,7 +442,7 @@ namespace fastscapelib
= std::make_unique<py_flow_graph_impl>(m_snapshot_graph_ptr->impl_ptr());
}

virtual ~flow_graph_wrapper(){};
virtual ~flow_graph_wrapper() {};

bool single_flow() const
{
Expand Down
4 changes: 2 additions & 2 deletions test/test_flow_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace fastscapelib
using base_type = flow_operator_impl_base<FG, fake_operator>;

flow_operator_impl(std::shared_ptr<fake_operator> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};
};
}

Expand Down Expand Up @@ -91,7 +91,7 @@ namespace fastscapelib
using thread_pool_type = thread_pool<size_type>;

flow_operator_impl(std::shared_ptr<test_operator> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};

void apply(graph_impl_type& /*graph_impl*/,
data_array_type& elevation,
Expand Down
4 changes: 2 additions & 2 deletions test/test_flow_router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace fastscapelib
using base_type = flow_operator_impl<FG, multi_flow_router, flow_graph_fixed_array_tag>;

flow_operator_impl(std::shared_ptr<multi_flow_router_0> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};
};

template <class FG>
Expand All @@ -56,7 +56,7 @@ namespace fastscapelib
using base_type = flow_operator_impl<FG, multi_flow_router, flow_graph_fixed_array_tag>;

flow_operator_impl(std::shared_ptr<multi_flow_router_2> ptr)
: base_type(std::move(ptr)){};
: base_type(std::move(ptr)) {};
};
}

Expand Down
6 changes: 1 addition & 5 deletions test/test_raster_bishop_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ namespace fastscapelib
/*(r,c)*/ }));
}
// Bottom-right corner
EXPECT_INDICES(4,
9,
({ 38 }),
({ { 3, 8 }
/*(r,c)*/ }));
EXPECT_INDICES(4, 9, ({ 38 }), ({ { 3, 8 } /*(r,c)*/ }));
}
}
#undef EXPECT_INDICES
Expand Down

0 comments on commit 5c04e53

Please sign in to comment.