From 1b9af0ce9674badf576df893e754a964396ef08b Mon Sep 17 00:00:00 2001 From: Michael Buehlmann Date: Tue, 11 Jun 2024 10:04:02 -0500 Subject: [PATCH] import mergertrees and coretrees modules in main __init__.py, fix path-simulation argument in readers --- haccytrees/__init__.py | 2 ++ haccytrees/coretrees/coretree_reader.py | 2 +- haccytrees/mergertrees/forest_reader.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/haccytrees/__init__.py b/haccytrees/__init__.py index 54a7ce7..843c68a 100644 --- a/haccytrees/__init__.py +++ b/haccytrees/__init__.py @@ -5,5 +5,7 @@ __version__ = "0.9.1" from .simulations import Simulation +from . import mergertrees +from . import coretrees __all__ = ["Simulation"] diff --git a/haccytrees/coretrees/coretree_reader.py b/haccytrees/coretrees/coretree_reader.py index 5ca8cfe..b7ab32b 100644 --- a/haccytrees/coretrees/coretree_reader.py +++ b/haccytrees/coretrees/coretree_reader.py @@ -153,7 +153,7 @@ def corematrix_reader( calculate_secondary_host_row: bool = False, ): if isinstance(simulation, str): - if simulation[:-4] == ".cfg": + if simulation[-4:] == ".cfg": simulation = Simulation.parse_config(simulation) else: simulation = Simulation.simulations[simulation] diff --git a/haccytrees/mergertrees/forest_reader.py b/haccytrees/mergertrees/forest_reader.py index ec94689..e2c9234 100644 --- a/haccytrees/mergertrees/forest_reader.py +++ b/haccytrees/mergertrees/forest_reader.py @@ -208,7 +208,7 @@ def read_forest( """ if isinstance(simulation, str): - if simulation[:-4] == ".cfg": + if simulation[-4:] == ".cfg": simulation = Simulation.parse_config(simulation) else: simulation = Simulation.simulations[simulation]