Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some hacking on labelhash. #1021

Merged
merged 18 commits into from May 29, 2015
Merged

Some hacking on labelhash. #1021

merged 18 commits into from May 29, 2015

Conversation

ctb
Copy link
Member

@ctb ctb commented May 21, 2015

@camillescott will "like" this, I suspect... for some value of "like".

If this branch proves useful we should make the Python type hierarchy for Hashtable/CountingHash/Hashbits look more like the C++ object hierarchy. But let's see if it's useful first.

@camillescott
Copy link
Member

Ha! I was literally thinking about doing this EXACT thing today during the meeting at some point when I was, erm, clearly not going on a brain tangent. Not sure how you've developed these new mind-probing powers, but be careful in my head, it's perilous in there...

So yes, I like it. Note though: wouldn't it be better to just pass LabelHash a Hashbits or CountingHash from pythonland, rather than having it construct a new one in the __new__ method? That would also avoid having to override the LabelHash class at all in __init__.py

@ctb
Copy link
Member Author

ctb commented May 21, 2015

On Wed, May 20, 2015 at 08:07:04PM -0700, Camille Scott wrote:

Ha! I was literally thinking about doing this EXACT thing today during the meeting at some point when I was, erm, clearly not going on a brain tangent. Not sure how you've developed these new mind-probing powers, but be careful in my head, it's perilous in there...

No Comment.

So yes, I like it. Note though: wouldn't it be better to just pass LabelHash a Hashbits or CountingHash from pythonland, rather than having it construct a new one in the `new

Yep.

Now leave me alone, I've got hacking to do :)

@camillescott
Copy link
Member

Very well, carry on :)

@ctb
Copy link
Member Author

ctb commented May 21, 2015

While you are on the line -

if I'm loading labels and tags from disk, all I need to do is run

 check_and_allocate_label(label)

once for each label and then

 link_tag_and_label(tag, label)

for each tag/label pair, correct?

@camillescott
Copy link
Member

Yerp, that should do it.

@ctb
Copy link
Member Author

ctb commented May 21, 2015

Huh. Somewhat to my surprise, that seems to work.

}
else if (PyObject_TypeCheck(hashtable_o, &khmer_KCountingHash_Type)) {
khmer_KCountingHash_Object * cho = (khmer_KCountingHash_Object *) hashtable_o;
hashtable = cho->counting;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a final else that sets an error and returns.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@ctb
Copy link
Member Author

ctb commented May 26, 2015

  • Is it mergeable?
  • Did it pass the tests?
  • If it introduces new functionality in scripts/ is it tested?
    Check for code coverage with make clean diff-cover
  • Is it well formatted? Look at make pep8, make diff_pylint_report,
    make cppcheck, and make doc output. Use make format and manual
    fixing as needed.
  • Did it change the command-line interface? Only additions are allowed
    without a major version increment. Changing file formats also requires a
    major version number increment.
  • Is it documented in the ChangeLog?
    http://en.wikipedia.org/wiki/Changelog#Format
  • Was a spellchecker run on the source code and documentation after
    changes were made?
  • Is the Copyright year up to date?

@ctb
Copy link
Member Author

ctb commented May 26, 2015

The tests failed because of lowered code coverage, due to removal of so many lines of code. @mr-c, could you update the code coverage requirements, please, and then review?

@ctb ctb changed the title Some hacking on labelgraph. Some hacking on labelhash. May 27, 2015
return c


class CountingLabelHash(_LabelHash):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class has no test coverage.

infile.read((char *) &version, 1);
infile.read((char *) &ht_type, 1);
if (!(version == SAVED_FORMAT_VERSION)) {
std::ostringstream err;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch has no code coverage

@mr-c
Copy link
Contributor

mr-c commented May 27, 2015

Code coverage was reduced due to new function and code paths added without tests :-)

@ctb
Copy link
Member Author

ctb commented May 28, 2015

retest this please, jenkins

@ctb
Copy link
Member Author

ctb commented May 28, 2015

Hmm @mr-c looks like a Jenkins problem - out of memory in unrelated tests. Any thoughts?

Anyway, the PR is ready for review.

@mr-c
Copy link
Contributor

mr-c commented May 28, 2015

Maybe your test creates a memory leak prior?

@ctb
Copy link
Member Author

ctb commented May 28, 2015

On Wed, May 27, 2015 at 06:35:51PM -0700, Michael R. Crusoe wrote:

Maybe your test creates a memory leak prior?

Maybe? But can't think of what it would be...

@ctb
Copy link
Member Author

ctb commented May 28, 2015 via email

@ctb
Copy link
Member Author

ctb commented May 28, 2015 via email

@ctb
Copy link
Member Author

ctb commented May 28, 2015

whew ready for review @mr-c.

@mr-c
Copy link
Contributor

mr-c commented May 28, 2015

@ctb Lookin' good. I found a couple small things via cpychecker but nothing from your commits.

mr-c added a commit that referenced this pull request May 29, 2015
@mr-c mr-c merged commit 819ac87 into master May 29, 2015
@ctb ctb deleted the feature/labelgraph branch June 5, 2015 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants