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

CleanPaths modifies argument #2

Open
GunnarSchmidt-TomTom opened this issue Jun 14, 2015 · 5 comments
Open

CleanPaths modifies argument #2

GunnarSchmidt-TomTom opened this issue Jun 14, 2015 · 5 comments

Comments

@GunnarSchmidt-TomTom
Copy link

The function gatools.CleanPaths modifies the passed argument instead of retuning a new object.
This is dangerous, since it might be unexpected by the caller.
Ideally, functions should not modify the passed arguments.

@GunnarSchmidt-TomTom
Copy link
Author

The function gatools.ExtractSubmatrix raises an Error when executing the examples in the doc-string:

testmat = numpy.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]], int)
result = gatools.ExtractSubmatrix(testmat, [0, 3])

@gorkazl
Copy link
Owner

gorkazl commented Aug 1, 2015

The example in gatools.ExtractSubmatrix() was just wrong, it required a 4x4 array. The function itself seems to be fine.

I will check the issue in gatools.CleanPaths(). I know I wrote it in that manner, to modify the arguments in place for a reason but I don't remember it now.

By the way, now I am a bit confused with the branches… I made today some changes and commited them. When I logged-in into GitHub I noticed that you had forked the project and had done some commits by yourself. (I did not receive an e-mail notification in June when you made the changes). I noticed that my files are locally (in my computer) not updated. In the GitHub website it seems there are two versions, one in gorkazl/pyGAlib and another in schmigu/pyGAlib. The changes I make are seen in gorkazl/pyGAlib but do not appear in schmigu/pyGAlib. So I am guessing that if you make changes to schmigu/pyGAlib I won't notice either. Does this mean there are two independent version of pyGAlib now? Should that be the case, or shall we both edit the same version? I don't think I want anybody modifying my version without notice and wake up one day to see that everything has changed but, I see it positive to have only one version and that any improvement done is directly available for everyone.

Best,
Gorka

@gorkazl gorkazl closed this as completed Aug 1, 2015
@gorkazl gorkazl reopened this Aug 1, 2015
@gorkazl
Copy link
Owner

gorkazl commented Aug 1, 2015

Uops, I just wanted to leave a comment but apparently closed the issue, while one point is still open.

@GunnarSchmidt-TomTom
Copy link
Author

Hi gorka, yes there are two versions now. However, mine is a fork from your version that i also edited. I created a pull request for you, such that you can review my changes and merge them, if you like what i did. After that, i can drop my own version and fork yours again. It's the typical git workflow. Your version should always be the original master version.

Best regards, the mysterious schmigu that you might happen to know from the past...

Am 1. August 2015 13:28:35 MESZ, schrieb Gorka Zamora notifications@github.com:

The example in gatools.ExtractSubmatrix() was just wrong, it
required a 4x4 array. The function itself seems to be fine.

I will check the issue in gatools.CleanPaths(). I know I wrote it
in that manner, to modify the arguments in place for a reason but I
don't remember it now.

By the way, now I am a bit confused with the branches… I made today
some changes and commited them. When I logged-in into GitHub I noticed
that you had forked the project and had done some commits by yourself.
(I did not receive an e-mail notification in June when you made the
changes). I noticed that my files are locally (in my computer) not
updated. In the GitHub website it seems there are two versions, one in
gorkazl/pyGAlib and another in schmigu/pyGAlib. The changes I make are
seen in gorkazl/pyGAlib but do not appear in schmigu/pyGAlib. So I am
guessing that if you make changes to schmigu/pyGAlib I won't notice
either. Does this mean there are two independent version of pyGAlib
now? Should that be the case, or shall we both edit the same version? I
don't think I want anybody modifying my version without notice and wake
up one day to see that everything has changed but, I see it positive to
have only one version and that any improvement done is directly
available for everyone.

Best,
Gorka


Reply to this email directly or view it on GitHub:
#2 (comment)

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

@gorkazl
Copy link
Owner

gorkazl commented Aug 10, 2015

Hi…

it took me a while to get that working but I think I did merge your corrections properly. They are now included in the master branch. Still need to check the issue on gatools.CleanPaths(), though, so I am not closing this for now.

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

No branches or pull requests

2 participants