-
Notifications
You must be signed in to change notification settings - Fork 67
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
write functions that work work when numpy is not installed #30
Comments
I've taken the first stab at re-writing the np.cross() function in Python, including a new test function. They are located in the py_numeric.py and test_py_numeric.py files, respectively, within the geometry/ and tests/geometry_tests folders on the new 'i30_pythongeometry' branch. |
I've updated the style of my code to conform with PEP-8. surface.py itself has some non-conformities but I updated the module to conform up to the point that I need to modify (the import statements). I plan to ignore the rest of the module for now. Please confirm this is the recommended approach I'd like to modify it's test prior to modifying the surface.py module. My first inclination is to set up a virtual environment where numpy is not installed so that the try statement will fail but I'm not sure how to make this an explicit part of the test. Please advise. |
Can I assume that all vectors passed to the 'cross' function (cross product) are going to be 3-dimentional? This would greatly simplify the function. Also, can I assume this for any (or all) of the other numpy functions used? The original author of the Geometry library, Tuan Trang replied in an offline email that this is a valid assumption, so I have continued based on this information. |
I added a dot product function & test today. |
Eric, S. Sent from my iPad
|
No worries Santosh. I need to start on documentation and expanding test On 12/11/14 2:04 PM, santoshphilip wrote:
|
I've revised the vector cross product function and tests to use exception handling and assert that exceptions are raised in the tests. I just got the tests to pass and will be moving on to use the same pattern to revise the rest of the functions I've written so far (dot product, determinant) before moving on to other functions. Please review and advise as to weather the current approach is satisfactory before I move on Thx! Eric |
Awesome ! Santosh. Sent from my iPad
|
Eric, I have some thoughts on coding style (PEP 8) Looks like you are getting close to wrapping this up. Santosh |
Great! Thanks for the feedback. I feel like I'm starting to get the hang of it. |
Eric, You have been programming rather defensively so far, trying to get things right.You are on the right track.You can now code a little more aggressively now. Santosh |
Sounds good. I will keep that in mind and try to follow your advice. Sounds like the idea is to move more quickly and allow for more experimentation. I'm excited to start a new phase in my coding! |
Santosh, I started writing the replacement to numpy.array(), which encompasses a lot of functionality. I was thinking I might need to write a class since there are many methods associated with it. Then I took a look at where it's actually used within eppy. I only find references to it in the int2lines module. Furthermore, I don't see it imported or even referenced anywhere else in the project. If this is the case, I wonder if there is a good justification for re-implementing it in pure Python. I will move on to the last 2 numpy functions used; square root, and arc-cosine. Cheers Eric |
don't write anything you don't have to |
How can I import eppy in a java web application using Jython, with dependencies of numpy? thanks |
Eric, Vinc85 can use eppy in jython once you remove the numpy dependency. Vinc85 is wondering when that will happen :-) |
Yes, I was just looking into this. I was able to replace the remaining numpy dependencies with the Python native library, "math" so essentially I am done. I was working on a custom exception for singular matrices. Right now I've compromised and simply manually raised the base Exception class when the determinant is zero. vinc85: Great timing! This is quite validating and makes my work seem very useful. It's quite gratifying. Cheers Eric |
If it passes all the unit tests without installing numpy, you are done |
Cool! I will set up a virtual environment and run the tests, then. |
Many thanks Eric, I have tested eppy "i30_pythongeometry" and it seems to work without the library numpy.
Cool! I will set up a virtual environment and run the tests, then.— |
Also test if all the code in ./docs/Main_Tutorial.ipynb work. |
Dear all,I have imported a new version of eppy (without numpy dependecies) in a Java Web Application and when I doing this
Also test if all the code in ./docs/Main_Tutorial.ipynb work. |
vinc85, vince85's reply reformattedDear all,I have imported a new version of eppy (without numpy dependecies) in a Java Web Application and when I doing this
I have this error:
|
vinc85, |
Ok, but I have not this error if I run eppy on desktop and not on a Web Application?Why?
vinc85, |
It works if the filename is a string java is sending the filename in unicode, while the desktop script is sending it in string eppy should work with unicode too. |
It's true!!! ;-)
It works if the filename is a string |
vince85, try it now. eayoungs (Eric), unit test is failing if I run it with numpy installed. Santosh |
I don't understand...
vince85, try it now. eayoungs (Eric), unit test is failing if I run it with numpy installed. |
I am still not getting an install for tinynumpy
shall I try to set up a temporary pipy account for tinynumpy (I'll call it tinynumpy_test or something). Just to see if I can get it to work. |
Ugh! I thought I tested it on my Ubuntu machine, too. Let me check into it. This week is a little tight but I should be able to get to it in the next day or two. Thanks for staying in touch about this issue! Eric |
Santosh, (test_tnp)eayoungs@pinky:~$ pip install tinynumpy All tests pass on Ubuntu with both setups, too. |
Eric, I tracked down the problem. From my error log:
It installs if I do:
For eppy to install it, it should work without the "--pre". |
Interesting. I didn't use that flag, but I'll check with @wadetb (tinynumpy) and see if I can get this updated on PyPI. It may be late this week or early next. |
I am attaching my error log, if it helps. |
Maybe this is happening because the word "dev" is in the version number. the DOAP record: tinynumpy-1.2.0.dev3.xml says
try without the word "dev" in the version number. |
Sorry for the delay; I'll give it a try today. |
Give it a try now; I've removed the "dev3" from the package name. |
Yes ! It works |
in branch
I have lost track of what to merge, since this is an old issue. My recollection is that this was already merged into branch |
Great! I think I've got all the changes in the eayoungs branch. If the current state of that branch has been merged, then we're likely up to date. Now I can move on to getting the Python 3 version of eppy available on PyPI |
Eric,
I tested the merge and I am not seeing conflicts arising from doing the merge into develop |
Santosh, Cheers Eric |
Thanks. I'll test and then merge into develop. |
Some import statements need to be updated.
py.test gives the following errors
|
That's odd. First off, there shouldn't be any tinynumpy tests in the project anymore. I just checked quickly and there are commits on my machine that weren't pushed out. I've done that now and will check more closely this afternoon. |
Santosh, |
give ma a heads up when you are done with that. I am traveling most of December and may be out of contact. We should get some momentum on the python3 stuff before that. (completing the tinynumpy stuff is a precursor to that) |
I've been thinking about it and it should be just a matter of adjusting the import statement in eppy, hopefully without modifying tinynumpy Eric |
OK. I just made the changes to a few import statements and all tests path in both virtual environments (with numpy only, and with tinynumpy only). Happy Thanksgiving! |
Will test it. Then we will be ready for the python3 transition. Santosh. Sent from my iPad
|
Yessss !!!
I'll take steps to make this part of the develop branch |
Eric,
looks like most of them are from scripting you were doing.
|
Great! So glad to hear it.
|
Yes. I was so excited, and it was Thanksgiving, so I forgot to clean things
|
This is fully functional and released with the latest version |
There are geometry functions in ./eppy/geometry that use numpy.
It can be difficult to install numpy at times (for instance if you want to run epp in rhino http://www.rhino3d.com)
The text was updated successfully, but these errors were encountered: