Skip to content

Commit cd06b35

Browse files
authored
pre-commit autoupdate (#2754)
1 parent 7008d95 commit cd06b35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+621
-800
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.5.0
44
hooks:
55
- id: check-added-large-files
66
- id: check-case-conflict
@@ -24,14 +24,14 @@ repos:
2424
- id: remove-tabs
2525
args: [--whitespaces-count, '4']
2626
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
27-
rev: v2.10.0
27+
rev: v2.11.0
2828
hooks:
2929
- id: pretty-format-yaml
3030
args: [--autofix, --indent, '2']
3131
types: [file]
3232
files: \.(yaml|yml|clang-format)
3333
- repo: https://github.com/tdegeus/cpp_comment_format
34-
rev: v0.2.0
34+
rev: v0.2.1
3535
hooks:
3636
- id: cpp_comment_format
3737
- repo: https://github.com/tdegeus/conda_envfile
@@ -41,7 +41,7 @@ repos:
4141
files: environment.yaml
4242
# Externally provided executables (so we can use them with editors as well).
4343
- repo: https://github.com/pre-commit/mirrors-clang-format
44-
rev: v16.0.6
44+
rev: v17.0.6
4545
hooks:
4646
- id: clang-format
4747
files: .*\.[hc]pp$

include/xtensor/xadapt.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ namespace xt
664664
/**
665665
* Adapt a smart pointer to a typed memory block (unique_ptr or shared_ptr)
666666
*
667-
* \code{.cpp}
667+
* @code{.cpp}
668668
* #include <xtensor/xadapt.hpp>
669669
* #include <xtensor/xio.hpp>
670670
*
@@ -674,7 +674,7 @@ namespace xt
674674
* auto xptr = adapt_smart_ptr(sptr, shape);
675675
* xptr(1, 3) = 123.;
676676
* std::cout << xptr;
677-
* \endcode
677+
* @endcode
678678
*
679679
* @ingroup xt_xadapt
680680
* @param smart_ptr a smart pointer to a memory block of T[]
@@ -701,7 +701,7 @@ namespace xt
701701
* a given shape and operate naturally on it. Memory will be automatically
702702
* handled by the smart pointer implementation.
703703
*
704-
* \code{.cpp}
704+
* @code{.cpp}
705705
* #include <xtensor/xadapt.hpp>
706706
* #include <xtensor/xio.hpp>
707707
*
@@ -733,7 +733,7 @@ namespace xt
733733
* shape, std::move(unique_buf));
734734
* std::cout << obj << std::endl;
735735
* }
736-
* \endcode
736+
* @endcode
737737
*
738738
* @ingroup xt_xadapt
739739
* @param data_ptr A pointer to a typed data block (e.g. double*)
@@ -763,7 +763,7 @@ namespace xt
763763
/**
764764
* Adapt a smart pointer to a typed memory block (unique_ptr or shared_ptr)
765765
*
766-
* \code{.cpp}
766+
* @code{.cpp}
767767
* #include <xtensor/xadapt.hpp>
768768
* #include <xtensor/xio.hpp>
769769
*
@@ -772,7 +772,7 @@ namespace xt
772772
* auto xptr = adapt_smart_ptr(sptr, {4, 2});
773773
* xptr(1, 3) = 123.;
774774
* std::cout << xptr;
775-
* \endcode
775+
* @endcode
776776
*
777777
* @ingroup xt_xadapt
778778
* @param smart_ptr a smart pointer to a memory block of T[]
@@ -802,7 +802,7 @@ namespace xt
802802
* a given shape and operate naturally on it. Memory will be automatically
803803
* handled by the smart pointer implementation.
804804
*
805-
* \code{.cpp}
805+
* @code{.cpp}
806806
* #include <xtensor/xadapt.hpp>
807807
* #include <xtensor/xio.hpp>
808808
*
@@ -832,7 +832,7 @@ namespace xt
832832
* {2, 4}, std::move(unique_buf));
833833
* std::cout << obj << std::endl;
834834
* }
835-
* \endcode
835+
* @endcode
836836
*
837837
* @ingroup xt_xadapt
838838
* @param data_ptr A pointer to a typed data block (e.g. double*)
@@ -868,14 +868,14 @@ namespace xt
868868
*
869869
* Construct for example with:
870870
*
871-
* \code{.cpp}
871+
* @code{.cpp}
872872
* #include <xtensor/xadapt.hpp>
873873
*
874874
* std::array<size_t, 2> shape = {2, 2};
875875
* std::vector<double> data = {1, 2, 3, 4};
876876
*
877877
* xt::xtensor_pointer<double, 2> a = xt::adapt(data.data(), 4, xt::no_ownership(), shape);
878-
* \endcode
878+
* @endcode
879879
*
880880
* @ingroup xt_xadapt
881881
* @tparam T The data type (e.g. ``double``).
@@ -893,14 +893,14 @@ namespace xt
893893
*
894894
* Construct for example with:
895895
*
896-
* \code{.cpp}
896+
* @code{.cpp}
897897
* #include <xtensor/xadapt.hpp>
898898
*
899899
* std::vector<int> data(4, 0);
900900
* xt::svector<size_t> shape({2, 2});
901901
*
902902
* xt::xarray_pointer<int> a = xt::adapt(data.data(), data.size(), xt::no_ownership(), shape);
903-
* \endcode
903+
* @endcode
904904
*
905905
* @ingroup xt_xadapt
906906
* @tparam T The data type (e.g. ``double``).

include/xtensor/xblockwise_reducer.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ namespace xt
213213
}
214214
return input_chunk_range_type{
215215
multiindex_iterator_begin<input_chunk_index_type>(input_chunks_begin, input_chunks_end),
216-
multiindex_iterator_end<input_chunk_index_type>(input_chunks_begin, input_chunks_end)};
216+
multiindex_iterator_end<input_chunk_index_type>(input_chunks_begin, input_chunks_end)
217+
};
217218
}
218219

219220
template <class CT, class F, class X, class O>

include/xtensor/xbroadcast.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,12 @@ namespace xt
351351
* it is possible.
352352
* @warning This method is NOT compatible with broadcasting, meaning the following
353353
* code has undefined behavior:
354-
* \code{.cpp}
354+
* @code{.cpp}
355355
* xt::xarray<double> a = {{0, 1}, {2, 3}};
356356
* xt::xarray<double> b = {0, 1};
357357
* auto fd = a + b;
358358
* double res = fd.uncheked(0, 1);
359-
* \endcode
359+
* @endcode
360360
*/
361361
template <class CT, class X>
362362
template <class... Args>

include/xtensor/xbuilder.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -772,13 +772,13 @@ namespace xt
772772
* @param axis axis along which elements are concatenated
773773
* @returns xgenerator evaluating to concatenated elements
774774
*
775-
* \code{.cpp}
775+
* @code{.cpp}
776776
* xt::xarray<double> a = {{1, 2, 3}};
777777
* xt::xarray<double> b = {{2, 3, 4}};
778778
* xt::xarray<double> c = xt::concatenate(xt::xtuple(a, b)); // => {{1, 2, 3},
779779
* // {2, 3, 4}}
780780
* xt::xarray<double> d = xt::concatenate(xt::xtuple(a, b), 1); // => {{1, 2, 3, 2, 3, 4}}
781-
* \endcode
781+
* @endcode
782782
*/
783783
template <class... CT>
784784
inline auto concatenate(std::tuple<CT...>&& t, std::size_t axis = 0)
@@ -823,15 +823,15 @@ namespace xt
823823
* @param axis axis along which elements are stacked
824824
* @returns xgenerator evaluating to stacked elements
825825
*
826-
* \code{.cpp}
826+
* @code{.cpp}
827827
* xt::xarray<double> a = {1, 2, 3};
828828
* xt::xarray<double> b = {5, 6, 7};
829829
* xt::xarray<double> s = xt::stack(xt::xtuple(a, b)); // => {{1, 2, 3},
830830
* // {5, 6, 7}}
831831
* xt::xarray<double> t = xt::stack(xt::xtuple(a, b), 1); // => {{1, 5},
832832
* // {2, 6},
833833
* // {3, 7}}
834-
* \endcode
834+
* @endcode
835835
*/
836836
template <class... CT>
837837
inline auto stack(std::tuple<CT...>&& t, std::size_t axis = 0)
@@ -1093,12 +1093,12 @@ namespace xt
10931093
* from which the diagonals should be taken.
10941094
* @returns xexpression with values of the diagonal
10951095
*
1096-
* \code{.cpp}
1096+
* @code{.cpp}
10971097
* xt::xarray<double> a = {{1, 2, 3},
10981098
* {4, 5, 6}
10991099
* {7, 8, 9}};
11001100
* auto b = xt::diagonal(a); // => {1, 5, 9}
1101-
* \endcode
1101+
* @endcode
11021102
*/
11031103
template <class E>
11041104
inline auto diagonal(E&& arr, int offset = 0, std::size_t axis_1 = 0, std::size_t axis_2 = 1)
@@ -1145,12 +1145,12 @@ namespace xt
11451145
* @param k the offset of the considered diagonal
11461146
* @returns xexpression function with shape n x n and arr on the diagonal
11471147
*
1148-
* \code{.cpp}
1148+
* @code{.cpp}
11491149
* xt::xarray<double> a = {1, 5, 9};
11501150
* auto b = xt::diag(a); // => {{1, 0, 0},
11511151
* // {0, 5, 0},
11521152
* // {0, 0, 9}}
1153-
* \endcode
1153+
* @endcode
11541154
*/
11551155
template <class E>
11561156
inline auto diag(E&& arr, int k = 0)

include/xtensor/xcontainer.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,12 @@ namespace xt
476476
* it is possible.
477477
* @warning This method is NOT compatible with broadcasting, meaning the following
478478
* code has undefined behavior:
479-
* \code{.cpp}
479+
* @code{.cpp}
480480
* xt::xarray<double> a = {{0, 1}, {2, 3}};
481481
* xt::xarray<double> b = {0, 1};
482482
* auto fd = a + b;
483483
* double res = fd.uncheked(0, 1);
484-
* \endcode
484+
* @endcode
485485
*/
486486
template <class D>
487487
template <class... Args>
@@ -506,12 +506,12 @@ namespace xt
506506
* it is possible.
507507
* @warning This method is NOT compatible with broadcasting, meaning the following
508508
* code has undefined behavior:
509-
* \code{.cpp}
509+
* @code{.cpp}
510510
* xt::xarray<double> a = {{0, 1}, {2, 3}};
511511
* xt::xarray<double> b = {0, 1};
512512
* auto fd = a + b;
513513
* double res = fd.uncheked(0, 1);
514-
* \endcode
514+
* @endcode
515515
*/
516516
template <class D>
517517
template <class... Args>
@@ -1080,11 +1080,11 @@ namespace xt
10801080
* Reshapes the container and keeps old elements. The `shape` argument can have one of its value
10811081
* equal to `-1`, in this case the value is inferred from the number of elements in the container
10821082
* and the remaining values in the `shape`.
1083-
* \code{.cpp}
1083+
* @code{.cpp}
10841084
* xt::xarray<int> a = { 1, 2, 3, 4, 5, 6, 7, 8 };
10851085
* a.reshape({-1, 4});
10861086
* //a.shape() is {2, 4}
1087-
* \endcode
1087+
* @endcode
10881088
* @param shape the new shape (has to have same number of elements as the original container)
10891089
* @param layout the layout to compute the strides (defaults to static layout of the container,
10901090
* or for a container with dynamic layout to XTENSOR_DEFAULT_LAYOUT)

include/xtensor/xeval.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ namespace xt
3333
/**
3434
* Force evaluation of xexpression.
3535
*
36-
* \code{.cpp}
36+
* @code{.cpp}
3737
* xt::xarray<double> a = {1, 2, 3, 4};
3838
* auto&& b = xt::eval(a); // b is a reference to a, no copy!
3939
* auto&& c = xt::eval(a + b); // c is xarray<double>, not an xexpression
40-
* \endcode
40+
* @endcode
4141
*
4242
* @ingroup xt_xeval
4343
* @return xt::xarray or xt::xtensor depending on shape type
@@ -120,7 +120,7 @@ namespace xt
120120
* Force evaluation of xexpression not providing a data interface
121121
* and convert to the required layout.
122122
*
123-
* \code{.cpp}
123+
* @code{.cpp}
124124
* xt::xarray<double, xt::layout_type::row_major> a = {1, 2, 3, 4};
125125
*
126126
* // take reference to a (no copy!)
@@ -137,7 +137,7 @@ namespace xt
137137
*
138138
* // xarray<int> with the required layout
139139
* auto&& e = xt::as_strided<xt::layout_type::column_major>(a_cast);
140-
* \endcode
140+
* @endcode
141141
*
142142
* @warning This function should be used in a local context only.
143143
* Returning the value returned by this function could lead to a dangling reference.

include/xtensor/xexpression.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -409,16 +409,16 @@ namespace xt
409409
{
410410
};
411411

412-
#define XTENSOR_FORWARD_CONST_METHOD(name) \
413-
auto name() const->decltype(std::declval<xtl::constify_t<E>>().name()) \
414-
{ \
415-
return m_ptr->name(); \
412+
#define XTENSOR_FORWARD_CONST_METHOD(name) \
413+
auto name() const -> decltype(std::declval<xtl::constify_t<E>>().name()) \
414+
{ \
415+
return m_ptr->name(); \
416416
}
417417

418-
#define XTENSOR_FORWARD_METHOD(name) \
419-
auto name()->decltype(std::declval<E>().name()) \
420-
{ \
421-
return m_ptr->name(); \
418+
#define XTENSOR_FORWARD_METHOD(name) \
419+
auto name() -> decltype(std::declval<E>().name()) \
420+
{ \
421+
return m_ptr->name(); \
422422
}
423423

424424
#define XTENSOR_FORWARD_CONST_ITERATOR_METHOD(name) \
@@ -489,7 +489,7 @@ namespace xt
489489
* For example, when a temporary expression needs to be used twice in another
490490
* expression, shared expressions can come to the rescue:
491491
*
492-
* \code{.cpp}
492+
* @code{.cpp}
493493
* template <class E>
494494
* auto cos_plus_sin(xexpression<E>&& expr)
495495
* {
@@ -502,7 +502,7 @@ namespace xt
502502
* std::cout << shared_expr.use_count() << std::endl; // Will print 3 because used twice in expression
503503
* return result; // all valid because expr lifetime managed by xshared_expression / shared_ptr.
504504
* }
505-
* \endcode
505+
* @endcode
506506
*/
507507
template <class E>
508508
class xshared_expression : public xexpression<xshared_expression<E>>

include/xtensor/xfunction.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,12 +637,12 @@ namespace xt
637637
* it is possible.
638638
* @warning This method is NOT compatible with broadcasting, meaning the following
639639
* code has undefined behavior:
640-
* \code{.cpp}
640+
* @code{.cpp}
641641
* xt::xarray<double> a = {{0, 1}, {2, 3}};
642642
* xt::xarray<double> b = {0, 1};
643643
* auto fd = a + b;
644644
* double res = fd.unchecked(0, 1);
645-
* \endcode
645+
* @endcode
646646
*/
647647
template <class F, class... CT>
648648
template <class... Args>

include/xtensor/xfunctor_view.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -786,12 +786,12 @@ namespace xt
786786
* it is possible.
787787
* @warning This method is NOT compatible with broadcasting, meaning the following
788788
* code has undefined behavior:
789-
* \code{.cpp}
789+
* @code{.cpp}
790790
* xt::xarray<double> a = {{0, 1}, {2, 3}};
791791
* xt::xarray<double> b = {0, 1};
792792
* auto fd = a + b;
793793
* double res = fd.unchecked(0, 1);
794-
* \endcode
794+
* @endcode
795795
*/
796796
template <class D>
797797
template <class... Args>
@@ -842,12 +842,12 @@ namespace xt
842842
* it is possible.
843843
* @warning This method is NOT compatible with broadcasting, meaning the following
844844
* code has undefined behavior:
845-
* \code{.cpp}
845+
* @code{.cpp}
846846
* xt::xarray<double> a = {{0, 1}, {2, 3}};
847847
* xt::xarray<double> b = {0, 1};
848848
* auto fd = a + b;
849849
* double res = fd.uncheked(0, 1);
850-
* \endcode
850+
* @endcode
851851
*/
852852
template <class D>
853853
template <class... Args>

0 commit comments

Comments
 (0)