-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtemp_example.py
50 lines (35 loc) · 1.31 KB
/
temp_example.py
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 13 00:47:21 2015
@author: Michael
"""
import numpy as np
import pandas as pd
import warnings
from six import StringIO
import json
from wcon import WCONWorms, MeasurementUnit
pd.set_option('display.expand_frame_repr', False)
# Suppress RuntimeWarning warnings in Spider because it's a known bug
# http://stackoverflow.com/questions/30519487/
# warnings.simplefilter(action = "ignore", category = RuntimeWarning)
if __name__ == '__main__':
JSON_path = '../../tests/minimax.wcon'
w2 = WCONWorms.load_from_file(JSON_path)
w2.save_to_file('example_saved_file.WCON', pretty_print=True)
w3 = WCONWorms.load_from_file('example_saved_file.WCON')
u = MeasurementUnit.create('cm')
# io=StringIO()
# json.dump([None], io)
# io.getvalue()
if __name__ == '__main__2':
worm_file_text2 = (('{"units":{"t":"s","x":"m","y":"m"},'
'"data":[{"id":3, "t":1.3, '
'"x":[3,4], "y":[5.4,3]}]}'))
w1 = WCONWorms.load(StringIO(worm_file_text2))
if __name__ == '__main__3':
w1 = WCONWorms.load(StringIO('{"units":{},'
'"data":[{"id":3, "t":1.3, '
'"x":[3,4,4,3.2], '
'"y":[5.4,3,1,-3]}]}'))