Skip to content

Provide backward-compatible nxutils #746

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

Merged
merged 7 commits into from
Mar 14, 2012

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Mar 8, 2012

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
Member

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


Deprecated: Use `matplotlib.path.Path.contains_point` instead.
"""
warings.warn(
Copy link
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
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
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
Copy link
Member Author

mdboom commented Mar 9, 2012

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
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
Copy link
Member Author

mdboom commented Mar 9, 2012

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

@WeatherGod
Copy link
Member

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

@WeatherGod
Copy link
Member

Is the fix in master already or another PR?

@mdboom
Copy link
Member Author

mdboom commented Mar 14, 2012

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
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