Skip to content

Commit

Permalink
views module: make variables lowercase (convention)
Browse files Browse the repository at this point in the history
  • Loading branch information
willfurnass committed Feb 15, 2020
1 parent 3cd01ed commit 66fd423
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions mumot/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2781,8 +2781,8 @@ def _plot_bifurcation(self, _=None):

self._pyDSmodel.pars = paramDict

XDATA = [] # list of arrays containing the bifurcation-parameter data for bifurcation diagram data
YDATA = [] # list of arrays containing the state variable data (either one variable, or the sum or difference of the two SVs) for bifurcation diagram data
xdata = [] # list of arrays containing the bifurcation-parameter data for bifurcation diagram data
ydata = [] # list of arrays containing the state variable data (either one variable, or the sum or difference of the two SVs) for bifurcation diagram data

initDictList = []
self._pyDSmodel_ics = {}
Expand Down Expand Up @@ -2824,7 +2824,7 @@ def _plot_bifurcation(self, _=None):
sPoints_X = [] # bifurcation parameter
sPoints_Y = [] # stateVarBif1
sPoints_Labels = []
EIGENVALUES = []
eigenvalues = []
sPoints_Z = [] # stateVarBif2
k_iter_BPlabel = 0
k_iter_LPlabel = 0
Expand Down Expand Up @@ -2891,20 +2891,20 @@ def _plot_bifurcation(self, _=None):
# pyDScont['EQ' + str(EQ_iter)].info()
if self._stateVarBif2 is not None:
try:
XDATA.append(pyDScont['EQ' + str(EQ_iter)].sol[self._bifurcationParameterPyDS])
xdata.append(pyDScont['EQ' + str(EQ_iter)].sol[self._bifurcationParameterPyDS])
if self._SVoperation:
if self._SVoperation == '-':
YDATA.append(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1] -
ydata.append(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1] -
pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif2])
elif self._SVoperation == '+':
YDATA.append(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1] +
ydata.append(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1] +
pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif2])
else:
self._showErrorMessage("Only '+' and '-' are supported operations between state variables.")
else:
YDATA.append(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1])
ydata.append(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1])

EIGENVALUES.append(np.array([pyDScont['EQ' + str(EQ_iter)].sol[kk].labels['EP']['data'].evals
eigenvalues.append(np.array([pyDScont['EQ' + str(EQ_iter)].sol[kk].labels['EP']['data'].evals
for kk in range(len(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1]))]))

while pyDScont['EQ' + str(EQ_iter)].getSpecialPoint('LP' + str(k_iter_LP)):
Expand Down Expand Up @@ -2963,20 +2963,20 @@ def _plot_bifurcation(self, _=None):
self._show_computation_stop()
self._showErrorMessage('Division by zero<br>')

XDATA.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._bifurcationParameterPyDS])
xdata.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._bifurcationParameterPyDS])
if self._SVoperation:
if self._SVoperation == '-':
YDATA.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1] -
ydata.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1] -
pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif2])
elif self._SVoperation == '+':
YDATA.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1] +
ydata.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1] +
pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif2])
else:
self._showErrorMessage('Only \' +\' and \'-\' are supported operations between state variables.')
else:
YDATA.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1])
ydata.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1])

EIGENVALUES.append(np.array([pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[kk].labels['EP']['data'].evals
eigenvalues.append(np.array([pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[kk].labels['EP']['data'].evals
for kk in range(len(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1]))]))
while pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].getSpecialPoint('BP' + str(k_iter_next)):
if (round(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].getSpecialPoint('BP' + str(k_iter_next))[self._bifurcationParameterPyDS], 4)
Expand Down Expand Up @@ -3014,10 +3014,10 @@ def _plot_bifurcation(self, _=None):
# Bifurcation routine for 1D system
else:
try:
XDATA.append(pyDScont['EQ' + str(EQ_iter)].sol[self._bifurcationParameterPyDS])
YDATA.append(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1])
xdata.append(pyDScont['EQ' + str(EQ_iter)].sol[self._bifurcationParameterPyDS])
ydata.append(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1])

EIGENVALUES.append(np.array([pyDScont['EQ' + str(EQ_iter)].sol[kk].labels['EP']['data'].evals
eigenvalues.append(np.array([pyDScont['EQ' + str(EQ_iter)].sol[kk].labels['EP']['data'].evals
for kk in range(len(pyDScont['EQ' + str(EQ_iter)].sol[self._stateVarBif1]))]))

while pyDScont['EQ' + str(EQ_iter)].getSpecialPoint('LP' + str(k_iter_LP)):
Expand Down Expand Up @@ -3076,10 +3076,10 @@ def _plot_bifurcation(self, _=None):
self._show_computation_stop()
self._showErrorMessage('Division by zero<br>')

XDATA.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._bifurcationParameterPyDS])
YDATA.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1])
xdata.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._bifurcationParameterPyDS])
ydata.append(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1])

EIGENVALUES.append(np.array([pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[kk].labels['EP']['data'].evals
eigenvalues.append(np.array([pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[kk].labels['EP']['data'].evals
for kk in range(len(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].sol[self._stateVarBif1]))]))
while pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].getSpecialPoint('BP' + str(k_iter_next)):
if (round(pyDScont['EQ' + str(EQ_iter) + 'BP' + str(EQ_iter_BP)].getSpecialPoint('BP' + str(k_iter_next))[self._bifurcationParameterPyDS], 4)
Expand Down Expand Up @@ -3134,18 +3134,18 @@ def _plot_bifurcation(self, _=None):
if self._mumotModel._systemSize:
self._chooseYrange = [-self._getSystemSize(), self._getSystemSize()]

if XDATA != [] and self._chooseXrange is None:
xmaxbif = np.max([np.max(XDATA[kk]) for kk in range(len(XDATA))])
if xdata != [] and self._chooseXrange is None:
xmaxbif = np.max([np.max(xdata[kk]) for kk in range(len(xdata))])
self._chooseXrange = [0, xmaxbif]

if XDATA != [] and YDATA != []:
if xdata != [] and ydata != []:
# plt.clf()
_fig_formatting_2D(xdata=XDATA,
ydata=YDATA,
_fig_formatting_2D(xdata=xdata,
ydata=ydata,
xlab=self._LabelX,
ylab=self._LabelY,
specialPoints=specialPoints,
eigenvalues=EIGENVALUES,
eigenvalues=eigenvalues,
choose_xrange=self._chooseXrange, choose_yrange=self._chooseYrange,
ax_reformat=False, curve_replot=False, fontsize=self._chooseFontSize)

Expand Down

0 comments on commit 66fd423

Please sign in to comment.