1197 # for horizon_number in self.available_horizons:
1198 # yield self[horizon_number]
1199
1200 # def __len__(self):1201 # return len(self.available_horizons)
1193 #
1194 # Once that is done, implement the following features.
1195
1196 # def __iter__(self):1197 # for horizon_number in self.available_horizons:
1198 # yield self[horizon_number]
1199
570 # [self.read_on_grid(i, grid).data for i in iterations]
571 # )
572
573 # new_x0 = [times[0]] + list(grid.x0) 574 # new_dx = [dt] + list(grid.dx)
575
576 # return grid_data.UniformGridData.from_grid_structure(
566 # if abs(np.diff(times).max() - dt).max() > dt * 1e-5:
567 # raise RuntimeError("Timestep not constant enough")
568
569 # data = np.asarray( 570 # [self.read_on_grid(i, grid).data for i in iterations]
571 # )
572
559 # ]
560 # times = [self.time_at_iteration(i) for i in iterations]
561
562 # dt = np.diff(times).min() 563 # if dt <= 0:
564 # raise RuntimeError("Non-positive timesteps detected.")
565 # #
It is recommended to remove any commented code in your codebase.
for item in sequence:
# print(item)
do_something(item)
# def old_function():
# '''Older implementation that has been replaced'''
# data = get_data()
# api.post(data)
for item in sequence:
do_something(item)