-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
433 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .models import ActiveExplore | ||
from .apps import ExploreML | ||
from .data import loadActiveH5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .explore_predict import ExploreML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from exploreML.models import ActiveExplore | ||
from exploreML.models import PredictMap | ||
from bokeh.layouts import column, row | ||
|
||
class ExploreML: | ||
|
||
|
||
def __init__(self,grid_shape=(1,1),**kwargs): | ||
|
||
self.grid_shape = grid_shape | ||
self.layouts = [] | ||
#maybe map_p_high/low | ||
|
||
|
||
def addActiveExplore(self,data_dict,sampling_dict,**kwargs): | ||
|
||
active = ActiveExplore(data_dict, sampling_dict, **kwargs) | ||
|
||
self.layouts += [active.layout] | ||
self.toolbar = active.toolbar | ||
self.clust_dict = active.clust_dict # Index clusters for heatmap | ||
self.clust_methods = active.clust_methods | ||
self.upper_source = active.upper_source | ||
self.upper_dict = active.upper_dict | ||
self.row_name = active.row_name | ||
self.col_name = active.col_name | ||
self.sample_sliders = active.sample_sliders | ||
self.plot_size = active.plot_size | ||
self.radio_button_group = active.radio_button_group | ||
self.toggle = active.toggle | ||
self.data_toggle = active.data_toggle | ||
self.active_dim = active.active_dim | ||
|
||
|
||
def addPredictMap(self,pred_df,map_dict,**kwargs): | ||
|
||
predict = PredictMap(pred_df, map_dict, toolbar=self.toolbar, | ||
clust_dict=self.clust_dict,clust_methods=self.clust_methods, | ||
upper_source=self.upper_source,upper_dict=self.upper_dict, | ||
row_name=self.row_name,col_name=self.col_name, | ||
radio_button_group=self.radio_button_group,toggle=self.toggle, | ||
sample_sliders=self.sample_sliders,plot_size=self.plot_size, | ||
data_toggle=self.data_toggle,active_dim=self.active_dim,**kwargs) | ||
self.layouts += [predict.layout] | ||
|
||
def Layout(self): | ||
self.layout = row(*self.layouts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .active_explore import ActiveExplore | ||
from .predict_map import PredictMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
console.log('radio_button_group: active=' + this.active, this.toString()) | ||
|
||
//Store radioVal for clustering methods | ||
let radioVal = cb_obj.active; | ||
|
||
let method = methods[radioVal]; | ||
let x_range = clust_dict[method][3]; | ||
let y_range = [].concat(clust_dict[method][2]).reverse(); | ||
|
||
plot1.x_range.factors = x_range; | ||
plot1.y_range.factors = y_range; | ||
|
||
plot2.x_range.factors = x_range; | ||
plot2.y_range.factors = y_range; | ||
|
||
let cdsLists = up_dict[method]; | ||
|
||
//Reorder mask | ||
//Assign mask source to variable | ||
var data = up_source.data; | ||
var keys = Object.keys(data); | ||
var keysLength = keys.length; | ||
|
||
// Reorder mask | ||
var mask_map = new Map(); | ||
var new_map = new Map(); | ||
for (var i = 0; i < keysLength; i++) { | ||
|
||
//Assign mask source to map variable | ||
mask_map.set(keys[i], data[keys[i]]); | ||
|
||
// Reassign CDS | ||
new_map.set(keys[i], cdsLists[keys[i]]); | ||
|
||
// Clear old mask CDS | ||
mask_map.get(keys[i]).splice(0, mask_map.get(keys[i]).length); | ||
|
||
// Add new mask cds | ||
mask_map.set(keys[i], mask_map.get(keys[i]).push(...new_map.get(keys[i]))); | ||
|
||
} | ||
|
||
up_source.change.emit(); |
Oops, something went wrong.