Giter Club home page Giter Club logo

pyparticles's People

Contributors

simon-r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyparticles's Issues

Unable to install on Linux

I'm unable to install this package with pip, due to what appears to be a bug in setup.py.

$ sudo easy_install -U setuptools
$ python -c "import setuptools; print setuptools.__version__"
7.0
$ virtualenv --no-site-packages .env
$ . .env/bin/activate
(.env)$ easy_install -U setuptools
(.env)$ python -c "import setuptools; print setuptools.__version__"
7.0
(.env)$ pip install PyParticles
Downloading/unpacking PyParticles
  Downloading PyParticles-0.3.5.tar.gz (679kB): 679kB downloaded
  Running setup.py (path:project_dir.env/build/PyParticles/setup.py) egg_info for package PyParticles

Installing collected packages: PyParticles
  Running setup.py install for PyParticles
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: option --single-version-externally-managed not recognized
    Complete output from command project_dir.env/bin/python2.7 -c "import setuptools, tokenize;__file__='project_dir.env/build/PyParticles/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-NZhh1C-record/install-record.txt --single-version-externally-managed --compile --install-headers project_dir.env/include/site/python2.7:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

   or: -c --help [cmd1 cmd2 ...]

   or: -c --help-commands

   or: -c cmd --help



error: option --single-version-externally-managed not recognized

----------------------------------------
Cleaning up...
Command project_dir.env/bin/python2.7 -c "import setuptools, tokenize;__file__='project_dir.env/build/PyParticles/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-NZhh1C-record/install-record.txt --single-version-externally-managed --compile --install-headers project_dir.env/include/site/python2.7 failed with error code 1 in project_dir.env/build/PyParticles
Storing debug log for failure in ~/.pip/pip.log

Googling shows using the --egg option can sometimes work around this error/bug. However, this is not the case with PyParticles:

(.env)$ pip install --egg PyParticles
writing list of installed files to '/tmp/pip-tWrAQd-record/install-record.txt'

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "project_dir.env/build/PyParticles/setup.py", line 87, in <module>

    cmdclass={"install": particles_install }

  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup

    dist.run_commands()

  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "project_dir.env/build/PyParticles/setup.py", line 50, in run

    env=dict({"PREFIX": os.path.join( self.root , prefix ) }, **dict(os.environ))).communicate()[0]

  File "project_dir.env/lib/python2.7/posixpath.py", line 68, in join

    elif path == '' or path.endswith('/'):

AttributeError: 'NoneType' object has no attribute 'endswith'

Despite this last error, it does seem to at least partially install the package, as I can import pyparticles, but ideally, no error should be returned for a successful installation.

No output with TypeError Nonetype is not callable

Running your solar system example here, I always get the following:

C:\Anaconda\lib\site-packages\pyparticles\pset\particles_set.py:94: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if self.__mass  != None :
C:\Anaconda\lib\site-packages\pyparticles\forces\gravity.py:75: RuntimeWarning: divide by zero encountered in divide
  self.__Fm[:] = - self.__G * self.__M[:] / ( ( self.__D[:] ) ** 3.0 )
Exception TypeError: "'NoneType' object is not callable" in <bound method AxisOgl.__del__ of <pyparticles.ogl.axis_ogl.AxisOgl object at 0x000000000D4AF6D8>> ignored

TypeError: 'NoneType' object is not callable

Windows 10
OpenGL 3.1.2
Numpy 1.14.1

When running the solar system sample, I get the following error:

Start the simulation example:
 Solar system
 -- Try to watch the Moon ... around the Earth 

 Use your mouse for rotating, zooming and tranlating the scene.

For more details type:
 pyparticles --help

Traceback (most recent call last):
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\latebind.py", line 41, in __call__
    return self._finalCall( *args, **named )
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/2018069/PycharmProjects/pyparticles-0.3.5/pyparticles_app", line 25, in <module>
    main.main()
  File "C:\Users\2018069\PycharmProjects\pyparticles-0.3.5\pyparticles\main\main.py", line 185, in main
    sol.solar_system()
  File "C:\Users\2018069\PycharmProjects\pyparticles-0.3.5\pyparticles\demo\solar_system.py", line 218, in solar_system
    a.build_animation()
  File "C:\Users\2018069\PycharmProjects\pyparticles-0.3.5\pyparticles\animation\animated_ogl.py", line 648, in build_animation
    InitGL( self.win_size[0] , self.win_size[1]  , ReSizeFun )
  File "C:\Users\2018069\PycharmProjects\pyparticles-0.3.5\pyparticles\animation\animated_ogl.py", line 68, in InitGL
    InitLight()
  File "C:\Users\2018069\PycharmProjects\pyparticles-0.3.5\pyparticles\animation\animated_ogl.py", line 88, in InitLight
    glLightfv(GL_LIGHT0, GL_AMBIENT,  light_ambient)
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\latebind.py", line 45, in __call__
    return self._finalCall( *args, **named )
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\wrapper.py", line 685, in wrapperCall
    pyArgs = tuple( calculate_pyArgs( args ))
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\wrapper.py", line 446, in calculate_pyArgs
    yield converter(args[index], self, args)
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\converters.py", line 135, in __call__
    return self.function( incoming )
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\arrays\arraydatatype.py", line 154, in asArray
    return cls.getHandler(value).asArray( value, typeCode or cls.typeConstant )
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\arrays\arraydatatype.py", line 47, in __call__
    handler = handler.load()
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\plugins.py", line 16, in load
    return importByName( self.import_path )
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\plugins.py", line 38, in importByName
    module = __import__( ".".join(moduleName), {}, {}, moduleName)
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\arrays\numpymodule.py", line 68, in <module>
    class NumpyHandler( formathandler.FormatHandler ):
  File "C:\Users\2018069\AppData\Local\Programs\Python\Python36-32\lib\site-packages\OpenGL\arrays\numpymodule.py", line 93, in NumpyHandler
    numpy.float128,
AttributeError: ("module 'numpy' has no attribute 'float128'", <OpenGL.converters.CallFuncPyConverter object at 0x087298B0>)

not exactly issue

Hi, fine?

I think your PyParticles very interesting. I want to study him deep.

Other Particles' projects using Python has a game approach. Yours have a science catch.

Could you help me tell something like what notes you read to get the basics concepts ?

sorry for the poor english and thanks for your attention and congratulations for your project

I didn't know how to enter in contact with you, so I post here. Sorry for any inconvenience.

List the dependencies needed to run PyParticles

I'm trying to run PyParticles, but keep hitting new dependencies needed.

It would really be a help if you either listed the dependencies in your README, or even better, created a requirements.txt for pip installation.

Strange type error

I'm using OS X 10.11.4
python2.7.11 from brew
PyOpenGL 3.1.0
Numpy 1.11.0

when I try the demo
it shows

Start the simulation example:
 3 body springs
