Skip to content

Commit

Permalink
import mergertrees and coretrees modules in main __init__.py, fix pat…
Browse files Browse the repository at this point in the history
…h-simulation argument in readers
  • Loading branch information
michaelbuehlmann committed Jun 11, 2024
1 parent 2b06a84 commit 1b9af0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions haccytrees/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
__version__ = "0.9.1"

from .simulations import Simulation
from . import mergertrees
from . import coretrees

__all__ = ["Simulation"]
2 changes: 1 addition & 1 deletion haccytrees/coretrees/coretree_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion haccytrees/mergertrees/forest_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 1b9af0c

Please sign in to comment.