Open vivaansinghvi07 opened 1 month ago
std::vector
s to py::array_t
sstd::unordered map
for correctness
std::unordered_map
python3 -m hstrat.dataframe.surface_unpack_reconstruct
commandstd::chunk_by
in main loop
py::array_t
interfacecppimport
an optional dependency
py::array_t
(for use within the library in the build_tree_searchtable
function)/usr/local/lib/python3.12/dist-packages/hstrat/phylogenetic_inference/tree/.rendered.build_tree_searchtable_cpp.cpp: In function ‘Records build_trie_searchtable(const pybind11::array_t<long
unsigned int>&, const pybind11::array_t<long unsigned int>&, const pybind11::array_t<long unsigned int>&, const pybind11::array_t<long unsigned int>&, std::optional<pybind11::handle>)’:
/usr/local/lib/python3.12/dist-packages/hstrat/phylogenetic_inference/tree/.rendered.build_tree_searchtable_cpp.cpp:443:27: warning: comparison of integer expressions of different signedness
: ‘u64’ {aka ‘long unsigned int’} and ‘pybind11::ssize_t’ {aka ‘long int’} [-Wsign-compare]
443 | for (u64 i = 1; i < ranks.size(); ++i) {
py::array_t
detach_search_parent
calls are necessary
ChildrenIterator
invalidation{rank, differentia}
is needed for accessing the std::unordered_map
, or if just differentia
is fineconsolidate_trie
smarter (potentially only calling when the rank changes)[[likely]]
and [[unlikely]]
tags to speed up branch predictionpy::array_t
objects or figure out how to make the memoryview
object lifetime (and therefore the Records
object lifetime) tied to the np.frombuffer
This issue documents the progress in #148:
TrieInnerNode
andTrieLeafNode
). This performs the fastest out of the other options.HereditaryStratigraphicArtifact
s all at one (per rank) rather than one at a time. However, due to lack of performance, it was not completed and is not useable to build a trie.__eq__
method in theTrieInnerNode
class for easier tree comparisonCode used to run the new methods:
In order to access the prototype methods for testing, you can import them directly from the
_impl
file such as in this benchmarking file.