-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
5a646a7
commit 50b07e9
Showing
5 changed files
with
80 additions
and
59 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from dash import Dash, html | ||
import dash_ag_grid as dag | ||
import pandas as pd | ||
|
||
df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/wind_dataset.csv") | ||
|
||
app = Dash(__name__) | ||
|
||
columnDefs = [ | ||
{ 'field': 'direction' }, | ||
{ 'field': 'strength' }, | ||
{ 'field': 'frequency'}, | ||
] | ||
|
||
grid = dag.AgGrid( | ||
id="get-started-example-basic", | ||
rowData=df.to_dict("records"), | ||
columnDefs=columnDefs, | ||
) | ||
|
||
app.layout = html.Div([grid]) | ||
|
||
if __name__ == "__main__": | ||
app.run(debug=True) |
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 was deleted.
Oops, something went wrong.
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,48 @@ | ||
"""MyViewPlugin is a tailored view of the Model Summary data + Details""" | ||
|
||
import pandas as pd | ||
|
||
# SageWorks Imports | ||
from sageworks.views.view import View | ||
from sageworks.api import Meta | ||
|
||
|
||
class MyViewPlugin(View): | ||
def __init__(self): | ||
"""MyViewPlugin pulls Model metadata""" | ||
|
||
# Call SuperClass Initialization | ||
super().__init__() | ||
|
||
# We're using the SageWorks Meta class to get information about models | ||
self.meta = Meta() | ||
|
||
def refresh(self): | ||
"""Refresh our data (for this example, we don't need to)""" | ||
pass | ||
|
||
def view_data(self) -> pd.DataFrame: | ||
"""Get all the data that's useful for this view | ||
Returns: | ||
pd.DataFrame: DataFrame of the Models Data | ||
""" | ||
models = self.meta.models() | ||
models["uuid"] = models["Model Group"] # uuid is needed for identifying the model | ||
return models | ||
|
||
|
||
if __name__ == "__main__": | ||
# Exercising the MyViewPlugin | ||
import pandas as pd | ||
|
||
pd.options.display.max_columns = None | ||
pd.options.display.width = 1000 | ||
|
||
# Create the class and get the AWS Model details | ||
model_view = MyViewPlugin() | ||
|
||
# List the Models | ||
print("ModelsSummary:") | ||
summary = model_view.view_data() | ||
print(summary.head()) |
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