/Users/Sequencer/Downloads/pyparticles-0.3.5/pyparticles/pset/particles_set.py:94: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  if self.__mass  != None :
2016-04-11 13:13:08.846 Python[96922:424457] GLUT Warning: glutInit being called a second time.
2016-04-11 13:13:08.869 Python[96922:424457] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/c6/655g9gg13xvfyxt8hhjjqfx80000gn/T/org.python.python.savedState
Traceback (most recent call last):
  File "./pyparticles_app", line 25, in <module>
    main.main()
  File "/Users/Sequencer/Downloads/pyparticles-0.3.5/pyparticles/main/main.py", line 127, in main
    spr.springs()
  File "/Users/Sequencer/Downloads/pyparticles-0.3.5/pyparticles/demo/springs.py", line 137, in springs
    a.build_animation()
  File "/Users/Sequencer/Downloads/pyparticles-0.3.5/pyparticles/animation/animated_ogl.py", line 651, in build_animation
    self.axis.ogl_init()
  File "/Users/Sequencer/Downloads/pyparticles-0.3.5/pyparticles/ogl/axis_ogl.py", line 39, in ogl_init
    self.draw_axis_procedure()
  File "/Users/Sequencer/Downloads/pyparticles-0.3.5/pyparticles/ogl/axis_ogl.py", line 56, in draw_axis_procedure
    self.draw_arrow( ( 1.0 , 0.0 , 0.0 ) , "x" )
  File "/Users/Sequencer/Downloads/pyparticles-0.3.5/pyparticles/ogl/axis_ogl.py", line 202, in draw_arrow
    glVertex3fv( pts[0] )
  File "latebind.pyx", line 32, in OpenGL_accelerate.latebind.LateBind.__call__ (src/latebind.c:989)
  File "wrapper.pyx", line 299, in OpenGL_accelerate.wrapper.Wrapper.__call__ (src/wrapper.c:6294)
  File "wrapper.pyx", line 161, in OpenGL_accelerate.wrapper.PyArgCalculator.c_call (src/wrapper.c:4241)
  File "wrapper.pyx", line 128, in OpenGL_accelerate.wrapper.PyArgCalculatorElement.c_call (src/wrapper.c:3601)
  File "wrapper.pyx", line 114, in OpenGL_accelerate.wrapper.PyArgCalculatorElement.c_call (src/wrapper.c:3409)
  File "arraydatatype.pyx", line 418, in OpenGL_accelerate.arraydatatype.AsArrayTypedSizeChecked.c_call (src/arraydatatype.c:8763)
  File "arraydatatype.pyx", line 174, in OpenGL_accelerate.arraydatatype.ArrayDatatype.asArray (src/arraydatatype.c:4221)
  File "arraydatatype.pyx", line 57, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_lookup (src/arraydatatype.c:2230)
TypeError: ("No array-type handler for type <class 'numpy.matrixlib.defmatrix.matrix'> (value: matrix([[ 0.],\n        [ 0.],\n        [ 0.]])) registered", None)
Exception TypeError: "'NoneType' object is not callable" in <bound method AxisOgl.__del__ of <pyparticles.ogl.axis_ogl.AxisOgl object at 0x109604f10>> ignored

numpy array none comparison

I just received an error by running the electromagnetic_demo.py

RESTART: E:\Documents\PyParticles\PyParticles\pyparticles\demo\electromagnetic_demo.py
Traceback (most recent call last):
File "E:\Documents\PyParticles\PyParticles\pyparticles\demo\electromagnetic_demo.py", line 128, in
electromag_field()
File "E:\Documents\PyParticles\PyParticles\pyparticles\demo\electromagnetic_demo.py", line 78, in electromag_field
elmag = elmf.ElectromagneticField( pset.size , dim=pset.dim , m=pset.M , q=pset.Q )
File "C:\Users\Raffael\AppData\Local\Programs\Python\Python37\lib\site-packages\pyparticles\forces\electromagnetic_field.py", line 55, in init
if m != None :
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

The problem seems to be the the electromagnetic_field.py. -> I just solved it by change line 55 from:
if m != None :
to:
if m is not None :
and the same on line 56...
from:
if q != None :
to:
if q is not None :

This works now fine.

By the way i am using python 3.7.2 and numpy version 1.16.0

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

edo@edo-HP-Pavilion-Laptop-14-ce0xxx:~/coding/particles$ pyparticles_app --test harmonic

Start a test simulation:
It compares the simulated solution with the analytical solution in a specific problem
Traceback (most recent call last):
File "/home/edo/anaconda3/bin/pyparticles_app", line 25, in
main.main()
File "/home/edo/anaconda3/lib/python3.8/site-packages/pyparticles/main/main.py", line 106, in main
tst.test( options.test )
File "/home/edo/anaconda3/lib/python3.8/site-packages/pyparticles/demo/test.py", line 33, in test
tst.build_animation()
File "/home/edo/anaconda3/lib/python3.8/site-packages/pyparticles/animation/test_animation.py", line 224, in build_animation
self.pset = ps.ParticlesSet( 2 , 3 )
File "/home/edo/anaconda3/lib/python3.8/site-packages/pyparticles/pset/particles_set.py", line 94, in init
if self.__mass != None :
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

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.