Skip to content

Commit ee2945f

Browse files
committed
add pre-commit
1 parent 08321f3 commit ee2945f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+210
-261
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "util/sims_featureScheduler_runs3.0"]
2-
path = util/sims_featureScheduler_runs3.0
3-
url = https://github.com/lsst-sims/sims_featureScheduler_runs3.0.git

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: check-toml
9+
- repo: https://github.com/psf/black
10+
rev: 23.7.0
11+
hooks:
12+
- id: black
13+
# It is recommended to specify the latest version of Python
14+
# supported by your project here, or alternatively use
15+
# pre-commit's default_language_version, see
16+
# https://pre-commit.com/#top_level-default_language_version
17+
language_version: python3.11
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
# Ruff version.
20+
rev: v0.0.278
21+
hooks:
22+
- id: ruff

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"python.testing.pytestEnabled": true,
77
"python.envFile": "${workspaceFolder}/.env",
88
"python.formatting.provider": "black"
9-
}
9+
}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ The `schedview` module provides tools for visualizing Rubin Observatory schedule
33

44
- A collection of functions, eacho of which creates an independent visualization of same aspect of scheduler behaviour, state, or surve progress. These functions may be used in `jupyter` notebooks or other python applications, or combined into dashboards or other higher level applications.
55
- A handful of dashboard applications that collect relevant visualizations into sets suitable for specific use cases.
6-

notebooks/custom_plot.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
]
2121
}
2222
}
23-
]
23+
]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "schedview"
77
description = "Tools for visualization of Rubin Observatory's scheduler status, strategy and progress on LSST."
8-
classifiers = [
8+
classifiers = [
99
"Intended Audience :: Science/Research",
1010
"Operating System :: OS Independent",
1111
"Programming Language :: Python :: 3",

schedview/app/prenight/prenight.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
import argparse
2-
import param
2+
import importlib
3+
import json
34
import logging
5+
import os
6+
7+
import astropy.utils.iers
8+
import bokeh
9+
import hvplot.pandas # noqa: F401
410
import numpy as np
511
import pandas as pd
6-
import os
7-
import json
8-
import importlib
912
import panel as pn
10-
import bokeh
11-
import hvplot.pandas
13+
import param
14+
import rubin_sim.scheduler.example
1215
from astropy.time import Time
13-
import astropy.utils.iers
14-
1516
from rubin_sim.scheduler.model_observatory import ModelObservatory
16-
import rubin_sim.scheduler.example
1717

18-
import schedview.compute.astro
18+
import schedview.collect.footprint
1919
import schedview.collect.opsim
20+
import schedview.compute.astro
2021
import schedview.compute.scheduler
21-
import schedview.collect.footprint
22-
import schedview.plot.visits
23-
import schedview.plot.visitmap
24-
import schedview.plot.rewards
25-
import schedview.plot.visits
22+
import schedview.param
2623
import schedview.plot.nightbf
2724
import schedview.plot.nightly
28-
import schedview.param
25+
import schedview.plot.rewards
26+
import schedview.plot.visitmap
27+
import schedview.plot.visits
2928

3029
AVAILABLE_TIMEZONES = [
3130
"Chile/Continental",
@@ -853,7 +852,9 @@ def make_app(
853852
854853
Returns
855854
-------
856-
pn_app : `panel.viewable.Viewable` or `tuple` ['panel.viewable.Viewable', `schedview.prenight.Prenight`]
855+
pn_app : `panel.viewable.Viewable`
856+
or `tuple`
857+
['panel.viewable.Viewable', `schedview.prenight.Prenight`]
857858
The pre-night briefing app.
858859
"""
859860
prenight = cls()

schedview/app/sched_maps/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from schedview.app.sched_maps.sched_maps import add_scheduler_map_app
21
import bokeh
32

3+
from schedview.app.sched_maps.sched_maps import add_scheduler_map_app
4+
45
doc = bokeh.plotting.curdoc()
56
add_scheduler_map_app(doc)

schedview/app/sched_maps/sched_maps.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1+
import bokeh.core.properties
2+
import bokeh.models
13
import bokeh.plotting
2-
from astropy.time import Time
3-
44
import pandas as pd
5-
import bokeh.models
6-
import bokeh.core.properties
7-
8-
from uranography.api import (
9-
ArmillarySphere,
10-
HorizonMap,
11-
Planisphere,
12-
MollweideMap,
13-
)
14-
15-
from schedview.collect import sample_pickle
16-
17-
from schedview.plot.scheduler import SchedulerDisplay
18-
from rubin_sim.scheduler.model_observatory import ModelObservatory
19-
from schedview.collect import read_scheduler
20-
from schedview.plot.scheduler import LOGGER, DEFAULT_NSIDE, DEFAULT_MJD
215
import rubin_sim.scheduler.example
6+
from astropy.time import Time
7+
from rubin_sim.scheduler.model_observatory import ModelObservatory
8+
from uranography.api import ArmillarySphere, HorizonMap, MollweideMap, Planisphere
9+
10+
from schedview.collect import read_scheduler, sample_pickle
11+
from schedview.plot.scheduler import (
12+
DEFAULT_MJD,
13+
DEFAULT_NSIDE,
14+
LOGGER,
15+
SchedulerDisplay,
16+
)
2217

2318

2419
class SchedulerDisplayApp(SchedulerDisplay):

schedview/app/sched_maps/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
{{ plot_script|indent(8) }}
1515
</body>
1616

17-
</html>
17+
</html>

0 commit comments

Comments
 (0)