Skip to content

Commit

Permalink
Merge pull request #32 from CDAT/new_license
Browse files Browse the repository at this point in the history
added license moved recipe into repo
  • Loading branch information
doutriaux1 committed Nov 12, 2018
2 parents fe08f16 + a1d8f24 commit 3bd6383
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 145 deletions.
19 changes: 8 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ aliases:
export USER=cdat
export VERSION=8.0
export LABEL=nightly
python ./prep_for_build.py -l $VERSION
if [[ $PY_VER = 'py2' ]]; then
conda build $PKG_NAME $CHANNELS
else
conda build $PKG_NAME $CHANNELS --python=3.6
if [[ -d $PKG_NAME ]]; then
rm -rf $PKG_NAME
fi
anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l $LABEL $CONDA_BLD_PATH/$OS/$PKG_NAME-$VERSION.`date +%Y*`0.tar.bz2 --force
ln -s ../recipe $PKG_NAME
python ./prep_for_build.py -l $VERSION
conda build $PKG_NAME $CHANNELS
anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l $LABEL $CONDA_BLD_PATH/noarch/$PKG_NAME-$VERSION.`date +%Y*`0.tar.bz2 --force
- &run_coveralls
name: run_coveralls
Expand All @@ -98,7 +98,6 @@ jobs:
- run: *create_conda_env
- run: *setup_cdutil
- run: *run_cdutil_tests
- run: *conda_upload
- store_artifacts:
path: tests_html
destination: tests_html
Expand All @@ -116,7 +115,6 @@ jobs:
- run: *create_conda_env
- run: *setup_cdutil
- run: *run_cdutil_tests
- run: *conda_upload
- store_artifacts:
path: tests_html
destination: tests_html
Expand All @@ -134,7 +132,6 @@ jobs:
- run: *create_conda_env
- run: *setup_cdutil
- run: *run_cdutil_tests
- run: *conda_upload
- store_artifacts:
path: tests_html
destination: tests_html
Expand All @@ -146,7 +143,7 @@ jobs:
WORKDIR: "workspace/test_linux_cdutil_py3"
OS: "linux-64"
PY_VER: "py3"
COVERAGE: "-c tests/coverage.json"
COVERAGE: "-c tests/coverage.json --coverage-from-egg"
steps:
- checkout
- run: *setup_miniconda
Expand Down Expand Up @@ -175,4 +172,4 @@ workflows:





51 changes: 0 additions & 51 deletions LEGAL.txt

This file was deleted.

66 changes: 0 additions & 66 deletions LICENSE

This file was deleted.

29 changes: 29 additions & 0 deletions bsd-3-clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2018, Lawrence Livermore National Security, LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions Lib/create_landsea_mask.py → cdutil/create_landsea_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import MV2
import os
import cdat_info
import pkg_resources

egg_path = pkg_resources.resource_filename(pkg_resources.Requirement.parse("cdutil"), "share/cdutil")


def create_surrounds(data):
Expand Down Expand Up @@ -199,9 +202,7 @@ def generateLandSeaMask(target, source=None, threshold_1=.2,
if source is None:
source = cdms2.open(
os.path.join(
cdat_info.get_prefix(),
'share',
'cdutil',
egg_path,
'navy_land.nc'))('sftlf')

try:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions Lib/sftbyrgn.py → cdutil/sftbyrgn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
import cdms2
import os
import cdat_info
import pkg_resources


egg_path = pkg_resources.resource_filename(pkg_resources.Requirement.parse("cdutil"), "share/cdutil")


def sumregions(potential_reg, potential):
Expand Down Expand Up @@ -85,9 +89,7 @@ def generateSurfaceTypeByRegionMask(mask, sftbyrgn=None, sftbyrgnmask=215, regio
if sftbyrgn is None:
sftbyrgn = cdms2.open(
os.path.join(
cdat_info.get_prefix(),
'share',
'cdutil',
egg_path,
'sftbyrgn.nc'))('sftbyrgn')

if regions is None:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions recipe/meta.yaml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package:
name: cdutil
version: @VERSION@

source:
git_rev: @UVCDAT_BRANCH@
git_url: git://github.com/CDAT/cdutil.git

build:
number: @BUILD_NUMBER@
noarch: python
script: python setup.py install

requirements:
build:
- python
- setuptools
run:
- python
- cdms2
- genutil

about:
home: http://github.com/CDAT/cdutil
summary: A set of tools to manipulate climate data
license: BSD
license_file: bsd-3-clause.txt

29 changes: 20 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
from distutils.core import setup
from setuptools import setup, find_packages
from subprocess import Popen, PIPE


Version = "8.0"
p = Popen(
("git",
"describe",
"--tags"),
stdin=PIPE,
stdout=PIPE,
stderr=PIPE)
try:
sys.path.append(os.environ['BUILD_DIR'])
import cdat_info
Version=cdat_info.Version
descr = p.stdout.readlines()[0].strip().decode("utf-8")
Version = "-".join(descr.split("-")[:-2])
if Version == "":
Version = descr
except:
Version="???"
descr = Version

setup (name = "cdutil",
author="PCMDI Software Team",
version=Version,
author="AIMS Software Team",
version=descr,
description = "Utilities for climate data manipulation",
url = "http://cdat.sourceforge.net",
packages = ['cdutil'],
package_dir = {'cdutil': 'Lib'},
packages = find_packages(),
data_files = [ ("share/cdutil",("data/sftbyrgn.nc","data/navy_land.nc","share/test_data_files.txt"))],
)

2 changes: 1 addition & 1 deletion tests/test_cdutil_flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def testFlake8(self):
print()
print()
print()
P = subprocess.Popen(shlex.split("flake8 --show-source --statistics --ignore=F999,F405,E121,E123,E126,E226,E24,E704 --max-line-length=120 %s" % pth),
P = subprocess.Popen(shlex.split("flake8 --show-source --statistics --ignore=F999,F405,E121,E123,E126,E226,E24,E704,W504 --max-line-length=120 %s" % pth),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_cdutil_gen_mask.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import cdms2,sys,cdutil,os,cdat_info
import unittest
import numpy
import pkg_resources
egg_path = pkg_resources.resource_filename(pkg_resources.Requirement.parse("cdutil"), "share/cdutil")

class CDUTIL(unittest.TestCase):
def testGenmask(self):

f=cdms2.open(os.path.join(sys.prefix,"share","cdutil","navy_land.nc"))
f=cdms2.open(os.path.join(egg_path, "navy_land.nc"))
navy_frac_one = f('sftlf')
g = navy_frac_one.getGrid()
print(("SOURCE GRID:",g))
Expand Down

0 comments on commit 3bd6383

Please sign in to comment.