Commit 50ea6832 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Bug Fixes For Python

Reinitialize FeatureSpace in all constructors
Use a copy of the df for read_csv
parent e74b8c27
Pipeline #109393 failed with stages
in 60 minutes and 13 seconds
......@@ -177,7 +177,7 @@ FeatureSpace::FeatureSpace(
);
std::vector<int> inds = util_funcs::argsort<int>(feat_n_params);
std::vector<node_ptr>phi_copy(n_feat_in_rung);
std::copy_n(_phi.begin() + _start_rung.back(), n_feat_in_rung, phi_copy.begin());
std::copy_n(_phi.begin() + _start_rung[rr], n_feat_in_rung, phi_copy.begin());
std::transform(
inds.begin(),
inds.end(),
......@@ -186,10 +186,10 @@ FeatureSpace::FeatureSpace(
);
// Reindex the features to match the sorted order
int cur_ind = _start_rung.back();
int cur_ind = _start_rung[rr];
std::for_each(
_phi.begin() + _start_rung.back(),
_phi.begin() + _start_rung.back() + n_feat_in_rung,
_phi.begin() + _start_rung[rr],
_phi.begin() + _start_rung[rr] + n_feat_in_rung,
[&cur_ind](node_ptr feat){feat->reindex(cur_ind); ++cur_ind;}
);
......@@ -200,6 +200,7 @@ FeatureSpace::FeatureSpace(
}
#endif
_scores.resize(_n_feat);
initialize_fs_output_files();
}
FeatureSpace::FeatureSpace(
......@@ -352,6 +353,7 @@ FeatureSpace::FeatureSpace(
#endif
_scores.resize(_n_feat);
initialize_fs_output_files();
}
py::list FeatureSpace::phi0_py()
......
......@@ -146,6 +146,8 @@ def read_csv(
# Load csv file
if not isinstance(df, pd.DataFrame):
df = pd.read_csv(str(df), index_col=0)
else:
df = df.copy()
# Extract the Property and Task Columns
prop, prop_label, prop_unit = extract_col(df, prop_key)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment