Skip to content

Commit 4f55051

Browse files
committed
Switch deepcopy to dill for model copying
Replaced usage of deepcopy with dill serialization for copying model objects in InitMap. Added dill as a dependency in pyproject.toml to support this change.
1 parent eaf086f commit 4f55051

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pyenzyme/thinlayers/psyces.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from dataclasses import dataclass
1111
from pathlib import Path
1212
from joblib import Parallel, delayed
13+
import dill # noqa: F401
1314
import numpy as np
1415
import pandas as pd
1516
import os
@@ -526,7 +527,7 @@ def to_pysces_model(self, model: pysces.model):
526527
Returns:
527528
pysces.model: The updated model with initial conditions set.
528529
"""
529-
model = deepcopy(model)
530+
model = dill.loads(dill.dumps(model))
530531
model.sim_time = np.array(self.time)
531532
model.__dict__.update(
532533
{

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ mdmodels = "^0.2.1"
2323
joblib = "^1.5.0"
2424
bokeh = "^3.7.3"
2525
matplotlib = "^3.10"
26+
dill = ">=0.3.9,<0.5.0"
2627

2728
[tool.poetry.group.psyces.dependencies]
2829
pysces = "^1.2.3"

0 commit comments

Comments
 (0)