Skip to content

Commit

Permalink
remove pagination in both tables, set table height to enable scrollin…
Browse files Browse the repository at this point in the history
…g, remove basis function class column and introduce column widths in basis function table. Also fix logo url
  • Loading branch information
emanehab99 committed Feb 16, 2024
1 parent 83c0639 commit 438dc51
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions schedview/app/scheduler_dashboard/scheduler_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

DEFAULT_CURRENT_TIME = Time.now()
DEFAULT_TIMEZONE = "UTC" # "America/Santiago"
LOGO = "/assets/lsst_white_logo.png"
LOGO = "/schedview-snapshot/assets/lsst_white_logo.png"

Check warning on line 67 in schedview/app/scheduler_dashboard/scheduler_dashboard.py

View check run for this annotation

Codecov / codecov/patch

schedview/app/scheduler_dashboard/scheduler_dashboard.py#L67

Added line #L67 was not covered by tests
COLOR_PALETTES = [color for color in bokeh.palettes.__palettes__ if "256" in color]
PACKAGE_DATA_DIR = importlib.resources.files("schedview.data").as_posix()
USDF_DATA_DIR = "/sdf/group/rubin/web_data/sim-data/schedview"
Expand Down Expand Up @@ -93,7 +93,7 @@ def get_sky_brightness_date_bounds():
"""Load available datetime range from SkyBrightness_Pre files"""
sky_model = SkyModelPre()
min_date = Time(sky_model.mjd_left.min(), format="mjd")
max_date = Time(sky_model.mjd_right.max(), format="mjd")
max_date = Time(sky_model.mjd_right.max(), format="mjd") - 0.001

Check warning on line 96 in schedview/app/scheduler_dashboard/scheduler_dashboard.py

View check run for this annotation

Codecov / codecov/patch

schedview/app/scheduler_dashboard/scheduler_dashboard.py#L96

Added line #L96 was not covered by tests
return (min_date, max_date)


Expand Down Expand Up @@ -709,7 +709,7 @@ def create_summary_widget(self):
}
widths = {
"survey_index": "10%",
"survey": "50%",
"survey": "48%",
"reward": "30%",
"survey_name_with_id": "10%",
}
Expand All @@ -730,9 +730,10 @@ def create_summary_widget(self):
disabled=True,
selectable=1,
hidden_columns=["tier", "survey_url"],
pagination="remote",
page_size=4,
# pagination="remote",
# page_size=4,
sizing_mode="stretch_width",
height=220,
)
self.summary_widget = summary_widget
self._debugging_message = "Finished making summary widget."
Expand Down Expand Up @@ -846,7 +847,6 @@ def create_reward_widget(self):
}
columns = [
"basis_function",
"basis_function_class",
"basis_function_href",
"feasible",
"max_basis_reward",
Expand All @@ -859,7 +859,6 @@ def create_reward_widget(self):
]
titles = {
"basis_function": "Basis Function",
"basis_function_class": "Class",
"basis_function_href": "Docs",
"feasible": "Feasible",
"max_basis_reward": "Max. Reward",
Expand All @@ -871,7 +870,6 @@ def create_reward_widget(self):
}
text_align = {
"basis_function": "left",
"basis_function_class": "left",
"basis_function_href": "center",
"feasible": "center",
"max_basis_reward": "right",
Expand All @@ -885,20 +883,31 @@ def create_reward_widget(self):
"feasible": False,
"basis_function_href": False,
}
widths = {

Check warning on line 886 in schedview/app/scheduler_dashboard/scheduler_dashboard.py

View check run for this annotation

Codecov / codecov/patch

schedview/app/scheduler_dashboard/scheduler_dashboard.py#L886

Added line #L886 was not covered by tests
"basis_function": "14%",
"basis_function_href": "5%",
"feasible": "6%",
"max_basis_reward": "10%",
"basis_area": "12%",
"basis_weight": "8%",
"accum_order": "13%",
"max_accum_reward": "15%",
"accum_area": "15%",
}

reward_widget = pn.widgets.Tabulator(
self._survey_reward_df[columns],
titles=titles,
text_align=text_align,
sortable=sortable,
layout="fit_data_stretch",
show_index=False,
formatters=tabulator_formatter,
disabled=True,
frozen_columns=["basis_function"],
hidden_columns=["doc_url"],
selectable=1,
pagination="remote",
page_size=13,
height=400,
widths=widths,
)
self.reward_widget = reward_widget
self._debugging_message = "Finished making reward widget."
Expand All @@ -912,7 +921,7 @@ def update_reward_widget_data(self):
self.reward_widget.selection = []
columns = [
"basis_function",
"basis_function_class",
# "basis_function_class",
"basis_function_href",
"feasible",
"max_basis_reward",
Expand Down Expand Up @@ -1518,9 +1527,10 @@ def handle_reload_pickle(event):
styles={"background": "#048b8c"},
),
pn.param.ParamMethod(scheduler.publish_summary_widget, loading_indicator=True),
# scroll=True
),
pn.Spacer(width=10),
sizing_mode="stretch_height",
# sizing_mode="stretch_height",
)
# Reward table and header.
sched_app[36:87, 0:67] = pn.Row(
Expand Down

0 comments on commit 438dc51

Please sign in to comment.