| 86 | self.logger = get_logger() |
| 87 | |
| 88 | def _get_cache_file_path(self, step) -> str: |
| 89 | if step == -1: |
| 90 | self.logger.error("You must call storage.step() before reading or writing data. Please call storage.step() first for each operator step.") |
| 91 | raise ValueError("You must call storage.step() before reading or writing data. Please call storage.step() first for each operator step.") |
| 92 | if step == 0: |
| 93 | # If it's the first step, use the first entry file name |
| 94 | return os.path.join(self.first_entry_file_name) |
| 95 | else: |
| 96 | return os.path.join(self.cache_path, f"{self.file_name_prefix}_step{step}.{self.cache_type}") |
| 97 | |
| 98 | def step(self): |
| 99 | self.operator_step += 1 |