-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into interactive_tutorial
Conflicts: .gitignore tox.ini
- Loading branch information
Showing
95 changed files
with
724 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,5 @@ coverage.xml | |
htmlcov | ||
junit*.xml | ||
.ropeproject | ||
docs/_templates/logo.png | ||
zasim/idle.png | ||
build/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.. _screenshot_gallery: | ||
|
||
Screenshot gallery | ||
================== | ||
|
||
.. figure:: gallery/zasim_gallery_1.png | ||
:alt: Running a four-color one-dimensional CA | ||
|
||
Running a four-color one-dimensional CA with a histogram, activity chart and the basic rule editor open. | ||
|
||
|
||
.. figure:: gallery/zasim_gallery_2.png | ||
:alt: Running Conway's Game of Life | ||
|
||
Running Conway's Game of Life. | ||
|
||
|
||
.. figure:: gallery/zasim_gallery_3.png | ||
:alt: Game of Life with nondeterministic step function | ||
|
||
Running Game of Life with a nondeterministic step function gives mazes/noodles. | ||
|
||
.. figure:: gallery/zasim_gallery_4.png | ||
:alt: zasim in the interactive ipython qtconsole | ||
|
||
Using the ipython qtconsole, you can display configurations inline. | ||
|
||
.. figure:: gallery/zasim_gallery_5.png | ||
:alt: zasim gui elements in the interactive ipython qtconsole | ||
|
||
IPythons magic `%gui qt` command will run an event loop allowing us to use qt widgets like the ones zasim offers at the same time as running code. | ||
|
||
.. figure:: gallery/zasim_gallery_6.png | ||
:alt: Interactive tutorial | ||
|
||
Zasim comes with a IPython notebook based interactive tutorial. | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# make py.test use coredumps. | ||
|
||
def pytest_sessionstart(*args, **kwargs): | ||
import resource | ||
resource.setrlimit(resource.RLIMIT_CORE, (-1, -1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
try: | ||
from PySide.QtCore import * | ||
from PySide.QtGui import * | ||
from PySide.QtTest import * | ||
|
||
app = qApp or QApplication([]) | ||
HAVE_QT = True | ||
except ImportError: | ||
HAVE_QT = False | ||
|
||
if HAVE_QT: | ||
from zasim.display.qt import * | ||
from zasim.config import * | ||
from zasim.cagen import jvn | ||
|
||
import pytest | ||
|
||
import numpy as np | ||
|
||
import sys | ||
import signal | ||
import traceback | ||
|
||
_exceptions = [] | ||
def my_except_hook(cls, instance, traceback): | ||
print "oh god, an exception!" | ||
print cls | ||
print instance | ||
print traceback | ||
traceback.print_exception(cls, instance, traceback) | ||
_exceptions.append((cls, instance, traceback)) | ||
|
||
_aborts = [] | ||
def my_abort_hook(): | ||
print "oh god, sigabort!" | ||
print traceback.print_stack() | ||
_aborts.append(True) | ||
|
||
def fail_on_exceptions(): | ||
exc = _exceptions[:] | ||
[_exceptions.remove(a) for a in exc] | ||
aborts = _aborts[:] | ||
[_aborts.remove(a) for a in aborts] | ||
if exc: | ||
pytest.fail("There were exceptions in the base.\n%s" % (exc[0])) | ||
if aborts: | ||
pytest.fail("There were abort signals in the tests.") | ||
|
||
def setup_module(): | ||
sys.excepthook = my_except_hook | ||
signal.signal(signal.SIGABRT, my_abort_hook) | ||
|
||
def teardown_module(): | ||
sys.excepthook = sys.__excepthook__ | ||
signal.signal(signal.SIGABRT, signal.SIG_DFL) | ||
|
||
@pytest.mark.skipif("not HAVE_QT") | ||
class TestDisplayQt: | ||
def test_tiled_display(self): | ||
test_conf = RandomInitialConfigurationFromPalette(jvn.states) | ||
conf = test_conf.generate((10, 10)) | ||
|
||
img = render_state_array_tiled(conf, jvn.PALETTE_JVN_IMAGE, jvn.PALETTE_JVN_RECT) | ||
|
||
img2 = render_state_array_tiled(conf, jvn.PALETTE_JVN_IMAGE, jvn.PALETTE_JVN_RECT,region=(2, 2, 6, 6)) | ||
|
||
def test_tiled_display_1d(self): | ||
test_conf = RandomInitialConfigurationFromPalette(jvn.states) | ||
conf = test_conf.generate((10,)) | ||
|
||
img = render_state_array_tiled(conf, jvn.PALETTE_JVN_IMAGE, jvn.PALETTE_JVN_RECT) | ||
img2 = render_state_array_tiled(conf, jvn.PALETTE_JVN_IMAGE, jvn.PALETTE_JVN_RECT,region=(2, 0, 6, 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.