Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#72)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/psf/black-pre-commit-mirror: 24.1.1 →
24.2.0](psf/black-pre-commit-mirror@24.1.1...24.2.0)
- [github.com/pre-commit/mirrors-clang-format: v17.0.6 →
v18.1.1](pre-commit/mirrors-clang-format@v17.0.6...v18.1.1)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 →
v1.9.0](pre-commit/mirrors-mypy@v1.8.0...v1.9.0)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Mar 17, 2024
1 parent ded6c43 commit 39737e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:

# Python formatting
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black

Expand All @@ -55,7 +55,7 @@ repos:

# C++ formatting
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v18.1.1
hooks:
- id: clang-format

Expand All @@ -70,7 +70,7 @@ repos:

# Python type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.8.0'
rev: 'v1.9.0'
hooks:
- id: mypy
# additional_dependencies: [numpy]
Expand Down
5 changes: 1 addition & 4 deletions src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,7 @@ PYBIND11_MODULE(_core, m) {
overload_cast<GenCrossSectionPtr, GenEvent>(&GenEvent::cross_section),
&GenEvent::set_cross_section, DOC(GenEvent.cross_section))
.def_property(
"attributes",
[](GenEvent& self) {
return AttributesView{&self, 0};
},
"attributes", [](GenEvent& self) { return AttributesView{&self, 0}; },
[](GenEvent& self, py::dict obj) {
auto amv = AttributesView{&self, 0};
py::cast(amv).attr("clear")();
Expand Down
11 changes: 4 additions & 7 deletions src/repr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ std::ostream& repr_ostream(std::ostream& os, const HepMC3::GenEvent& x) {
// incomplete:
// missing comparison of GenHeavyIon, GenPdfInfo, GenCrossSection

os << "<GenEvent "
<< "momentum_unit=" << x.momentum_unit() << ", "
<< "length_unit=" << x.length_unit() << ", "
<< "event_number=" << x.event_number() << ", "
<< "particles=" << x.particles().size() << ", "
<< "vertices=" << x.vertices().size() << ", "
<< "run_info=";
os << "<GenEvent " << "momentum_unit=" << x.momentum_unit() << ", "
<< "length_unit=" << x.length_unit() << ", " << "event_number=" << x.event_number()
<< ", " << "particles=" << x.particles().size() << ", "
<< "vertices=" << x.vertices().size() << ", " << "run_info=";
repr_ostream(os, x.run_info()) << ">";
return os;
}

0 comments on commit 39737e0

Please sign in to comment.