Skip to content

Commit a349d81

Browse files
committed
Removed unnecessary xr_engine parameter
1 parent 88f7efd commit a349d81

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

cesium_app/handlers/feature.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ def post(self):
9797
computed_fset = executor.submit(featurize.assemble_featureset,
9898
all_features, all_time_series)
9999
imputed_fset = executor.submit(featureset.Featureset.impute, computed_fset)
100-
future = executor.submit(xr.Dataset.to_netcdf, imputed_fset,
101-
fset_path, engine=cfg['xr_engine'])
100+
future = executor.submit(xr.Dataset.to_netcdf, imputed_fset, fset_path)
102101
fset.task_id = future.key
103102
fset.save()
104103

cesium_app/handlers/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def _build_model_compute_statistics(fset_path, model_type, model_params,
5757
`params_to_optimize` is None or is an empty dict, this will be an empty
5858
dict.
5959
'''
60-
fset = featureset.from_netcdf(fset_path, engine=cfg['xr_engine'])
60+
fset = featureset.from_netcdf(fset_path)
6161
computed_model = build_model.build_model_from_featureset(
6262
featureset=fset, model_type=model_type,
6363
model_parameters=model_params,

cesium_app/handlers/prediction.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ def post(self):
102102
model_data = executor.submit(joblib.load, model.file.uri)
103103
predset = executor.submit(cesium.predict.model_predictions,
104104
fset_data, model_data)
105-
future = executor.submit(xr.Dataset.to_netcdf, predset,
106-
prediction_path, engine=cfg['xr_engine'])
105+
future = executor.submit(xr.Dataset.to_netcdf, predset, prediction_path)
107106

108107
prediction.task_id = future.key
109108
prediction.save()

cesium_app/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def display_info(self):
198198
info['featureset_name'] = self.model.featureset.name
199199
if self.task_id is None:
200200
try:
201-
with xr.open_dataset(self.file.uri, engine=cfg['xr_engine']) as pset:
201+
with xr.open_dataset(self.file.uri) as pset:
202202
info['results'] = pset.load()
203203
except (RuntimeError, OSError):
204204
info['results'] = None

cesium_app/plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def feature_scatterplot(fset_path, features_to_plot):
2626
Returns (fig.data, fig.layout) where `fig` is an instance of
2727
`plotly.tools.FigureFactory`.
2828
"""
29-
with featureset.from_netcdf(fset_path, engine=cfg['xr_engine']) as fset:
29+
with featureset.from_netcdf(fset_path) as fset:
3030
feat_df = fset.to_dataframe()
3131
feat_df = feat_df[features_to_plot]
3232

@@ -46,7 +46,7 @@ def feature_scatterplot(fset_path, features_to_plot):
4646

4747

4848
#def prediction_heatmap(pred_path):
49-
# with xr.open_dataset(pred_path, engine=cfg['xr_engine']) as pset:
49+
# with xr.open_dataset(pred_path) as pset:
5050
# pred_df = pd.DataFrame(pset.prediction.values, index=pset.name,
5151
# columns=pset.class_label.values)
5252
# pred_labels = pred_df.idxmax(axis=1)

cesium_app/tests/fixtures.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def create_test_featureset(project, label_type='class'):
8888
fset_data = fixtures.sample_featureset(5, 1, features_to_use, targets)
8989
fset_path = pjoin(cfg['paths']['features_folder'],
9090
'{}.nc'.format(str(uuid.uuid4())))
91-
fset_data.to_netcdf(fset_path, engine=cfg['xr_engine'])
91+
fset_data.to_netcdf(fset_path)
9292
f, created = m.File.create_or_get(uri=fset_path)
9393
fset = m.Featureset.create(name='test_featureset', file=f, project=project,
9494
features_list=features_to_use,
@@ -127,7 +127,7 @@ def create_test_model(fset, model_type='RandomForestClassifier'):
127127
"loss": "hinge"},
128128
"LinearRegressor": {
129129
"fit_intercept": True}}
130-
with featureset.from_netcdf(fset.file.uri, engine=cfg['xr_engine']) as fset_data:
130+
with featureset.from_netcdf(fset.file.uri) as fset_data:
131131
model_data = build_model.build_model_from_featureset(fset_data,
132132
model_type=model_type)
133133
model_path = pjoin(cfg['paths']['models_folder'],
@@ -157,12 +157,12 @@ def create_test_prediction(dataset, model):
157157
The model to use to create prediction.
158158
159159
"""
160-
with featureset.from_netcdf(model.featureset.file.uri, engine=cfg['xr_engine']) as fset_data:
160+
with featureset.from_netcdf(model.featureset.file.uri) as fset_data:
161161
model_data = joblib.load(model.file.uri)
162162
pred_data = predict.model_predictions(fset_data.load(), model_data)
163163
pred_path = pjoin(cfg['paths']['predictions_folder'],
164164
'{}.nc'.format(str(uuid.uuid4())))
165-
pred_data.to_netcdf(pred_path, engine=cfg['xr_engine'])
165+
pred_data.to_netcdf(pred_path)
166166
f, created = m.File.create_or_get(uri=pred_path)
167167
pred = m.Prediction.create(file=f, dataset=dataset, project=dataset.project,
168168
model=model, finished=datetime.datetime.now())

0 commit comments

Comments
 (0)