Skip to content

Provide backward-compatible nxutils - #746

Merged
WeatherGod merged 7 commits into
matplotlib:masterfrom
mdboom:nxutils_backward
Mar 14, 2012
Merged

WeatherGod merged 7 commits into
matplotlib:masterfrom
mdboom:nxutils_backward

Conversation

@mdboom

@mdboom mdboom commented Mar 8, 2012

Copy link
Copy Markdown
Member

nxutils was used in master because it is redundant to code in _path.cpp and to reduce the amount of code that needed to be ported to Python 3.x. A backward-compatible shim should be added so old nxutils-using code still works.

@ghost ghost assigned mdboom Mar 7, 2012
…plemented in terms of the methods in _path.cpp. A "points_in_path" method has been added to support "nxutils.points_in_poly".
@WeatherGod

Copy link
Copy Markdown
Member

Note that pull #732 also addresses the lasso demo. Might want to merge in some of his changes as well?

Comment thread lib/matplotlib/nxutils.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your warnings are backwards. The string comes first, then the deprecation.

@WeatherGod

Copy link
Copy Markdown
Member

So far, my tests have not revealed differences in results or (significant) differences in speed. I have a patch for some of the points I have made so far. I still think there is a memory leak somewhere. Possibly a missing DecRef somewhere.

WeatherGod and others added 3 commits March 9, 2012 13:11
* Fixed usage error with deprecation warnings
* Used deprecation directive in docstrings
* Made point_in_path_impl more memory efficient
@WeatherGod

Copy link
Copy Markdown
Member

Memory usage grows as I make many, many calls to points_in_poly() (a few thousand calls). I will make a test script to demonstrate.

Conflicts:
	examples/event_handling/lasso_demo.py
@mdboom mdboom mentioned this pull request Mar 9, 2012
@mdboom

mdboom commented Mar 9, 2012

Copy link
Copy Markdown
Member Author

Sorry for the obvious misses in _path.cpp -- I'm working in between talks at PyCon this week ;)

Merged @pelson's lasso_demo.py fixes.

@WeatherGod

Copy link
Copy Markdown
Member

No problem. That's what these checks are for. As for the memory leak, check out my gist:
https://gist.github.com/2008618

When I run it in v1.1.x, my memory usage is stable. When I run it in your branch (be sure to remove lib/nxutils.so), my memory usage keeps climbing a few megabytes per second.

Don't worry too much about exactly what it does. It comes from a much more complicated polar to rect rasterizer that followed very special rules in certain cases.

@mdboom

mdboom commented Mar 9, 2012

Copy link
Copy Markdown
Member Author

Is the memory leak still there with the fix in abb1dc9?

@WeatherGod

Copy link
Copy Markdown
Member

Yes, the leak goes away with that fix. I haven't tested pnpoly, though.

@WeatherGod

Copy link
Copy Markdown
Member

Is the fix in master already or another PR?

@mdboom

mdboom commented Mar 14, 2012

Copy link
Copy Markdown
Member Author

The fix is in this PR. If it resolves issues for your nxutils-using code, I think this is probably good to go.

@WeatherGod

Copy link
Copy Markdown
Member

ah, I missed it in the list. Ok, merging...

WeatherGod added a commit that referenced this pull request Mar 14, 2012
Provide backward-compatible nxutils
@WeatherGod
WeatherGod merged commit af2efa4 into matplotlib:master Mar 14, 2012
@mdboom
mdboom deleted the nxutils_backward branch March 3, 2015 18:44
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.

4 participants