OWSLib icon indicating copy to clipboard operation
OWSLib copied to clipboard

Strip out redundant __new__ to enable object pickling

Open vjf opened this issue 7 years ago • 3 comments

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 https://github.com/geopython/OWSLib/issues/520 for more information.

Thanks.

vjf avatar Jan 07 '19 00:01 vjf

Reopening to check if this is still the case.

geographika avatar Oct 20 '24 09:10 geographika

The __new__ overrides date back to at least 15 years - https://github.com/geopython/OWSLib/commit/e1d37a1df7b4afa5b558c87c5a84c270310c47e5 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.

geographika avatar Nov 01 '24 11:11 geographika

Coverage Status

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

coveralls avatar Nov 01 '24 11:11 coveralls

@geographika @landryb Thanks.

vjf avatar Nov 03 '24 23:11 vjf