Skip to content

Comments

Add start/end date selectors for experiment filtering#370

Merged
RemiLehe merged 13 commits intoBLAST-AI-ML:mainfrom
EZoni:date_selection
Feb 11, 2026
Merged

Add start/end date selectors for experiment filtering#370
RemiLehe merged 13 commits intoBLAST-AI-ML:mainfrom
EZoni:date_selection

Conversation

@EZoni
Copy link
Member

@EZoni EZoni commented Jan 29, 2026

Overview

Add a date range selector (including single dates) using the VDateInput component to filter the experiment data points used for visualization and ML training.

Screenshot from 2026-02-11 10-23-24

To do

  • Replace VTextField with VDateInput for date range selection (full range at once, one state variable).
  • Use date information to filter database query in the dashboard code base.
  • Use date information to filter database query in the ML training code base.
  • Test ML training locally.

Notes

See related discussion Kitware/trame#846.

@EZoni EZoni added the dashboard Changes related to the dashboard label Jan 29, 2026
@RemiLehe
Copy link
Contributor

Thanks!
Btw, could you also modify train_model.py to make sure that it applies the date selection to the training data? I think that the way to do this would be to add the dates (with some standardized convention) in the YAML file that the dashboard sends to the training job at NERSC.

Copilot AI review requested due to automatic review settings February 2, 2026 21:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds date range filtering functionality for experiments in the dashboard. Users can select a start and end date to filter experiment data displayed in the dashboard.

Changes:

  • Added a VDateInput component to the dashboard toolbar for date range selection
  • Implemented date filtering logic in the database query for experiment data
  • Configured state management to track the selected date range and trigger updates

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
dashboard/state_manager.py Added experiment_date_range state variable and enabled Vuetify Labs components
dashboard/app.py Added VDateInput component to toolbar and updated state change handler to respond to date range changes
dashboard/utils.py Implemented date filtering logic in load_data() to filter database queries based on selected date range

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +196 to +198
# add date range filter to the configuration dictionary
date_filter = create_date_filter(state.experiment_date_range)
config_dict["date_filter"] = date_filter
Copy link
Member Author

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.,

date_filter:
  date:
    $gte: 2024-03-28 00:00:00
    $lte: 2024-03-28 23:59:59.999000

Comment on lines 442 to 443
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}))
Copy link
Member Author

Choose a reason for hiding this comment

The 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})
+    )

@EZoni EZoni changed the title [WIP] Add start/end date selectors for experiment filtering Add start/end date selectors for experiment filtering Feb 9, 2026
@EZoni
Copy link
Member Author

EZoni commented Feb 9, 2026

@RemiLehe

I think this PR is ready for review.

# 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"]
Copy link
Contributor

@RemiLehe RemiLehe Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we modify this so that, if there is no dates in the config.yaml file, it simply ignores the date selection? e.g. config_dict.get( 'date_filter', {} )

][0]
print(f"Setting default experiment to {default_experiment}...")
state.experiment = default_experiment
state.experiment_date_range = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the config.yaml file contains a section

date_filter:
  date:
    $gte: 2024-03-28 00:00:00
    $lte: 2024-03-28 23:59:59.999000

will experiment_date_range be initialized with these values in the dashboad?

@RemiLehe RemiLehe merged commit 17aa1d9 into BLAST-AI-ML:main Feb 11, 2026
3 checks passed
@EZoni EZoni deleted the date_selection branch February 11, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard Changes related to the dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants