Closed Avsecz closed 6 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
genomelake/extractors.py | 4 | 5 | 80.0% | ||
<!-- | Total: | 4 | 5 | 80.0% | --> |
Totals | |
---|---|
Change from base Build 60: | -0.5% |
Covered Lines: | 153 |
Relevant Lines: | 171 |
I would check if the bigwig library being used is thread-safe; this was why I re-opened the file everytime.
On Sat, Aug 11, 2018 at 5:47 AM, Chris Probert notifications@github.com wrote:
@chrisprobert commented on this pull request.
In genomelake/extractors.py https://github.com/kundajelab/genomelake/pull/17#discussion_r209392544:
return out
+
- def close(self):
I'm thinking of scenarios where someone is running genomelake in a training loop, and keeps instantiating extractors, e.g. for each epoch of training a model, without explicitly calling close(). Adding the del would stop us from filling up the file descriptor table.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kundajelab/genomelake/pull/17#discussion_r209392544, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSeiNnbyhZU8Pk17432B6dWIZ89gHgnks5uPf-PgaJpZM4V4eBs .
I think that's an important point to document, but it shouldn't prevent the user to efficiently use the extractors. The same is done for the FastaExtractor and pysam.FastaFile
is not threadsafe.
Agreed completely.
On Mon, Aug 13, 2018 at 9:00 PM, Žiga Avsec notifications@github.com wrote:
I think that's an important point to document, but it shouldn't prevent the user to efficiently use the extractors. The same is done for the FastaExtractor and pysam.Fasta is not threadsafe.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kundajelab/genomelake/pull/17#issuecomment-412509640, or mute the thread https://github.com/notifications/unsubscribe-auth/AFSeiDzWbP3_T8IWwB1yA1Y7SyHhl_seks5uQXiCgaJpZM4V4eBs .
added a docstring saying the extractor is not thread-safe
@jisraeli I will merge this PR. Fine?
👍
Consistently with the FastaExtractor, the file should be opened once in the
__init__
and not every time in_extract
.