Skip to content

Commit

Permalink
precommit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emanehab99 committed Oct 11, 2023
1 parent fdf2e98 commit 53113c5
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions schedview/app/scheduler_dashboard/scheduler_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class Scheduler(param.Parameterized):
summary_widget = param.Parameter(default=None, doc="")
reward_widget = param.Parameter(default=None, doc="")
show_loading_indicator = param.Boolean(default=False)
# date_time = param.Number(default=None)

# Param parameters (used in depends decoraters and trigger calls).
_publish_summary_widget = param.Parameter(None)
Expand All @@ -163,6 +164,7 @@ class Scheduler(param.Parameterized):
_scheduler = None
_conditions = None
_date_time = None
# _date_time = param.Number(default=None)
_reward_df = None
_scheduler_summary_df = None
_survey_maps = None
Expand All @@ -173,6 +175,7 @@ class Scheduler(param.Parameterized):
_display_dashboard_data = False
_do_not_trigger_update = True
_model_observatory = ModelObservatory(init_load_length=1)
# _isDateUpdating = False

# ------------------------------------------------------------ User actions

Expand Down Expand Up @@ -217,6 +220,29 @@ def _update_scheduler_fname(self):

self.show_loading_indicator = False

# @param.depends("date_time", watch=True)
# def _update_date_from_mjd(self):
# """Update the dashboard when a user chooses a new date/time."""

# print("updating date_time from url")
# self._isDateUpdating = True
# self._date_time = self.date_time
# self.date = Time(self.date_time, format="mjd").to_datetime()
# self._isDateUpdating = False

# @param.depends("date", watch=True)
# def _update_date_from_picker(self):
# """Update the dashboard when a user chooses a new date/time."""
# if not self._isDateUpdating:
# print("updating date_time from date selector")
# self._isDateUpdating = True
# self.date_time = Time(
# Timestamp(
# self.date,
# tzinfo=ZoneInfo(DEFAULT_TIMEZONE),
# )
# ).mjd

@param.depends("date", watch=True)
def _update_date(self):
"""Update the dashboard when a user chooses a new date/time."""
Expand Down Expand Up @@ -1465,13 +1491,14 @@ def update_loading(loading):
collapsed=True,
)

if pn.state.location is not None:
pn.state.location.sync(scheduler, {"scheduler_fname": "scheduler", "nside": "nside"})

return sched_app


<<<<<<< HEAD
def main():
=======
if __name__ == "__main__":
>>>>>>> precommit fixes
print("Starting scheduler dashboard.")

if "SCHEDULER_PORT" in os.environ:
Expand Down

0 comments on commit 53113c5

Please sign in to comment.