Convert config to Python statements that replicate current config. This does NOT include config settings that are at default values.
(self)
| 159 | return pickle.dumps(config, protocol=2) |
| 160 | |
| 161 | def codegen_config(self) -> str: |
| 162 | """Convert config to Python statements that replicate current config. |
| 163 | This does NOT include config settings that are at default values. |
| 164 | """ |
| 165 | lines = [] |
| 166 | mod = self.__name__ |
| 167 | for k, v in self._config.items(): |
| 168 | if k in self._config.get("_save_config_ignore", ()): |
| 169 | continue |
| 170 | if v == self._default[k]: |
| 171 | continue |
| 172 | lines.append(f"{mod}.{k} = {v!r}") |
| 173 | return "\n".join(lines) |
| 174 | |
| 175 | def get_hash(self) -> bytes: |
| 176 | """Hashes the configs that are not compile_ignored""" |