Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
More consolidation of Hashtable derived types. #1504
Conversation
ctb
added some commits
Nov 3, 2016
codecov-io
commented
Nov 3, 2016
•
Current coverage is 95.76% (diff: 100%)@@ master #1504 diff @@
==========================================
Files 36 36
Lines 2938 2952 +14
Methods 0 0
Messages 0 0
Branches 449 449
==========================================
+ Hits 2813 2827 +14
Misses 55 55
Partials 70 70
|
ctb
added some commits
Nov 7, 2016
ctb
referenced
this pull request
Nov 8, 2016
Merged
Rename CountingHash to Countgraph and Hashbits to Nodegraph #1506
|
Ready for initial review, y'all. @betatim @luizirber @camillescott @standage. Might be easier to go commit by commit :(. Still have to check out my modifications to the abundance dist functions, and I'm not sure if I should add tests for Counttable and Nodetable on this PR, but I think most of it is done. |
ctb
added some commits
Nov 8, 2016
|
Prefer |
This was referenced Nov 10, 2016
|
This was referenced Nov 12, 2016
| + Counttable * counttable; | ||
| +} khmer_KCounttable_Object; | ||
| + | ||
| +static PyMethodDef khmer_counttable_methods[] = { |
ctb
Nov 15, 2016
Owner
I went both ways on this - it's nice to have it there for if/when we add methods... but yeah, I guess no need.
| + 0, /*tp_setattro*/ | ||
| + 0, /*tp_as_buffer*/ | ||
| + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ | ||
| + "hashgraph object", /* tp_doc */ |
| + 0, /* tp_new */ | ||
| +}; | ||
| + | ||
| +#define is_hashgraph_obj(v) (Py_TYPE(v) == &khmer_KHashgraph_Type) |
| + ++since; | ||
| + } | ||
| + } | ||
| +#else |
camillescott
Nov 15, 2016
Member
I'd like to see these bits of code detritus go, but I think perhaps that should get its own PR -- there's a fair amount of it.
| - // Iterate through the reads and consume their k-mers. | ||
| - while (!parser->is_complete( )) { | ||
| + BoundedCounterType max_count = 0; |
betatim
Nov 14, 2016
Member
If you move this up to be the first definition in the method you (probably) don't have to pay for a copy when returning it.
betatim
Nov 15, 2016
Member
https://en.wikipedia.org/wiki/Return_value_optimization it probably isn't that exciting in this case but for other/bigger/expensive to copy types it might be more interesting
|
I assume that the substantial bits of code that were moved didn't get modified when you moved them because the tests still pass. |
| + | ||
| + if (self != NULL) { | ||
| + WordLength k = 0; | ||
| + PyListObject * sizes_list_o = NULL; |
betatim
Nov 15, 2016
Member
Do you know who owns the reference to the list that comes from PyArg_ParseTuple?
betatim
Nov 15, 2016
Member
PyArg_ParseTuple doesn't increase the reference count, and presumably the ref count can't decrease to zero while we are using an argument to this function.
|
Let's ahead and push the magic merge button when the build ends! (but please don't squash commits :) |
betatim
merged commit a375468
into master
Nov 15, 2016
1 check passed
|
Doh, I was too late :( |
|
wassup @camillescott? |
ctb commentedNov 3, 2016
•
edited
Briefly, this PR:
These changes make a clear distinction between 'tables' and 'graphs' - tables have all of
the basic functionality needed for counting, while graphs support various traversal methods.
This paves the way for:
(a) adding new hash functions, including irreversible ones supporting k > 32 for the *table objects; and
(b) building out a new Counttable CPython object that will support the non-graph operations for k > 32.
(I don't like the 'Counttable' name that much but it fits with Countgraph. I suppose we could do Countstable. But that might engender confusion. Thoughts?)
make testDid it pass the tests?make clean diff-coverIf it introduces new functionality inscripts/is it tested?make format diff_pylint_report cppcheck doc pydocstyleIs it wellformatted?
without a major version increment. Changing file formats also requires a
major version number increment.
ChangeLog?http://en.wikipedia.org/wiki/Changelog#Format
changes were made?
tested for streaming IO?)