ModelFlowIb 2.58__tar.gz → 2.60__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modelflowib-2.58 → modelflowib-2.60}/ModelFlowIb.egg-info/PKG-INFO +1 -1
- {modelflowib-2.58 → modelflowib-2.60}/PKG-INFO +1 -1
- {modelflowib-2.58 → modelflowib-2.60}/model_latex_class.py +9 -6
- {modelflowib-2.58 → modelflowib-2.60}/modelclass.py +17 -10
- {modelflowib-2.58 → modelflowib-2.60}/pyproject.toml +1 -1
- {modelflowib-2.58 → modelflowib-2.60}/ModelFlowIb.egg-info/SOURCES.txt +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/ModelFlowIb.egg-info/dependency_links.txt +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/ModelFlowIb.egg-info/requires.txt +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/ModelFlowIb.egg-info/top_level.txt +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelBLfunk.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/model_Excel.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/model_cvx.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/model_doable.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/model_dynare.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/model_financial_stability.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/model_ifrs9.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/model_latex.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/model_run_numba.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelclass2.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeldash.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeldashboot.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeldashsidebar.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeldekom.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeldiff.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeldisplay.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelfeedback.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelgrab.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelgrabwf2.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelhelp.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelinvert.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeljupyter.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeljupytermagic.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelmacrograb.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelmanipulation.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelmf.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelnet.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelnewton.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelnormalize.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelpattern.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelpatternrev.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelreport.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelsandbox.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelsandbox_Mixin.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeltodo.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeluserfunk.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modeluserfunk_old.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelvis.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelwidget.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelwidget_input.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/modelwidget_shinypy.py +0 -0
- {modelflowib-2.58 → modelflowib-2.60}/setup.cfg +0 -0
|
@@ -185,7 +185,7 @@ def defunk(funk, subs , streng,startp='{',slutp='}'):
|
|
|
185
185
|
def findindex(ind):
|
|
186
186
|
''' find the index variables on the left hand side. meaning variables braced by {} '''
|
|
187
187
|
lhs=ind.split('=')[0]
|
|
188
|
-
return re.findall('\{([A-Za-z][\w]*)\}',lhs ) # all the index variables
|
|
188
|
+
return re.findall(r'\{([A-Za-z][\w]*)\}',lhs ) # all the index variables
|
|
189
189
|
|
|
190
190
|
def doableold(ind,show=False):
|
|
191
191
|
''' find all dimensions in the left hand side of = and and decorate with the nessecary do .. enddo '''
|
|
@@ -230,7 +230,7 @@ def findallindex(ind0):
|
|
|
230
230
|
|
|
231
231
|
this function find frmlname and index variables on the left hand side. meaning variables braced by {} '''
|
|
232
232
|
if ind0.startswith('<'):
|
|
233
|
-
frmlname = re.findall('\<.*?\>',ind0)[0]
|
|
233
|
+
frmlname = re.findall(r'\<.*?\>',ind0)[0]
|
|
234
234
|
ind = ind0[ind0.index('>')+1:].strip()
|
|
235
235
|
else:
|
|
236
236
|
frmlname='<>'
|
|
@@ -247,7 +247,7 @@ def findallindex(ind0):
|
|
|
247
247
|
rest = ind.strip()
|
|
248
248
|
|
|
249
249
|
lhs=rest.split('=')[0]
|
|
250
|
-
do_indicies = re.findall('__\{([A-Za-z][\w]*)\}',lhs ) # all the index variables
|
|
250
|
+
do_indicies = re.findall(r'__\{([A-Za-z][\w]*)\}',lhs ) # all the index variables
|
|
251
251
|
|
|
252
252
|
do_indicies_dict = {ind : all_do_condition.get(ind) for ind in do_indicies}
|
|
253
253
|
|
|
@@ -406,8 +406,11 @@ Raises:
|
|
|
406
406
|
# r'\min':'min',
|
|
407
407
|
# r'\max':'max',
|
|
408
408
|
r'\rho':'rho',
|
|
409
|
+
r'\alpha':'alpha',
|
|
410
|
+
r'\beta':'beta',
|
|
409
411
|
r'\tau':'tau',
|
|
410
412
|
r'\sigma':'sigma',
|
|
413
|
+
r'\exp':'exp',
|
|
411
414
|
r'&':'',
|
|
412
415
|
r'\\':'',
|
|
413
416
|
r'\nonumber' : '',
|
|
@@ -443,12 +446,12 @@ Raises:
|
|
|
443
446
|
r'\s*\\times\s*':'*' ,
|
|
444
447
|
r'\s*\\cdot\s*':'*' ,
|
|
445
448
|
r'\\text{\[([\w+-,.]+)\]}' : r'[\1]',
|
|
446
|
-
r'\\sum_{('+pt.namepat+')}\(' : r'sum(\1,',
|
|
449
|
+
r'\\sum_{('+pt.namepat+r')}\(' : r'sum(\1,',
|
|
447
450
|
r"\\sum_{([a-zA-Z][a-zA-Z0-9_]*)=([a-zA-Z][a-zA-Z0-9_]*)}\(": r'sum(\1 \2=1,',
|
|
448
451
|
|
|
449
|
-
r'\\max_{('+pt.namepat+')}\(' : r'lmax(\1,',
|
|
452
|
+
r'\\max_{('+pt.namepat+r')}\(' : r'lmax(\1,',
|
|
450
453
|
r"\\max_{([a-zA-Z][a-zA-Z0-9_]*)=([a-zA-Z][a-zA-Z0-9_]*)}\(": r'lmax(\1 \2=1,',
|
|
451
|
-
r'\\min_{('+pt.namepat+')}\(' : r'lmin(\1,',
|
|
454
|
+
r'\\min_{('+pt.namepat+r')}\(' : r'lmin(\1,',
|
|
452
455
|
r"\\min_{([a-zA-Z][a-zA-Z0-9_]*)=([a-zA-Z][a-zA-Z0-9_]*)}\(": r'lmin(\1 \2=1,',
|
|
453
456
|
|
|
454
457
|
}
|
|
@@ -142,7 +142,7 @@ class BaseModel():
|
|
|
142
142
|
tabcomplete=True, previousbase=False, use_preorder=True, normalized=True,safeorder= False,
|
|
143
143
|
var_description={}, model_description = '',
|
|
144
144
|
var_groups = {}, reports = {}, equations_latex='',
|
|
145
|
-
eviews_dict = {},use_fbmin=
|
|
145
|
+
eviews_dict = {},use_fbmin= False,
|
|
146
146
|
substitution = {},
|
|
147
147
|
**kwargs):
|
|
148
148
|
''' initialize a model'''
|
|
@@ -2430,11 +2430,12 @@ class Dekomp_Mixin():
|
|
|
2430
2430
|
eksperiments = [(vt, t) for vt in sterms for t in calc_per]
|
|
2431
2431
|
if time_att:
|
|
2432
2432
|
...
|
|
2433
|
-
smallalt = altdf_.loc[:, vars].copy(deep=True) # for speed
|
|
2434
|
-
smallbase = smallalt.shift().copy() # for speed
|
|
2433
|
+
smallalt = altdf_.loc[:, vars].copy(deep=True).astype('float64') # for speed
|
|
2434
|
+
smallbase = smallalt.shift().copy().astype('float64') # for speed
|
|
2435
2435
|
else:
|
|
2436
|
-
smallalt = altdf_.loc[:, vars].copy(deep=True) # for speed
|
|
2437
|
-
smallbase = basedf_.loc[:, vars].copy(deep=True) # for speed
|
|
2436
|
+
smallalt = altdf_.loc[:, vars].copy(deep=True).astype('float64') # for speed
|
|
2437
|
+
smallbase = basedf_.loc[:, vars].copy(deep=True).astype('float64') # for speed
|
|
2438
|
+
# print(f'{smallalt.dtypes=}')
|
|
2438
2439
|
# make a dataframe for each experiment
|
|
2439
2440
|
alldf = {e: smallalt.copy() for e in eksperiments}
|
|
2440
2441
|
for e in eksperiments:
|
|
@@ -2489,7 +2490,8 @@ class Dekomp_Mixin():
|
|
|
2489
2490
|
|
|
2490
2491
|
# a dataframe with summaries of growth
|
|
2491
2492
|
diff_growth_index = diff_level.index[:-1]
|
|
2492
|
-
diff_growth = pd.DataFrame(index=diff_growth_index, columns=print_per)
|
|
2493
|
+
diff_growth = pd.DataFrame(0.0,index=diff_growth_index, columns=print_per)
|
|
2494
|
+
# print(diff_growth.dtypes)
|
|
2493
2495
|
diff_growth.loc[diff_growth.index[0],print_per] = smallbase.loc[:,varnavn].pct_change().loc[print_per] * 100.
|
|
2494
2496
|
diff_growth.loc[diff_growth.index[1],print_per] = smallalt.loc[:,varnavn].pct_change().loc[print_per] * 100.
|
|
2495
2497
|
diff_growth.loc[diff_growth.index[2],print_per] = (diff_growth.loc[diff_growth.index[1],print_per]-
|
|
@@ -3424,14 +3426,16 @@ class Graph_Mixin():
|
|
|
3424
3426
|
this = self.endograph.copy()
|
|
3425
3427
|
|
|
3426
3428
|
while True:
|
|
3427
|
-
new = [v for v, indegree in this.in_degree() if indegree == 0]
|
|
3429
|
+
new = sorted( [v for v, indegree in this.in_degree() if indegree == 0])
|
|
3428
3430
|
if len(new) == 0:
|
|
3429
3431
|
break
|
|
3432
|
+
# print(f'new = {new}')
|
|
3430
3433
|
self._prevar = self._prevar+new
|
|
3431
3434
|
this.remove_nodes_from(new)
|
|
3432
|
-
|
|
3435
|
+
# print(f'self._prevar = {self._prevar}')
|
|
3436
|
+
|
|
3433
3437
|
while True:
|
|
3434
|
-
new = [v for v, outdegree in this.out_degree() if outdegree == 0]
|
|
3438
|
+
new = sorted([v for v, outdegree in this.out_degree() if outdegree == 0])
|
|
3435
3439
|
if len(new) == 0:
|
|
3436
3440
|
break
|
|
3437
3441
|
self._epivar = new + self._epivar
|
|
@@ -3476,7 +3480,10 @@ class Graph_Mixin():
|
|
|
3476
3480
|
self.fbaut = {k:v for k,v in sorted( a.items(), key=lambda x: x[1], reverse=True)}
|
|
3477
3481
|
|
|
3478
3482
|
self.fblist = [v for v in self.fbhubs.keys()]
|
|
3479
|
-
except:
|
|
3483
|
+
except Exception as e:
|
|
3484
|
+
if self.use_fbmin:
|
|
3485
|
+
|
|
3486
|
+
print(f'In minimum feedback order {e} ')
|
|
3480
3487
|
...
|
|
3481
3488
|
if self.use_fbmin:
|
|
3482
3489
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|