Skip to content

Commit

Permalink
typo fix, pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Dec 6, 2024
1 parent fdf2cfc commit d1dd044
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Core/include/Acts/Utilities/RangeXD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ void to_json(nlohmann::json& j, const Range1D<Type>& r) {

template <typename Type>
void from_json(const nlohmann::json& j, Range1D<Type>& r) {
r.setMin(static_cast<Type>(j["min"]));
r.setMax(static_cast<Type>(j["max"]));
r.setMin(j.at("min").template get<Type>());
r.setMax(j.at("max").template get<Type>());
}

} // namespace Acts
6 changes: 3 additions & 3 deletions Core/src/Geometry/Extent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@ void Acts::to_json(nlohmann::json& j, const Acts::Extent& e) {
}

void Acts::from_json(const nlohmann::json& j, Acts::Extent& e) {
const auto& jrange = j["range"];
const auto& jrange = j.at("range");

for (const auto& [key, value] : jrange.items()) {
BinningValue bval = binningValueFromName(key);
e.set(bval, value["min"], value["max"]);
e.set(bval, value.at("min"), value.at("max"));
}

if (j.contains("envelope")) {
const auto& jenvelope = j["envelope"];
const auto& jenvelope = j.at("envelope");
ExtentEnvelope envelope;

for (const auto& [key, value] : jenvelope.items()) {
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Json/src/MaterialJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ nlohmann::json Acts::MaterialJsonConverter::toJsonDetray(
bUtility = std::move(nbUtility);
swapped = true;
} else {
std::runtime_error("Unsupported binning for Detray");
throw std::runtime_error("Unsupported binning for Detray");
}
} else if (bUtility.dimensions() == 2u &&
bUtility.binningData()[0u].binvalue == BinningValue::binZ &&
Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Core/Utilities/BinUtilityTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ bool isEqual(const BinningData& ba, const BinningData& bb, float tolerance) {
(std::abs(ba.step - bb.step) < tolerance);

BOOST_CHECK(equalRange);
bool euqalStructure =
bool equalStructure =
(ba.subBinningData != nullptr)
? isEqual(*ba.subBinningData, *bb.subBinningData, tolerance)
: (bb.subBinningData == nullptr);

BOOST_CHECK(euqalStructure);
BOOST_CHECK(equalStructure);

bool equalBoundaries = (ba.boundaries().size() == bb.boundaries().size());
if (equalBoundaries) {
Expand All @@ -161,7 +161,7 @@ bool isEqual(const BinningData& ba, const BinningData& bb, float tolerance) {
}
BOOST_CHECK(equalBoundaries);

return equalBool && equalRange && euqalStructure;
return equalBool && equalRange && equalStructure;
}

/// Check whether the BinUtility objects are equal
Expand Down

0 comments on commit d1dd044

Please sign in to comment.