def read_geometry(self, group):
        '''
        Read in geometry information from an AMR grid

        Parameters
        ----------
        group : h5py.Group
            The HDF5 group to read the geometry from
        '''

        # Check that grid is indeed AMR
        if group.attrs['grid_type'].decode('utf-8') != 'amr':
            raise Exception("Grid is not an AMR grid")

        # Initialize levels list
        self.levels = []

        # Loop over levels
        for ilevel in range(group.attrs['nlevels']):

            # Read in level
            level_path = 'level_%05i' % (ilevel + 1)
            g_level = group[level_path]

            # Initialize level
            level = self.add_level()

            # Loop over grids
            for igrid in range(g_level.attrs['ngrids']):

                # Read in grid
                grid_path = (igrid + 1) % 'grid_%05i'
                g_grid = g_level[grid_path]

                # Initialize grid
                grid = level.add_grid()

                # Retrieve real-world grid boundaries
                grid.xmin = g_grid.attrs['xmin']
                grid.xmax = g_grid.attrs['xmax']
                grid.ymin = g_grid.attrs['ymin']
                grid.ymax = g_grid.attrs['ymax']
                grid.zmin = g_grid.attrs['zmin']
                grid.zmax = g_grid.attrs['zmax']

                # Retrieve grid dimensions
                grid.nx = int(g_grid.attrs['n1'])
                grid.ny = int(g_grid.attrs['n2'])
                grid.nz = int(g_grid.attrs['n3'])

        # Check that advertised hash matches real hash
        if group.attrs['geometry'].decode('utf-8') != self.get_geometry_id():
            raise Exception("Calculated geometry hash does not match hash in file")
dataset/ETHPy150Open hyperion-rt/hyperion/hyperion/grid/amr_grid.py/AMRGrid.read_geometry/swapped operands of `%`