-
Notifications
You must be signed in to change notification settings - Fork 4
Add start/end date selectors for experiment filtering #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
b1e1acf
ca767ab
df78839
8569361
27b12b5
06264f0
7f4aa19
2077a1c
4ef4d93
c2c92e4
4b66f8e
707d7b2
7fc0054
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| from pathlib import Path | ||
| from trame.app import get_server | ||
| from trame.widgets import vuetify3 as vuetify | ||
|
|
||
|
|
||
| EXPERIMENTS_PATH = Path.cwd().parent / "experiments/" | ||
|
|
@@ -8,6 +9,7 @@ | |
| server = get_server(client_type="vue3") | ||
| state = server.state | ||
| ctrl = server.controller | ||
| vuetify.enable_lab() # Enable Labs components | ||
|
|
||
|
|
||
| def initialize_state(): | ||
|
|
@@ -23,6 +25,7 @@ def initialize_state(): | |
| ][0] | ||
| print(f"Setting default experiment to {default_experiment}...") | ||
| state.experiment = default_experiment | ||
| state.experiment_date_range = [] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the will |
||
| # ML model | ||
| state.model_type = "Neural Network (single)" | ||
| state.model_training = False | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -439,7 +439,8 @@ def write_model(model, model_type, experiment, db): | |
|
|
||
| # Extract experimental and simulation data from the database as pandas dataframe | ||
| db = connect_to_db(config_dict) | ||
| df_exp = pd.DataFrame(db[experiment].find({"experiment_flag": 1})) | ||
| date_filter = config_dict["date_filter"] | ||
|
||
| df_exp = pd.DataFrame(db[experiment].find({"experiment_flag": 1, **date_filter})) | ||
|
Comment on lines
442
to
443
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change mimics the new lines 111-113 in dashboard/utils.py: - exp_data = pd.DataFrame(db[state.experiment].find({"experiment_flag": 1}))
+ exp_data = pd.DataFrame(
+ db[state.experiment].find({"experiment_flag": 1, **date_filter})
+ ) |
||
| df_sim = pd.DataFrame(db[experiment].find({"experiment_flag": 0})) | ||
|
|
||
| # Apply simulation calibration to the simulation data | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should add to the configuration file a new section that reads, e.g.,