Skip to content

Commit cf5d079

Browse files
committed
Added testing data.
1 parent 9434834 commit cf5d079

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
recursive-include cpex/data *.npz

cpex/data/test_cpex.npz

150 KB
Binary file not shown.

cpex/lattice.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
@author: cs17809
66
"""
7+
import os
78
import numpy as np
89
import matplotlib.pyplot as plt
910

@@ -50,6 +51,8 @@ def calc_lattice_tensor(self):
5051

5152

5253
if __name__ == '__main__':
53-
data = Lattice(r'C:\Users\cs17809\Dropbox\Projects\CPFE/test_cpex.npz')
54+
folder = os.path.join(os.path.dirname(__file__), r'data') # should be sub [0]
55+
fpath = os.path.join(folder, r'test_cpex.npz')
56+
data = Lattice(fpath)
5457
data.plot(x='strain', y='stress')
5558
# data.plot(x='lattice', y='stress')

cpex/test.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Aug 31 10:55:48 2019
4+
5+
@author: cs17809
6+
"""
7+
8+
from cpex.scrape import ScrapeODB
9+
import numpy as np
10+
11+
if __name__ == '__main__':
12+
data = ScrapeODB('/newhome/mi19356/chris_odb/chris_odb.odb')
13+
print(data.e.shape)
14+
np.savetxt('test_strain.txt', data.e[0], delimiter=',')
15+
data.save_cpex('test_cpex.npz')

0 commit comments

Comments
 (0)