Coder Social home page Coder Social logo

Comments (6)

wolph avatar wolph commented on July 22, 2024

Python 3 is indeed not working yet, I'll add it to my todo but it's slightly more work than I had hoped :(

from numpy-stl.

mattngc avatar mattngc commented on July 22, 2024

I did a test with 2to3.
$> 2to3 --output-dir=numpy-stl-3 -W -n numpy-stl-1.4.2
This seems to go a long way towards the changes needed. After doing this I could use pip to install the package and import it. Interestingly, the utilities work in one direction:

This works fine:
stl2ascii mybinary.stl myascii.stl

This fails:
$> stl2bin myascii.stl mybin.stl
Traceback (most recent call last):
File "/home/matt/anaconda3/bin/stl2bin", line 9, in
load_entry_point('numpy-stl==1.4.2', 'console_scripts', 'stl2bin')()
File "/home/matt/Downloads/test23/numpy-stl-3/stl/main.py", line 80, in to_binary
update_normals=not args.use_file_normals)
File "/home/matt/Downloads/test23/numpy-stl-3/stl/stl.py", line 198, in save
write(fh, name)
File "/home/matt/Downloads/test23/numpy-stl-3/stl/stl.py", line 227, in _write_binary
fh.write(struct.pack('@i', self.data.size))
TypeError: must be str, not bytes

Obviously, this must be to the changes in string and byte handling in python 3. Would love to help more, but I'm not an expert.

from numpy-stl.

wolph avatar wolph commented on July 22, 2024

That's indeed the problem I ran into, it's not impossible to fix but it's just taking slightly more time than I have right now :)

Still a work in progress though.

from numpy-stl.

mattngc avatar mattngc commented on July 22, 2024

ok, if I end up doing any more work on it for my application, I will try to post my findings here.

from numpy-stl.

wolph avatar wolph commented on July 22, 2024

I've just committed a few changes to make it slightly better, but something is fundamentally different in how py3k handles things, just try and run the test suite and you'll see that something is a bit weird :)

from numpy-stl.

wolph avatar wolph commented on July 22, 2024

I've just released version 1.5 which has Python 3 support as well as Python 2 support :)

from numpy-stl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.