Skip to content

Commit

Permalink
Merge pull request #160 from wpreimes/master
Browse files Browse the repository at this point in the history
Change naming convention for Intercomparison metrics calculator results. Use kdtree from pykdtree instead of scipy (faster). Add MetadataMetrics to metrics calculator. Remove pybufr-ecmwf, use generic test data for testing spatial resampling.
  • Loading branch information
tracyscanlon authored Sep 6, 2019
2 parents 00cf9f9 + ed6146a commit d5c24cb
Show file tree
Hide file tree
Showing 17 changed files with 578 additions and 187 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ MANIFEST

# ignore ISMN metadata files as they are different on win/linux
*/python_metadata/*

local_scripts/*
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ install:
# Useful for debugging any issues with conda
- conda info -a

- conda create -q -n test-environment -c conda-forge python=$TRAVIS_PYTHON_VERSION numpy scipy pandas netCDF4 cython pytest pip matplotlib pykdtree pyresample cartopy xarray
- conda create -q -n test-environment -c conda-forge python=$TRAVIS_PYTHON_VERSION
- conda env update -n test-environment -f environment.yml
- source activate test-environment
- pip install pybufr-ecmwf
- pip install pygeogrids
- pip install pygeobase
- pip install ascat
- pip install ismn
- python setup.py install
- pip list
- which pip
Expand Down
15 changes: 13 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
v0.7.0, 2019-05-15
===================
unreleased
==========
-

v0.7.1, 2019-09-03
==================
- Change naming convention for Intercomparison metrics calculator results
- Use kdtree from pykdtree instead of scipy (faster)
- Add MetadataMetrics to metrics calculator
- Remove pybufr-ecmwf, use generic test data for testing spatial resampling

v0.7.0, 2019-05-15
==================

- Add option for filling no data values to moving average
- Add option for minimum observations to moving average
Expand Down
27 changes: 27 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# List of conda and pip packages that are should be install when developing the packages
# To create the full conda environment: conda env create -f environment.yml
name: pytesmo
channels:
- conda-forge
- defaults
dependencies:
- numpy
- scipy
- pandas
- netCDF4
- cython
- matplotlib
- pykdtree
- pyresample
- cartopy
- pip
- pip:
- pynetcf
- pygeogrids
- pynetcf
- pygeobase
- ascat
- ismn
- pytest
- configparser
- more_itertools
1 change: 0 additions & 1 deletion optional_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pybufr-ecmwf>=0.80
pygrib>=1.9.9
pykdtree>=0.2
pyresample>=1.0
Expand Down
Empty file modified pytesmo/io/bufr/__init__.py
100755 → 100644
Empty file.
Empty file modified pytesmo/io/bufr/bufr.py
100755 → 100644
Empty file.
Empty file modified pytesmo/io/dataset_base.py
100755 → 100644
Empty file.
Empty file modified pytesmo/io/sat/ers.py
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions pytesmo/temporal_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import numpy as np
from scipy.spatial import cKDTree
from pykdtree.kdtree import KDTree

import pandas as pd

Expand Down Expand Up @@ -60,11 +60,11 @@ def df_match(reference, *args, **kwds):
values = np.arange(comp_step.size)
# setup kdtree which must get 2D input
try:
tree = cKDTree(np.atleast_2d(comp_step).T, balanced_tree=False)
tree = KDTree(np.atleast_2d(comp_step).T, balanced_tree=False)
except TypeError:
# scipy before version 0.16 does not have the balanced_tree kw
# but is fast in this case also without it
tree = cKDTree(np.atleast_2d(comp_step).T)
tree = KDTree(np.atleast_2d(comp_step).T)

dist, i = tree.query(np.atleast_2d(ref_step).T)
matched = values[i]
Expand Down
Loading

0 comments on commit d5c24cb

Please sign in to comment.