From 6850d4ce62a15680944bb8fe1d62dd473fd5327f Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 18 Jul 2019 22:30:35 -0500 Subject: [PATCH] Apply suggestions from @paulromano Co-Authored-By: Paul Romano --- openmc/capi/core.py | 2 +- src/geometry.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openmc/capi/core.py b/openmc/capi/core.py index 0e226d3a1..c3f5ea1b6 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -102,7 +102,7 @@ def bounding_box(geom_type, geom_id): geom_type : str Type of geometry object. One of ('surface', 'cell', 'universe') geom_id : int - Id of the object. Can be positive or negative for surfaces. + ID of the object. Can be positive or negative for surfaces. """ geomt = c_char_p(geom_type.encode()) llc = np.zeros(3) diff --git a/src/geometry.cpp b/src/geometry.cpp index cc67741fd..15118cd04 100644 --- a/src/geometry.cpp +++ b/src/geometry.cpp @@ -487,16 +487,16 @@ openmc_bounding_box(const char* geom_type, const int32_t id, double* llc, double if (gtype == "universe") { // negative ids only apply to surfaces if (id <= 0) { return OPENMC_E_GEOMETRY; } - const auto& u = model::universes[model::universe_map[id]]; + const auto& u = model::universes[model::universe_map.at(id)]; bbox = u->bounding_box(); } else if (gtype == "cell") { // negative ids only apply to surfaces if (id <= 0) { return OPENMC_E_GEOMETRY; } - const auto& c = model::cells[model::cell_map[id]]; + const auto& c = model::cells[model::cell_map.at(id)]; bbox = c->bounding_box(); } else if (gtype == "surface") { if (id == 0) { return OPENMC_E_GEOMETRY; } - const auto& s = model::surfaces[model::surface_map[abs(id)]]; + const auto& s = model::surfaces[model::surface_map.at(abs(id))]; bbox = s->bounding_box(id > 0); } else { std::stringstream msg;