GithubHelp home page GithubHelp logo

pygae / pyganja Goto Github PK

View Code? Open in Web Editor NEW
48.0 48.0 12.0 272 KB

Visualisation library for geometric algebra with cefpython and ganja.js

License: MIT License

Python 85.44% Jupyter Notebook 14.56%

pyganja's People

Contributors

arsenovic avatar enkimute avatar eric-wieser avatar hugohadfield avatar jakubkaras 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

Watchers

 avatar  avatar  avatar  avatar  avatar

pyganja's Issues

cefpython draw fails on windows

See pygae/clifford#85
Example error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "E:\projects\pyganja\pyganja\script_api.py", line 237, in draw
    render_scene_string_appropriately(str(sc))
  File "E:\projects\pyganja\pyganja\script_api.py", line 223, in render_scene_string_appropriately
    render_cef_script(scene_string, sig=sig, grid=grid, scale=scale, gl=gl)
  File "E:\projects\pyganja\pyganja\script_api.py", line 185, in render_cef_script
    p.start()
  File "E:\Miniconda3\envs\py3\lib\multiprocessing\process.py", line 105, in start
    self._popen = self._Popen(self)
  File "E:\Miniconda3\envs\py3\lib\multiprocessing\context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "E:\Miniconda3\envs\py3\lib\multiprocessing\context.py", line 322, in _Popen
    return Popen(process_obj)
  File "E:\Miniconda3\envs\py3\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
    reduction.dump(process_obj, to_child)
  File "E:\Miniconda3\envs\py3\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'render_cef_script.<locals>.render_script'
>>> Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "E:\Miniconda3\envs\py3\lib\multiprocessing\spawn.py", line 105, in spawn_main
    exitcode = _main(fd)
  File "E:\Miniconda3\envs\py3\lib\multiprocessing\spawn.py", line 115, in _main
    self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

Error in 0.0.4 on PyPI

Works locally, but when installed via PyPI gives:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\wiese\\AppData\\Roaming\\Python\\Python35\\site-packages\\pyganja/static/ganja.js/ganja.js'

bug in __repr__ dunder from GanjaScene class

>>> from pyganja import *
/usr/lib/python3/dist-packages/bpython/curtsiesfrontend/repl.py:251: UserWarning: Failed to import cef_gui, cef functions will be unavailable
  module = self.loader.load_module(name)
>>> gs = GanjaScene()
>>> gs
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    gs
  File "/usr/local/lib/python3.6/dist-packages/pyganja/GanjaScene.py", line 105, in __repr__
    new_str = str.replace(new_str, ']}', """].map(x=>x.length=="""+str(self.mv_length)+"""?new Element(x):x)}""")
AttributeError: 'GanjaScene' object has no attribute 'mv_length'

Drawing fails on Google Colab

I used the follow in Google colab notebook

!pip install clifford
!pip install pyganja
from clifford.tools.g3c import random_line
from pyganja import *

draw([random_line() for i in range(10)])

And I get the follow error

/usr/local/lib/python3.6/dist-packages/pyganja/__init__.py:2: UserWarning: Failed to import cef_gui, cef functions will be unavailable
  from .script_api import *
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-a7564f120d39> in <module>()
      2 from pyganja import *
      3 
----> 4 draw([random_line() for i in range(10)])

3 frames
/usr/local/lib/python3.6/dist-packages/pyganja/script_api.py in _to_scene_string(objects)
    256     if isinstance(objects, list):
    257         sc = GanjaScene()
--> 258         sc.add_objects(objects, color=color, static=static)
    259         return str(sc)
    260     elif isinstance(objects, str):

NameError: name 'color' is not defined

Add browser control option

In the case that a user does not have jupyter or cefpython we should simply generate html and point the users browser to that html

pyganja in Jupyterlab - by ext only?

Finding pyganja works superbly in Jupyter notebooks,
but Jupyterlab places restriction against unmediated javascript.
Option is to write an extension, but thought to ask if you
have recommendation in this direction.
Thank you for your incredibly good work!
-ae-

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.