Skip to content

Commit

Permalink
Merge pull request #9 from kjhall01/kyle/3.2
Browse files Browse the repository at this point in the history
fixed ELM, bumped version, fixed regrid
  • Loading branch information
kjhall01 authored Dec 9, 2021
2 parents d1bace3 + df93680 commit c8fe5f3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package:
name: xcast
version: "0.3.1"
version: "0.3.2"

source:
url: https://github.com/kjhall01/xcast/archive/refs/tags/v0.3.1.tar.gz
url: https://github.com/kjhall01/xcast/archive/refs/tags/v0.3.2.tar.gz
build:
number: 0
string: xcast
Expand Down
2 changes: 1 addition & 1 deletion conda-recipe/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name = "xcast",
version = "0.3.0",
version = "0.3.2",
author = "Kyle Hall",
author_email = "kjhall@iri.columbia.edu",
description = ("High Performance Gridpoint-Wise Machine Learning for the Earth Sciences"),
Expand Down
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
warnings.filterwarnings("ignore")

Path('.xcast_worker_space').mkdir(exist_ok=True, parents=True)
__version__ = "0.2.8"
__version__ = "0.3.2"

def clear_cache():
if Path('.xcast_worker_space').is_dir():
Expand Down
2 changes: 2 additions & 0 deletions src/flat_estimators/regressors/elm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __init__(self, activation='sigm', hidden_layer_size=5, initialization='rando
self.preprocessing = preprocessing

def fit(self, x, y):
x, y = x.astype(np.float64), y.astype(np.float64)
# first, take care of preprocessing
if self.preprocessing == 'std':
self.mean, self.std = x.mean(axis=0), x.std(axis=0)
Expand Down Expand Up @@ -184,6 +185,7 @@ def fit(self, x, y):


def predict(self, x, preprocessing='asis'):
x = x.astype(np.float64)
# first, take care of preprocessing
if self.preprocessing == 'std' and preprocessing == 'asis':
x = (x - self.mean) / self.std # scales to std normal dist
Expand Down
2 changes: 1 addition & 1 deletion src/preprocessing/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def regrid(X, lons, lats, x_lat_dim=None, x_lon_dim=None, x_sample_dim=None, x_f
mask.coords[x_lon_dim] = lons
r = ret * mask
r.attrs['generated_by'] = attrs['generated_by'] + '\n XCAST regridded' if 'generated_by' in attrs.keys() else '\n XCAST regridded'

return r


def regrid_chunk(X, lats, lons, x_lat_dim=None, x_lon_dim=None, x_sample_dim=None, x_feature_dim=None, use_dask=False, hdf=None, feature_ndx=0, sample_ndx=0 ):
Expand Down

0 comments on commit c8fe5f3

Please sign in to comment.