Skip to content

Commit 53bbfd4

Browse files
machshevhcallahan-lowrisc
authored andcommitted
refactor: rename model_dump -> dump
The pydantic model_dump method contains a lot more information, so rename to allow using these in parallel until all the Deploy classes are migrated to pydantic. Signed-off-by: James McCorrie <[email protected]>
1 parent 3bb06fc commit 53bbfd4

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/dvsim/flow/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def deploy_objects(self) -> Mapping[str, CompletedJobStatus]:
422422
json.dumps(
423423
# Sort on full name to ensure consistent ordering
424424
sorted(
425-
[d.model_dump() for d in deploy],
425+
[d.dump() for d in deploy],
426426
key=lambda d: d["full_name"],
427427
),
428428
indent=2,

src/dvsim/job/deploy.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,9 @@ def extract_info_from_log(self, job_runtime_secs: int, log_text: list) -> None:
328328
log.warning(f"{self.full_name}: {e} Using dvsim-maintained job_runtime instead.")
329329
self.job_runtime.set(job_runtime_secs, "s")
330330

331-
def model_dump(self) -> Mapping:
331+
def dump(self) -> Mapping:
332332
"""Dump the deployment object to mapping object.
333333
334-
This method matches the interface provided by pydantic models to dump a
335-
subset of the class attributes
336-
337334
Returns:
338335
Representation of a deployment object as a dict.
339336

0 commit comments

Comments
 (0)