-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from greole/0.6
0.6
- Loading branch information
Showing
5 changed files
with
180 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,7 @@ language: python | |
python: | ||
- 2.7 | ||
install: | ||
- python setup.py install --user | ||
- pip install . | ||
|
||
script: | ||
py.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import os | ||
|
||
basepath = os.getcwd() + "/examples/buoyantCavity" | ||
setspath = basepath + "/sets" | ||
|
||
|
||
setsfiles = ['y0.1_T.xy', 'y0.1_U.xy', 'y0.2_T.xy', 'y0.2_U.xy', 'y0.3_T.xy', 'y0.3_U.xy', 'y0.4_T.xy', 'y0.4_U.xy', 'y0.5_T.xy', 'y0.5_U.xy', 'y0.6_T.xy', 'y0.6_U.xy', 'y0.7_T.xy', 'y0.7_U.xy', 'y0.8_T.xy', 'y0.8_U.xy', 'y0.9_T.xy', 'y0.9_U.xy'] | ||
|
||
basefiles = ['T', 'U', 'alphat', 'k', 'mut', 'omega', 'p', 'p_rgh', 'phi'] | ||
|
||
def test_imports(): | ||
""" are the main modules importable """ | ||
from Owls import io | ||
from Owls import frames | ||
|
||
# def test_find_times(): | ||
# import Owls as ow | ||
# ow.read_sets(folder=basepath) | ||
|
||
def test_findtimes(): | ||
""" are all times and times in sets found """ | ||
from Owls import io | ||
def contains_all(res): | ||
times = [str(_*50) for _ in range(21)] | ||
return all([time in res for time in times]) | ||
|
||
assert contains_all(io.find_times(fold=basepath)) | ||
assert contains_all(io.find_times(fold=setspath)) | ||
|
||
def test_findDataFiles(): | ||
""" are all files in the the sets and times folder are found """ | ||
from Owls import io | ||
read_folder = lambda x=False,filt=False: [path.replace(x,'') for path in io._get_datafiles_from_dir(x, filt)] | ||
setsfolder = setspath + "/1000/" | ||
basefolder = basepath + "/1000/" | ||
datafilessets = read_folder(setsfolder) | ||
datafilesbase = read_folder(basefolder) | ||
assert setsfiles == datafilessets | ||
assert basefiles == datafilesbase | ||
for fn in basefiles: | ||
# print read_folder(basefolder,fn) | ||
assert [fn] == read_folder(basefolder,[fn]) |