Skip to content

Commit ce46329

Browse files
authored
Merge pull request #1059 from amath-idm/multisim_label
Set MultiSim name
2 parents 464f0e0 + 4cedc46 commit ce46329

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

covasim/run.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(self, sims=None, base_sim=None, label=None, initialize=False, **kwa
8686
# Set properties
8787
self.sims = sims
8888
self.base_sim = base_sim
89-
self.label = label
89+
self.label = base_sim.label if (label is None and base_sim is not None) else label
9090
self.run_args = sc.mergedicts(kwargs)
9191
self.results = None
9292
self.which = None # Whether the multisim is to be reduced, combined, etc.
@@ -660,14 +660,16 @@ def merge(*args, base=False):
660660
args = args[0] # A single list of MultiSims has been provided
661661

662662
# Create the multisim from the base sim of the first argument
663-
msim = MultiSim(base_sim=sc.dcp(args[0].base_sim))
663+
msim = MultiSim(base_sim=sc.dcp(args[0].base_sim), label=args[0].label)
664664
msim.sims = []
665665
msim.chunks = [] # This is used to enable automatic splitting later
666666

667667
# Handle different options for combining
668668
if base: # Only keep the base sims
669669
for i,ms in enumerate(args):
670-
msim.sims.append(sc.dcp(ms.base_sim))
670+
sim = sc.dcp(ms.base_sim)
671+
sim.label = ms.label
672+
msim.sims.append(sim)
671673
msim.chunks.append([[i]])
672674
else: # Keep all the sims
673675
for ms in args:

0 commit comments

Comments
 (0)