Skip to content

Commit 2ebbece

Browse files
[pre-commit.ci] pre-commit autoupdate (#1853)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/mirrors-clang-format: v21.1.8 → v22.1.0](pre-commit/mirrors-clang-format@v21.1.8...v22.1.0) - [github.com/pycqa/isort: 7.0.0 → 8.0.1](PyCQA/isort@7.0.0...8.0.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent d80b5a6 commit 2ebbece

File tree

8 files changed

+43
-31
lines changed

8 files changed

+43
-31
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ repos:
6666
# clang-format v13
6767
# to run manually, use .github/workflows/clang-format/clang-format.sh
6868
- repo: https://github.com/pre-commit/mirrors-clang-format
69-
rev: v21.1.8
69+
rev: v22.1.0
7070
hooks:
7171
- id: clang-format
7272
# By default, the clang-format hook configures:
@@ -88,7 +88,7 @@ repos:
8888
# Sorts Python imports according to PEP8
8989
# https://www.python.org/dev/peps/pep-0008/#imports
9090
- repo: https://github.com/pycqa/isort
91-
rev: 7.0.0
91+
rev: 8.0.1
9292
hooks:
9393
- id: isort
9494
name: isort (python)

include/openPMD/backend/Attribute.hpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ namespace detail
153153
{
154154
U res{};
155155
res.reserve(pv->size());
156-
if constexpr (std::is_convertible_v<
157-
typename T::value_type,
158-
typename U::value_type>)
156+
if constexpr (
157+
std::is_convertible_v<
158+
typename T::value_type,
159+
typename U::value_type>)
159160
{
160161
std::copy(pv->begin(), pv->end(), std::back_inserter(res));
161162
return {res};
@@ -194,9 +195,10 @@ namespace detail
194195
{
195196
U res{};
196197
res.reserve(pv->size());
197-
if constexpr (std::is_convertible_v<
198-
typename T::value_type,
199-
typename U::value_type>)
198+
if constexpr (
199+
std::is_convertible_v<
200+
typename T::value_type,
201+
typename U::value_type>)
200202
{
201203
std::copy(pv->begin(), pv->end(), std::back_inserter(res));
202204
return {res};
@@ -234,9 +236,10 @@ namespace detail
234236
else if constexpr (auxiliary::IsVector_v<T> && auxiliary::IsArray_v<U>)
235237
{
236238
U res{};
237-
if constexpr (std::is_convertible_v<
238-
typename T::value_type,
239-
typename U::value_type>)
239+
if constexpr (
240+
std::is_convertible_v<
241+
typename T::value_type,
242+
typename U::value_type>)
240243
{
241244
if (res.size() != pv->size())
242245
{

src/IO/ADIOS/ADIOS2File.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ void WriteDataset::call(ADIOS2File &ba, detail::BufferedPut &bp)
114114

115115
engine.Put(var, ptr);
116116
}
117-
else if constexpr (std::is_same_v<
118-
ptr_type,
119-
auxiliary::WriteBuffer::CopyableUniquePtr>)
117+
else if constexpr (
118+
std::is_same_v<
119+
ptr_type,
120+
auxiliary::WriteBuffer::CopyableUniquePtr>)
120121
{
121122
BufferedUniquePtrPut bput;
122123
bput.name = std::move(bp.name);

src/IO/JSON/JSONIOHandler.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ JSONIOHandler::JSONIOHandler(
3232
openPMD::json::TracingJSON jsonCfg,
3333
JSONIOHandlerImpl::FileFormat format,
3434
std::string originalExtension)
35-
: AbstractIOHandler{std::move(initialize_from), std::move(path), at, std::move(jsonCfg)}
35+
: AbstractIOHandler{
36+
std::move(initialize_from), std::move(path), at, std::move(jsonCfg)}
3637
, m_impl{this, format, std::move(originalExtension)}
3738
{}
3839

@@ -45,7 +46,8 @@ JSONIOHandler::JSONIOHandler(
4546
openPMD::json::TracingJSON jsonCfg,
4647
JSONIOHandlerImpl::FileFormat format,
4748
std::string originalExtension)
48-
: AbstractIOHandler{std::move(initialize_from), std::move(path), at, std::move(jsonCfg)}
49+
: AbstractIOHandler{
50+
std::move(initialize_from), std::move(path), at, std::move(jsonCfg)}
4951
, m_impl{
5052
JSONIOHandlerImpl{this, comm, format, std::move(originalExtension)}}
5153
{}

src/Iteration.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,10 @@ void Iteration::read_impl(std::string const &groupPath)
513513
setDt(Attribute(Attribute::from_any, *aRead.m_resource)
514514
.get<long double>());
515515
// conversion cast if a backend reports an integer type
516-
else if (auto val = Attribute(Attribute::from_any, *aRead.m_resource)
517-
.getOptional<double>();
518-
val.has_value())
516+
else if (
517+
auto val = Attribute(Attribute::from_any, *aRead.m_resource)
518+
.getOptional<double>();
519+
val.has_value())
519520
setDt(val.value());
520521
else
521522
throw error::ReadError(
@@ -539,9 +540,10 @@ void Iteration::read_impl(std::string const &groupPath)
539540
setTime(Attribute(Attribute::from_any, *aRead.m_resource)
540541
.get<long double>());
541542
// conversion cast if a backend reports an integer type
542-
else if (auto val = Attribute(Attribute::from_any, *aRead.m_resource)
543-
.getOptional<double>();
544-
val.has_value())
543+
else if (
544+
auto val = Attribute(Attribute::from_any, *aRead.m_resource)
545+
.getOptional<double>();
546+
val.has_value())
545547
setTime(val.value());
546548
else
547549
throw error::ReadError(

src/Series.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,8 +2581,9 @@ std::string Series::iterationFilename(IterationIndex_t i)
25812581
{
25822582
return series.m_overrideFilebasedFilename.value();
25832583
}
2584-
else if (auto iteration = series.m_iterationFilenames.find(i); //
2585-
iteration != series.m_iterationFilenames.end())
2584+
else if (
2585+
auto iteration = series.m_iterationFilenames.find(i); //
2586+
iteration != series.m_iterationFilenames.end())
25862587
{
25872588
return iteration->second;
25882589
}

src/backend/BaseRecord.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -801,9 +801,10 @@ inline void BaseRecord<T_elem>::readBase()
801801
"timeOffset",
802802
Attribute(Attribute::from_any, *aRead.m_resource).get<double>());
803803
// conversion cast if a backend reports an integer type
804-
else if (auto val = Attribute(Attribute::from_any, *aRead.m_resource)
805-
.getOptional<double>();
806-
val.has_value())
804+
else if (
805+
auto val = Attribute(Attribute::from_any, *aRead.m_resource)
806+
.getOptional<double>();
807+
val.has_value())
807808
this->setAttribute("timeOffset", val.value());
808809
else
809810
throw std::runtime_error(

src/binding/python/Attributable.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,17 @@ bool setAttributeFromObject_char(
422422
#endif
423423
// this must come after tryCast<vector<char>>,
424424
// because tryCast<vector<string>> implicitly covers chars as well
425-
else if (auto list_of_string = tryCast<ListString>(obj);
426-
list_of_string.has_value())
425+
else if (
426+
auto list_of_string = tryCast<ListString>(obj);
427+
list_of_string.has_value())
427428
{
428429
return attr.setAttribute<ListString>(key, std::move(*list_of_string));
429430
}
430431
// Again: `char` vs. `signed char`, resp. `char` vs. `unsigned char`
431432
// depending on `char`'s signedness.
432-
else if (auto list_of_int = tryCast<std::vector<int>>(obj);
433-
list_of_int.has_value())
433+
else if (
434+
auto list_of_int = tryCast<std::vector<int>>(obj);
435+
list_of_int.has_value())
434436
{
435437
std::vector<explicit_char_type> casted;
436438
casted.reserve(list_of_int->size());

0 commit comments

Comments
 (0)