Skip to content

Commit

Permalink
Merge pull request #62 from jzuhone/ruff_black
Browse files Browse the repository at this point in the history
fix ruff, black, gitignore
  • Loading branch information
jzuhone authored Feb 6, 2023
2 parents 3234bd6 + 7f0545d commit c3a8b7d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ dist
*.pyc
acis_thermal_check.egg-info
doc/_build
.eggs
.idea
16 changes: 11 additions & 5 deletions acis_thermal_check/acis_obs.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ def fetch_ocat_data(obsid_list):
got_table = True
try:
resp = retry_call(
requests.get, [urlbase], {"params": params}, tries=4, delay=1
requests.get,
[urlbase],
{"params": params},
tries=4,
delay=1,
)
except (requests.ConnectionError, RetryError):
got_table = False
Expand All @@ -95,7 +99,7 @@ def fetch_ocat_data(obsid_list):
# Now we have to find all of the obsids in each sequence and then
# compute the complete exposure for each sequence
seq_nums = np.unique(
[str(sn) for sn in tab["SEQ_NUM"].data.astype("str") if sn != " "]
[str(sn) for sn in tab["SEQ_NUM"].data.astype("str") if sn != " "],
)
seq_num_list = ",".join(seq_nums)
obsids = tab["OBSID"].data.astype("int")
Expand All @@ -104,7 +108,11 @@ def fetch_ocat_data(obsid_list):
got_seq_table = True
try:
resp = retry_call(
requests.get, [urlbase], {"params": params}, tries=4, delay=1
requests.get,
[urlbase],
{"params": params},
tries=4,
delay=1,
)
except (requests.ConnectionError, RetryError):
got_seq_table = False
Expand Down Expand Up @@ -197,7 +205,6 @@ def find_obsid_intervals(cmd_states, load_start):
obsid_interval_list = []

for eachstate in cmd_states:

# Make sure we skip maneuver obsids explicitly
if 60000 > eachstate["obsid"] >= 38001:
continue
Expand Down Expand Up @@ -233,7 +240,6 @@ def find_obsid_intervals(cmd_states, load_start):

# now calculate the exposure time
if xtztime is not None:

# Having found the startScience and stopScience, you have an
# OBSID interval. Now form the element and append it to
# the Master List. We add the text version of who is in
Expand Down
2 changes: 0 additions & 2 deletions acis_thermal_check/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ def run(self, args, override_limits=None):

# Validation
if not args.pred_only:

# Make the validation plots
plots_validation = self.make_validation_plots(tlm, model_spec, args.outdir)

Expand Down Expand Up @@ -1207,7 +1206,6 @@ def make_validation_plots(self, tlm, model_spec, outdir):
fig_id += 1

if "earthheat__fptemp" in model.comp:

fig = plt.figure(10 + fig_id, figsize=(12, 6))
fig.clf()
ticklocs, fig, ax = plot_cxctime(
Expand Down
1 change: 1 addition & 0 deletions acis_thermal_check/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def config_logging(outdir, verbose):
Indicate how verbose we want the logger to be.
(0=quiet, 1=normal, 2=debug)
"""

# Disable auto-configuration of root logger by adding a null handler.
# This prevents other modules (e.g. Chandra.cmd_states) from generating
# a streamhandler by just calling logging.info(..).
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ignore = [
"S101",
"D1",
"D400",
"D401",
"D415",
"D203",
"SIM105",
Expand All @@ -50,6 +51,8 @@ ignore = [
"FBT003",
"ARG002",
"B904",
"PLR2004",
"PLR0915",
]
extend-exclude = [
"doc",
Expand Down

0 comments on commit c3a8b7d

Please sign in to comment.