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

Repair the array copy speedup trick. Fixes #236. #256

Closed
wants to merge 1 commit into from

Conversation

pilcru
Copy link

@pilcru pilcru commented Feb 19, 2018

The remote object needs to be an array already for array() to be accepted by Numpy.

The remote object needs to be an array already for __array__() to be accepted by Numpy.
@coldfix
Copy link
Contributor

coldfix commented Feb 23, 2018

Thanks. Sorry, it will take me a few days to process, since I have a lot to do right now.

@@ -148,6 +148,11 @@ def __getattribute__(self, name):
return self.__dir__()
elif name in _deleted_netref_attrs:
raise AttributeError()
elif name == "__array__": # Speedup array copy if the remote is an array
if hasattr(self, '__array__'):
Copy link
Contributor

Choose a reason for hiding this comment

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

Note, this line causes an infinite recursion, since hasattr is based on getattr mechanism which causes __getattribute__ to be called.

@coldfix
Copy link
Contributor

coldfix commented Mar 2, 2018

Hi,

after more consideration I found that Netref.__getattribute__ is pretty hard to get right. I will provide an alternative solution. Hope you don't mind.

Best, Thomas

@coldfix coldfix closed this in 9f45f82 Mar 2, 2018
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.

2 participants