Skip to content

Commit

Permalink
Merge pull request #24 from ocefpaf/run_test_win
Browse files Browse the repository at this point in the history
Run test win
  • Loading branch information
kwilcox authored Apr 2, 2017
2 parents 1d16280 + 0dcb49c commit f8b9c2c
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 37 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
global:
secure: "n2fDU3WQjw781S8p1qUVAOIbNay991tk0LiiKZkYPJFUxEUT23yA11i/XODKRdoCuLS7gNfBb1P9QWNXQ9liHIRFzCbYRBRvUseHnkAraTBg3Wq2dDikheUQO82S5TMlttmCXJHaqQLdK3YxBqJdc2FitzxqD0/qn9sSmbfTD5MCAymcFWtqRrLyb4PbnmlJvL2EgFQI9AaZq59WDwo04Gw+tDvBn7krb9HQ8ATzw+YVgIO65xk6TXMPqg0NAnkPmYBf4E39ewyeBvPGbgngvk47zWxQ2GO18Au095P+dk6mykmtjsEf68XrobF+bZyz4Em0IcTP8pGeuvkgRhFysNUiW9KXH+UfhIv9MU1Fx4Q/229d2jPYy0xD6IvG9JW9m7bZmBUp6to7uqDnfxnrlxmTKf7CN/M0qpFSIyqXZEfNye4LlvnTOBJh5XkfZnBHLpwptacMlS5m1pjOWYbSUSGUDebqtQTBDaF7g8EcXMkUKw6nMXE1uTvDM7kcSvBNBaVQh5ammZLn2y6rqfZR0NK9vyGGfl1N+axe+U48iRpFBDs3Pq/IeSWvPVajbpR/kIjstu9ybu6qQPq1BlozvbPEuVGNUAja1jAWP/v3YNbJtWl2bWviyLw7/NWC5W95TPLLFUP1p6nqf3AkiZPjpAVmhC2lY1R9CfotSXD0Bo0="

install:
before_install:
# Install miniconda
# -----------------
- export CONDA_BASE=http://repo.continuum.io/miniconda/Miniconda
Expand Down Expand Up @@ -49,6 +49,10 @@ install:
- conda install --file requirements.txt --file pocean/tests/requirements.txt
- conda list --export

# Test source distribution.
install:
- python setup.py sdist && version=$(python setup.py --version) && pushd dist && pip install pocean-core-${version}.tar.gz && popd

script:
- set -e

Expand All @@ -57,8 +61,5 @@ script:
fi

- if [[ $TEST_TARGET == "docs" ]]; then
conda install -n root conda-build anaconda-client ;
conda build conda-recipe --python $TRAVIS_PYTHON_VERSION ;
conda install pocean-core --use-local ;
./docs/deploy.sh ;
fi
1 change: 1 addition & 0 deletions MANIFST.in → MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include *.txt
include README.md
include VERSION
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# 🌐 pocean-core

