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

Cleanup policy #76

Merged
merged 1 commit into from Nov 13, 2017
Merged

Cleanup policy #76

merged 1 commit into from Nov 13, 2017

Conversation

fukatani
Copy link
Member

#75

@fukatani
Copy link
Member Author

All tests passed locally, but parallel_grid_search doesn't work well... 😢

@StrikerRUS
Copy link
Member

Hi @fukatani !

I remember the same situation when I developed the current implementation of rgf_python to use in parallel code. The short tip: do not rely on (use) __del__ method - you will face with unexpected behavior.

I suggest to add a standalone method to class (transfer code from __del__ to it) which will help user to free resources and will be called by him exactly when needed.

@fukatani
Copy link
Member Author

fukatani commented Nov 12, 2017

@StrikerRUS
Thanks for information and suggestion! That's exactly what I needed.

_cleanup is simple and works well, so we can publish it as API instead of new delete method.
How do you think?

@StrikerRUS
Copy link
Member

StrikerRUS commented Nov 12, 2017

Did you mean _cleanup_partial?

And can you please add the test with something like this?

clf1 = RGFClassifier()
clf2 = RGFClassifier()

clf1.fit(X, y)
clf2.fit(X, y)

clf1.free_data()  # I actually don't know how to name it properly

clf1.predict(X)  # Raises error
clf2.predict(X)  # No error

Also you may bring back _UUIDS.remove(uuid) into the method for speedup (I see you removed this code in the second commit).

@fukatani
Copy link
Member Author

And can you please add the test with something like this?

Good point. This API is used by users, it should be tested.
I checked file deleted by glob.

Also you may bring back _UUIDS.remove(uuid) into the method for speedup (I see you removed this code in the second commit).

Thanks, I implemented it.

@fukatani fukatani merged commit b82859b into master Nov 13, 2017
@fukatani fukatani deleted the cleanup-policy branch December 10, 2017 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants