Download pool/shard010/Python/0089337_testmigrations.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard010/Python/0089337_testmigrations.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard010/Python/0089337_testmigrations.py
-
curl -L -o 0089337_testmigrations.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard010/Python/0089337_testmigrations.py
1.05 kB
| """ | |
| 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) | |