[![Build Status](https://travis-ci.org/pyoceans/pocean-core.svg?branch=master)](https://travis-ci.org/pyoceans/pocean-core) [![license](https://img.shields.io/github/license/pyoceans/pocean-core.svg)](https://github.com/pyoceans/pocean-core/blob/master/LICENSE.txt) [![GitHub release](https://img.shields.io/github/release/pyoceans/pocean-core.svg)]()
[![Build Status](https://travis-ci.org/pyoceans/pocean-core.svg?branch=master)](https://travis-ci.org/pyoceans/pocean-core)
[![Build status](https://ci.appveyor.com/api/projects/status/gds2iavceg5unj0a?svg=true)](https://ci.appveyor.com/project/ocefpaf/pocean-core)
[![license](https://img.shields.io/github/license/pyoceans/pocean-core.svg)](https://github.com/pyoceans/pocean-core/blob/master/LICENSE.txt)
[![GitHub release](https://img.shields.io/github/release/pyoceans/pocean-core.svg)]()

🐍 + 🌊

Expand Down
58 changes: 32 additions & 26 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
package:
name: pocean-core
version: "1.0.0"
name: pocean-core
version: "1.0.0"

source:
path: ../
path: ../

build:
number: 0
script: python setup.py install --single-version-externally-managed --record=record.txt
number: 0
script: python setup.py install --single-version-externally-managed --record=record.txt

requirements:
build:
- python
- setuptools
run:
- python
- numpy
- pytz
- python-dateutil
- netcdf4
- pandas
- pygc
- simplejson
- shapely
build:
- python
- setuptools
run:
- python
- numpy
- pytz
- python-dateutil
- netcdf4
- pandas
- pygc
- simplejson
- shapely

test:
imports:
- pocean
- pocean.dsg
- pocean.grid
- pocean.tests
source_files:
- pocean
requires:
- pytest
imports:
- pocean
- pocean.dsg
- pocean.grid
- pocean.tests
commands:
- py.test -s -rxs -v pocean

about:
home: https://github.com/axiom-data-science/pocean-core
license: MIT License
summary: 'A python framework for working with met-ocean data.'
home: https://github.com/axiom-data-science/pocean-core
license: MIT
summary: 'A python framework for working with met-ocean data.'
2 changes: 1 addition & 1 deletion pocean/dsg/trajectoryProfile/cr.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def to_dataframe(self, clean_cols=True, clean_rows=True):
for i in np.arange(profile_indexes.size):
ei = si + o_index_var[i]
p[si:ei] = profile_indexes[i]
r[si:ei] = traj_indexes[r_index_var[i]]
r[si:ei] = np.array(traj_indexes[r_index_var[i]])
t[si:ei] = tvar[i]
x[si:ei] = xvar[i]
y[si:ei] = yvar[i]
Expand Down
5 changes: 3 additions & 2 deletions pocean/tests/dsg/timeseries/test_timeseries_om.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ def test_omp_load(self):
OrthogonalMultidimensionalTimeseries(self.single).close()

def test_omp_dataframe(self):
single_tmp = tempfile.mkstemp(suffix='.nc')[-1]
fid, single_tmp = tempfile.mkstemp(suffix='.nc')
with OrthogonalMultidimensionalTimeseries(self.single) as s:
df = s.to_dataframe()
nc = OrthogonalMultidimensionalTimeseries.from_dataframe(df, single_tmp)
nc.close()
logger.info(single_tmp)
#os.remove(single_tmp)
os.close(fid)
os.remove(single_tmp)

# def test_omp_calculated_metadata(self):
# with OrthogonalMultidimensionalTimeseries(self.single) as ncd:
Expand Down
6 changes: 4 additions & 2 deletions pocean/tests/dsg/trajectory/test_trajectory_im.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ def test_imt_load(self):
IncompleteMultidimensionalTrajectory(self.multi).close()

def test_imt_dataframe(self):
single_tmp = tempfile.mkstemp(suffix='.nc')[-1]
fid, single_tmp = tempfile.mkstemp(suffix='.nc')
with IncompleteMultidimensionalTrajectory(self.single) as ncd:
single_df = ncd.to_dataframe(clean_rows=False)
single_nc = IncompleteMultidimensionalTrajectory.from_dataframe(single_df, single_tmp)
single_nc.close()
os.close(fid)
os.remove(single_tmp)

multip_tmp = tempfile.mkstemp(suffix='.nc')[-1]
fid, multip_tmp = tempfile.mkstemp(suffix='.nc')
with IncompleteMultidimensionalTrajectory(self.multi) as ncd:
multip_df = ncd.to_dataframe(clean_rows=False)
multip_nc = IncompleteMultidimensionalTrajectory.from_dataframe(multip_df, multip_tmp)
multip_nc.close()
os.close(fid)
os.remove(multip_tmp)

def test_imt_calculated_metadata(self):
Expand Down
3 changes: 2 additions & 1 deletion pocean/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_multiple_attr_filter(self):

def test_generic_masked_bad_min_max_value(self):

_, tpath = tempfile.mkstemp(suffix='.nc', prefix='pocean-test')
fid, tpath = tempfile.mkstemp(suffix='.nc', prefix='pocean-test')
shutil.copy2(self.input_file, tpath)

with EnhancedDataset(tpath, 'a') as ncd:
Expand Down Expand Up @@ -85,6 +85,7 @@ def test_generic_masked_bad_min_max_value(self):
r = generic_masked(c[:], attrs=ncd.vatts(c.name))
assert np.all(r.mask == False) # noqa

os.close(fid)
if os.path.exists(tpath):
os.remove(tpath)

Expand Down

0 comments on commit f8b9c2c

Please sign in to comment.