Consider removing the commented out code block
1436 print("mesh_name=", mesh_name)
1437
1438 if self.alldata[path][iteration][ref_level][component] is None:
1439 # matched = rx_mesh.match(self.mesh_name)1440 # if matched is None:
1441 # raise RuntimeError(f"Could not parse mesh {mesh_name}")
1442 # ref_level_matched = int(matched.group(2))
Consider removing the commented out code block
1427 :rtype: :py:class:`~.UniformGridData`
1428
1429 """
1430 # rx_mesh = re.compile(self._pattern_group_name)1431 # matched = rx_mesh.match(self.mesh_name)
1432 # print("matched=", matched)
1433 # mesh_name_match = matched.group(1)
Consider removing the commented out code block
591 # [self.read_on_grid(i, grid).data for i in iterations]
592 # )
593
594 # new_x0 = [times[0]] + list(grid.x0) 595 # new_dx = [dt] + list(grid.dx)
596
597 # return grid_data.UniformGridData.from_grid_structure(
Consider removing the commented out code block
587 # if abs(np.diff(times).max() - dt).max() > dt * 1e-5:
588 # raise RuntimeError("Timestep not constant enough")
589
590 # data = np.asarray( 591 # [self.read_on_grid(i, grid).data for i in iterations]
592 # )
593
Consider removing the commented out code block
580 # ]
581 # times = [self.time_at_iteration(i) for i in iterations]
582
583 # dt = np.diff(times).min() 584 # if dt <= 0:
585 # raise RuntimeError("Non-positive timesteps detected.")
586 # #
Consider removing the commented out code block
575 # if read_every is None:
576 # read_every = np.diff(iterations).max()
577
578 # iterations = [ 579 # i for i in iterations if ((i - iterations[0]) % read_every == 0)
580 # ]
581 # times = [self.time_at_iteration(i) for i in iterations]
Consider removing the commented out code block
567 # """
568 # # TODO: IMPLEMENT THIS
569
570 # iterations = self.available_iterations 571 # if min_iteration is not None:
572 # iterations = iterations[iterations >= min_iteration]
573 # if max_iteration is not None:
Consider removing the commented out code block
564 # as RegularGridData in which the first index is the time and the other indices
565 # are the spatial indices of grid.
566
567 # """ 568 # # TODO: IMPLEMENT THIS
569
570 # iterations = self.available_iterations
Consider removing the commented out code block
552 grid, resample=resample
553 )
554
555 # def read_evolution_on_grid( 556 # self,
557 # grid,
558 # read_every=None,
Description
It is recommended to remove any commented code in your codebase.
Bad practice
for item in sequence:
# print(item)
do_something(item)
# def old_function():
# '''Older implementation that has been replaced'''
# data = get_data()
# api.post(data)
Recommended
for item in sequence:
do_something(item)