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

Migrate to DSS Python 0.10 #41

Merged
merged 6 commits into from
Nov 19, 2018
Merged

Migrate to DSS Python 0.10 #41

merged 6 commits into from
Nov 19, 2018

Conversation

PMeira
Copy link
Member

@PMeira PMeira commented Nov 17, 2018

This integrates with DSS Python 0.10.0 (just released).

Closes #32, closes #36, closes #39.

@PMeira
Copy link
Member Author

PMeira commented Nov 18, 2018

Weird... Python 3.6.7 introduces changes in how paths are handled on Windows and it breaks one test.

>       assert os.path.abspath(dss.Basic.DataPath()) == os.path.abspath(".")
E       AssertionError: assert 'C:\\projects...ssdirect-py\\' == 'C:\\projects\...ndssdirect-py'
E         - C:\projects\opendssdirect-py\
E         ?                             -
E         + C:\projects\opendssdirect-py

Seems like a bug since the behavior is not consistent on Linux:

Python 3.6.7 |Anaconda, Inc.| (default, Oct 23 2018, 19:16:44)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.abspath('/tmp/'), os.path.abspath(".")
('/tmp', '/tmp')
>>> os.path.abspath('/tmp/'), os.path.abspath("./")
('/tmp', '/tmp')

@kdheepak
Copy link
Member

kdheepak commented Nov 18, 2018

Ugh that's unfortunate. If we can make it dss.Basic.DataPath().strip(os.path.sep) before calling os.path.abspath on the result and the tests pass, I think we can merge.

@PMeira
Copy link
Member Author

PMeira commented Nov 18, 2018

I added something similar, passed the tests locally. If it doesn't work, I'll update it to use strip.

It seems the bug is already fixed: https://bugs.python.org/issue34949

@kdheepak kdheepak merged commit 5af1e77 into master Nov 19, 2018
@kdheepak kdheepak deleted the dss_python_0.10 branch November 19, 2018 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants