Skip to content

Commit

Permalink
Merge branch 'forMybinder'
Browse files Browse the repository at this point in the history
  • Loading branch information
terna committed Jul 22, 2017
2 parents 27d8d19 + 050fd0d commit b28c621
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@
import random
import os
from mActions import *
from turtle import *

try:
import tkinter # this is only a control, if tkinter is missing, we cannot
# import turtle
from turtle import *
except BaseException:
print("Warning, missing tkinter: Turle class will not work")



# structure for adding and eliminating tasks
common.addTasks = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
from Agent import *
from ActionGroup import *
from oActions import *
from Pen import *

try:
import tkinter # this is only a control, if tkinter is missing, we cannot
# import Pen
from Pen import *
except BaseException:
print("Warning, missing tkinter: Turle class will not work")

import penPosition
try:
import graphicDisplayGlobalVarAndFunctions as gvf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@


import os
import turtle

try:
import tkinter # this is only a control, if tkinter is missing, we cannot
# import turtle
from turtle import *
except BaseException:
print("Warning, missing tkinter: Turle class will not work")

#import turtle

# project='school' or 'production' # to run tests

Expand Down Expand Up @@ -57,7 +65,8 @@ def out_table(sh, book, f, rec): # !!!!!!!!!!
c +
1) +
"' missing")
turtle.bye() # does not create problems if the graphic space is missing
#turtle.bye() # does not create problems if the graphic space is missing
bye() # does not create problems if the graphic space is missing
os.sys.exit(1)
sh_macro = book.sheet_by_index(book.sheet_names()
.index(sh.cell_value(r, c + 1)))
Expand Down Expand Up @@ -100,7 +109,8 @@ def out_table(sh, book, f, rec): # !!!!!!!!!!
sh = book.sheet_by_index(0)
if book.sheet_names()[0] != "schedule":
print("Error, first sheet in schedule.txt has to be named 'schedule'")
turtle.bye()
#turtle.bye()
bye()
os.sys.exit(1)
out_table(sh, book, f, 1)
f.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ def graphicControl():
if IPython:
from IPython import get_ipython
import matplotlib
matplotlib.use("TkAgg")

try:
import tkinter # this is only a control, if tkinter is missing, the
# use("TkAgg") method will rise an error
matplotlib.use("TkAgg")
except BaseException:
print("Warning, missing tkinter: graphics will not work with")
print("Jupyter in terminal or QtConsole")

import matplotlib as mpl
import matplotlib.pyplot as plt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def runSLAPP():
global start_pyDir
print("\nSLAPP v3.0.1 build 20170607\n")
print("\nSLAPP v3.0.2 build 20170722\n")
import os

confirm = "n"
Expand Down
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,9 @@ We used the program [autopep8](https://pypi.python.org/pypi/autopep8) via termin
autopep8 --in-place -a -a <filename>

and a few handmade corrections

(2017 07 22)

3.0.2

adapting to work also without TkInter, in case with limitations, to run also online in [beta.mybinder.org](beta.mybinder.org), in the future simply [mybinder.org](mybinder.org)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ SLAPP <img src="./-pictures/slapp-logo.png" height="90" />

Swarm-Like Agent Protocol in Python (3)

Here you have SLAPP **3.0.1 build 20170607**, running in Python 3 (in the [SLAPP repository](http://terna.to.it/slapp_dep/) you have related material and very old versions; the 2.0.x versions are still related to Python 2).
Here you have SLAPP **3.0.2 build 20170722**, running in Python 3 (in the [SLAPP repository](http://terna.to.it/slapp_dep/) you have related material and very old versions; the 2.0.x versions are still related to Python 2).

We have here also a [**Reference Handbook**](https://github.com/terna/SLAPP3/blob/master/SLAPP_Reference_Handbook.pdf) (it is still a draft and has to be improved).
We have here also a [**Reference Handbook**](SLAPP_Reference_Handbook.pdf) (it is still a draft and has to be improved).

Five chapters of the book of Boero, R., Morini, M., Sonnessa, M., and Terna, P., [Agent-based Models of the Economy - From Theories to Applications](http://www.palgrave.com/page/detail/agentbased-models-of-the-economy-/?K=9781137339805), are related to SLAPP.

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
xlrd
matplotlib
networkx
pandas
scipy

0 comments on commit b28c621

Please sign in to comment.