99from ..engines import DadiEngine
1010from ..engines import all_engines , all_drawing_engines , all_available_engines
1111from ..models import StructureDemographicModel , CustomDemographicModel ,\
12- EpochDemographicModel
12+ EpochDemographicModel , TreeDemographicModel
1313from ..optimizers import get_local_optimizer , get_global_optimizer
1414from ..optimizers import LinearConstrain
1515from ..utils import check_dir_existence , check_file_existence , abspath ,\
@@ -1269,7 +1269,7 @@ def get_model(self):
12691269 has_dyns = create_dyns ,
12701270 sym_migs = sym_migs ,
12711271 frac_split = split_f ,
1272- migs_mask = migs_mask ,
1272+ migs_mask = copy . deepcopy ( migs_mask ) ,
12731273 gen_time = gen_time ,
12741274 theta0 = theta0 ,
12751275 mutation_rate = mut_rate ,
@@ -1441,8 +1441,8 @@ def get_available_engines(self, print_warnings=False):
14411441 continue
14421442 available_engines .append (engine .id )
14431443 else :
1444- assert isinstance (self . model , CustomDemographicModel )
1445- available_engines .append (self .engine . id )
1444+ assert isinstance (model , CustomDemographicModel )
1445+ available_engines .append (self .engine )
14461446 return available_engines
14471447
14481448 def is_valid (self ):
@@ -1454,7 +1454,7 @@ def is_valid(self):
14541454 if self .units_of_time_in_drawing != "generations" :
14551455 warnings .warn (
14561456 "Time for generation is not set. All times will be in"
1457- "generations (output and pictures)."
1457+ " generations (output and pictures)."
14581458 )
14591459 self .units_of_time_in_drawing != "generations"
14601460 if (self .input_data is None and
@@ -1563,9 +1563,9 @@ def is_valid(self):
15631563 )
15641564 self .units_of_time_in_drawing = "years"
15651565
1566- if self .sequence_length is None and momi_available :
1567- warnings .warn ("Code for momi2 will not be generated as `Sequence "
1568- " length` is missed." )
1566+ # if self.sequence_length is None and momi_available:
1567+ # warnings.warn("Code for momi2 will not be generated as `Sequence"
1568+ # " length` is missed.")
15691569
15701570 # Check for sequence length if we have several chrom lengths
15711571 if isinstance (self .sequence_length , dict ):
@@ -1598,25 +1598,26 @@ def is_valid(self):
15981598 "specify length for chromosomes separately via dict"
15991599 if not moments_ld_ok :
16001600 if self .engine != "momentsLD" :
1601- warnings .warn ("Code for momentsLD will not be generated as: "
1602- f"{ reason } " )
1601+ pass
1602+ # warnings.warn("Code for momentsLD will not be generated as: "
1603+ # f"{reason}")
16031604 else :
16041605 raise ValueError ("MomentsLD requirements are not satisfied: "
16051606 f"{ reason } " )
16061607
1607- for engine , is_available in zip (["demes" , "momi2" ],
1608- [demes_available , momi_available ]):
1609- if is_available :
1610- if not self .Nanc_will_be_available ():
1611- warnings .warn (
1612- f"Code for { engine } engine will not be generated as "
1613- "ancestral size will be missed in the dem. model. "
1614- "The following options should be set to enable it:\n "
1615- f"`Ancestral size as parameter`: True "
1616- f"(got `self.ancestral_size_as_parameter`)\n or\n "
1617- f"`Mutation rate` (got { self .mutation_rate } )\n "
1618- f"`Sequence length` (got { self .sequence_length } )\n or\n "
1619- f" `Theta0` (got { self .theta0 } )" )
1608+ # for engine, is_available in zip(["demes", "momi2"],
1609+ # [demes_available, momi_available]):
1610+ # if is_available:
1611+ # if not self.Nanc_will_be_available():
1612+ # warnings.warn(
1613+ # f"Code for {engine} engine will not be generated as "
1614+ # "ancestral size will be missed in the dem. model. "
1615+ # "The following options should be set to enable it:\n"
1616+ # f"`Ancestral size as parameter`: True "
1617+ # f"(got `self.ancestral_size_as_parameter`)\nor\n"
1618+ # f"`Mutation rate` (got {self.mutation_rate})\n"
1619+ # f"`Sequence length` (got {self.sequence_length})\nor"
1620+ # f"\n `Theta0` (got {self.theta0})")
16201621
16211622 if self .ld_kwargs is not None :
16221623 if self .engine != "momentsLD" :
0 commit comments