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

Unloading fix #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Unloading fix #86

wants to merge 1 commit into from

Conversation

dkoguciuk
Copy link

Now unloading a sequence does not delete the information about the sequence from the dataset - it just release the loaded data.

Now unloading a sequence does not delete the information about the sequence from the dataset - it just release the loaded data.
@dkoguciuk
Copy link
Author

@ltriess could you have a look at it? It's related to #76

@dkoguciuk
Copy link
Author

Ah, and a use case:

Previously, this code gives first iteration over the whole dataset, then no iteration, since the information about the sequences was gone:

for sequence in dataset.sequences():     # Normal iteration
    seq = dataset[sequence]
    seq.load()
    dataset.unload(sequence)

for sequence in dataset.sequences():     # Empty list of sequences
    seq = dataset[sequence]
    seq.load()
    dataset.unload(sequence)

And now it's possible to iterate over the dataset multiple times, without reinitializing dataset variable:

for sequence in dataset.sequences():     # Normal iteration
    seq = dataset[sequence]
    seq.load()
    dataset.unload(sequence)

for sequence in dataset.sequences():     # Normal iteration
    seq = dataset[sequence]
    seq.load()
    dataset.unload(sequence)

@ltriess
Copy link
Contributor

ltriess commented Nov 23, 2020

Looks like a better fix to me. I think @xpchuan-95 can merge it?

Still it would be better to not have to re-initialize the sequence or to not even need this unloading mechanism at all. But I guess this would require a new loading concept, therefore the solutions provided by this pull request and #76 are sufficient enough for a fix.

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.

2 participants