File size: 1,049 Bytes
b2e2343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
Loads an old project version.

Version: 2017jan13
"""

import optima as op
from optima import tic, toc, blank, pd # analysis:ignore

## Options
tests = [
'basicmigration',
]

oldprojectname = 'concentrated_v2.0.4.prj' # Options are concentrated_v2.0.4.prj and concentrated_v2.1.prj

## Housekeeping

if 'doplot' not in locals(): doplot = True

def done(t=0):
    print('Done.')
    toc(t)
    blank()

blank()
print('Running tests:')
for i,test in enumerate(tests): print(('%i.  '+test) % (i+1))
blank()



##############################################################################
## The tests
##############################################################################

T = tic()

if 'basicmigration' in tests:
    
    # Figure out the path 
    import os
    optimapath = os.path.dirname(op.__file__)
    spreadsheetpath = os.path.join(optimapath, '..', 'tests', '') # Empty last part puts a /

    oldprojectfile = spreadsheetpath+oldprojectname
    P = op.loadproj(filename=oldprojectfile)
    P.runsim()
    if doplot: op.pygui(P)