Skip to content

Commit

Permalink
Start to replace old back-end with the new
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Nov 25, 2020
1 parent 80f15c8 commit 15a8cff
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 107 deletions.
11 changes: 3 additions & 8 deletions fwdpy11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ set(FWDPP_TYPES_SOURCES src/fwdpp_types/init.cc ;
src/fwdpp_types/EdgeTable.cc
src/fwdpp_types/MutationTable.cc
src/fwdpp_types/SiteTable.cc
src/fwdpp_types/TableCollection.cc
src/fwdpp_types/GeneticMapUnit.cc
src/fwdpp_types/PoissonInterval.cc
src/fwdpp_types/BinomialPoint.cc
src/fwdpp_types/PoissonPoint.cc
src/fwdpp_types/FixedCrossovers.cc
src/fwdpp_types/BinomialInterval.cc)
src/fwdpp_types/TableCollection.cc)


set(FWDPY11_TYPES_SOURCES src/fwdpy11_types/init.cc
Expand All @@ -32,7 +26,8 @@ set(FWDPY11_TYPES_SOURCES src/fwdpy11_types/init.cc
src/fwdpy11_types/DiploidPopulation.cc
src/fwdpy11_types/ts_from_tskit.cc
src/fwdpy11_types/tsrecorders.cc
src/fwdpy11_types/RecordNothing.cc)
src/fwdpy11_types/RecordNothing.cc
src/fwdpy11_types/GeneticMapUnit.cc)

set(REGION_SOURCES src/regions/init.cc src/regions/Region.cc src/regions/Sregion.cc src/regions/GammaS.cc src/regions/ConstantS.cc
src/regions/ExpS.cc src/regions/UniformS.cc src/regions/GaussianS.cc src/regions/MutationRegions.cc
Expand Down
5 changes: 4 additions & 1 deletion fwdpy11/genetic_map_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ class PoissonInterval(fwdpy11._fwdpy11._ll_PoissonInterval):
beg: float
end: float
mean: float
discrete: bool = True

def __attrs_post_init__(self):
super(PoissonInterval, self).__init__(self.beg, self.end, self.mean)
super(PoissonInterval, self).__init__(
self.beg, self.end, self.mean, self.discrete
)


@attr_add_asblack
Expand Down
14 changes: 0 additions & 14 deletions fwdpy11/src/fwdpp_types/BinomialInterval.cc

This file was deleted.

13 changes: 0 additions & 13 deletions fwdpy11/src/fwdpp_types/BinomialPoint.cc

This file was deleted.

14 changes: 0 additions & 14 deletions fwdpy11/src/fwdpp_types/FixedCrossovers.cc

This file was deleted.

19 changes: 0 additions & 19 deletions fwdpy11/src/fwdpp_types/GeneticMapUnit.cc

This file was deleted.

13 changes: 0 additions & 13 deletions fwdpy11/src/fwdpp_types/PoissonInterval.cc

This file was deleted.

12 changes: 0 additions & 12 deletions fwdpy11/src/fwdpp_types/PoissonPoint.cc

This file was deleted.

13 changes: 0 additions & 13 deletions fwdpy11/src/fwdpp_types/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ void init_ts_EdgeTable(py::module &m);
void init_ts_MutationTable(py::module &);
void init_ts_SiteTable(py::module &);
void init_ts_TableCollection(py::module &);
void init_GeneticMapUnit(py::module &);
void init_PoissonInterval(py::module &);
void init_BinomialPoint(py::module &);
void init_PoissonPoint(py::module &);
void init_FixedCrossovers(py::module &);
void init_BinomialInterval(py::module &);

void
initialize_fwdpp_types(py::module &m)
Expand All @@ -43,13 +37,6 @@ initialize_fwdpp_types(py::module &m)
init_HaploidGenome(m);
init_data_matrix(m);

init_GeneticMapUnit(m);
init_PoissonInterval(m);
init_BinomialPoint(m);
init_PoissonPoint(m);
init_FixedCrossovers(m);
init_BinomialInterval(m);

// Types related to tree sequenc recording
init_NULL_NODE(m);
init_ts_Node(m);
Expand Down
15 changes: 15 additions & 0 deletions fwdpy11/src/fwdpy11_types/GeneticMapUnit.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <pybind11/pybind11.h>
#include <fwdpy11/regions/GeneticMapUnit.hpp>

namespace py = pybind11;

void
init_GeneticMapUnit(py::module& m)
{
py::class_<fwdpy11::GeneticMapUnit>(m, "_ll_GeneticMapUnit");

py::class_<fwdpy11::PoissonInterval, fwdpy11::GeneticMapUnit>(m,
"_ll_PoissonInterval")
.def(py::init<double, double, double, bool>(), py::kw_only(), py::arg("begin"),
py::arg("end"), py::arg("mean"), py::arg("discrete") = true);
}
2 changes: 2 additions & 0 deletions fwdpy11/src/fwdpy11_types/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ void init_DiploidPopulation(py::module & m);
void init_tsrecorders(py::module & m);
void
init_RecordNothing(pybind11::module &);
void init_GeneticMapUnit(pybind11::module &);

void initialize_fwdpy11_types(py::module & m)
{
Expand All @@ -28,4 +29,5 @@ void initialize_fwdpy11_types(py::module & m)
init_DiploidPopulation(m);
init_RecordNothing(m);
init_tsrecorders(m);
init_GeneticMapUnit(m);
}

0 comments on commit 15a8cff

Please sign in to comment.