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

Strip out redundant __new__ to enable object pickling #548

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

Conversation

vjf
Copy link
Contributor

@vjf vjf commented Jan 7, 2019

I'd like to remove the redundant '__ new __' from the wfs classes in order to fix two problems:

  1. 'pickle' does not work (you cannot pickle the WFS classes)
  2. '__ init __' gets called twice each time the class is initialised. This creates a substantial performance lag on slower network connections.

See #520 for more information.

Thanks.

@cehbrecht cehbrecht added the wfs label Jan 7, 2019
@vjf vjf closed this Nov 8, 2019
@geographika
Copy link
Contributor

Reopening to check if this is still the case.

@geographika
Copy link
Contributor

The __new__ overrides date back to at least 15 years - e1d37a1
Since then OWSLib has moved from Python2 to Python3, I'm sure there was a reason at the time, but I can't see a need for the override now. Removing simplifies the code, removes duplicate calls to servers and resolves associated performance issues. Will be merging in the next 7 days - will leave open for comment until then.

Thanks @vjf for the fix.

@coveralls
Copy link

Coverage Status

coverage: 58.814% (-1.3%) from 60.156%
when pulling 4b9b7cf on vjf:strip_redundant_new
into ae98c20 on geopython:master.

@vjf
Copy link
Contributor Author

vjf commented Nov 3, 2024

@geographika @landryb Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants