Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #72

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
Loading