-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
207,907 additions
and
614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.py linguist-language=python | ||
*.ipynb linguist-documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
include cassiopeia/preprocess/*.pyx | ||
include cassiopeia/solver/*.pyx | ||
include *.toml | ||
include LICENSE | ||
recursive-include cassiopeia * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import os | ||
import shutil | ||
from distutils.command.build_ext import build_ext | ||
from distutils.core import Distribution, Extension | ||
|
||
import numpy | ||
from Cython.Build import cythonize | ||
|
||
# https://github.com/mdgoldberg/poetry-cython-example | ||
|
||
|
||
def build(): | ||
extensions = [ | ||
Extension( | ||
"cassiopeia.preprocess.collapse_cython", | ||
["cassiopeia/preprocess/collapse_cython.pyx"], | ||
), | ||
Extension( | ||
"cassiopeia.solver.ilp_solver_utilities", | ||
["cassiopeia/solver/ilp_solver_utilities.pyx"], | ||
include_dirs=[numpy.get_include()], | ||
), | ||
Extension( | ||
"cassiopeia.tools.branch_length_estimator._iid_exponential_bayesian", | ||
sources=[ | ||
"cassiopeia/tools/branch_length_estimator/_iid_exponential_bayesian.pyx", | ||
"cassiopeia/tools/branch_length_estimator/_iid_exponential_bayesian_cpp.cpp", | ||
], | ||
extra_compile_args=[ | ||
"-std=c++17", | ||
"-Wall", | ||
"-Wextra", | ||
"-pedantic", | ||
"-O3", | ||
], | ||
language="c++", | ||
), | ||
] | ||
ext_modules = cythonize( | ||
extensions, | ||
compiler_directives={"language_level": 3}, | ||
) | ||
|
||
distribution = Distribution({"name": "extended", "ext_modules": ext_modules}) | ||
distribution.package_dir = "extended" | ||
|
||
cmd = build_ext(distribution) | ||
cmd.ensure_finalized() | ||
cmd.run() | ||
|
||
# Copy built extensions back to the project | ||
for output in cmd.get_outputs(): | ||
relative_extension = os.path.relpath(output, cmd.build_lib) | ||
shutil.copyfile(output, relative_extension) | ||
mode = os.stat(relative_extension).st_mode | ||
mode |= (mode & 0o444) >> 2 | ||
os.chmod(relative_extension, mode) | ||
|
||
|
||
if __name__ == "__main__": | ||
build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
"""Top level for the cassiopeia critique module.""" | ||
|
||
__author__ = "Matt Jones, Richard Zhang" | ||
__email__ = "mattjones315@berkeley.edu" | ||
__version__ = "0.0.1" | ||
|
||
from .compare import robinson_foulds, triplets_correct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.