From 59861c9507142d0d2f2120c96cbcec19f82b9cf8 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 6 Feb 2018 07:35:45 -0500 Subject: [PATCH] No need to call int(floor(...)) in Python 3 --- openmc/lattice.py | 12 ++++++------ openmc/model/triso.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openmc/lattice.py b/openmc/lattice.py index 2f7fcf56d..86cfd5c41 100644 --- a/openmc/lattice.py +++ b/openmc/lattice.py @@ -604,12 +604,12 @@ class RectLattice(Lattice): element coordinate system """ - ix = int(floor((point[0] - self.lower_left[0])/self.pitch[0])) - iy = int(floor((point[1] - self.lower_left[1])/self.pitch[1])) + ix = floor((point[0] - self.lower_left[0])/self.pitch[0]) + iy = floor((point[1] - self.lower_left[1])/self.pitch[1]) if self.ndim == 2: idx = (ix, iy) else: - iz = int(floor((point[2] - self.lower_left[2])/self.pitch[2])) + iz = floor((point[2] - self.lower_left[2])/self.pitch[2]) idx = (ix, iy, iz) return idx, self.get_local_coordinates(point, idx) @@ -1016,10 +1016,10 @@ class HexLattice(Lattice): iz = 1 else: z = point[2] - self.center[2] - iz = int(floor(z/self.pitch[1] + 0.5*self.num_axial)) + iz = floor(z/self.pitch[1] + 0.5*self.num_axial) alpha = y - x/sqrt(3.) - ix = int(floor(x/(sqrt(0.75) * self.pitch[0]))) - ia = int(floor(alpha/self.pitch[0])) + ix = floor(x/(sqrt(0.75) * self.pitch[0])) + ia = floor(alpha/self.pitch[0]) # Check four lattice elements to see which one is closest based on local # coordinates diff --git a/openmc/model/triso.py b/openmc/model/triso.py index 2786216f7..5fe51b664 100644 --- a/openmc/model/triso.py +++ b/openmc/model/triso.py @@ -736,7 +736,7 @@ def _close_random_pack(domain, particles, contraction_rate): outer_pf = (4/3 * pi * (outer_diameter[0]/2)**3 * n_particles / domain.volume) - j = int(floor(-log10(outer_pf - inner_pf))) + j = floor(-log10(outer_pf - inner_pf)) outer_diameter[0] = (outer_diameter[0] - 0.5**j * contraction_rate * initial_outer_diameter / n_particles)