From 7f0545de18eb07cbe7da9e238d8b992e3bb24fde Mon Sep 17 00:00:00 2001 From: John ZuHone Date: Mon, 6 Feb 2023 12:55:22 -0500 Subject: [PATCH] fix ruff, black, gitignore --- .gitignore | 2 ++ acis_thermal_check/acis_obs.py | 16 +++++++++++----- acis_thermal_check/main.py | 2 -- acis_thermal_check/utils.py | 1 + pyproject.toml | 3 +++ 5 files changed, 17 insertions(+), 7 deletions(-) mode change 100755 => 100644 acis_thermal_check/acis_obs.py diff --git a/.gitignore b/.gitignore index 03dde3f7..307cd066 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ dist *.pyc acis_thermal_check.egg-info doc/_build +.eggs +.idea diff --git a/acis_thermal_check/acis_obs.py b/acis_thermal_check/acis_obs.py old mode 100755 new mode 100644 index e1bda3fd..d5410262 --- a/acis_thermal_check/acis_obs.py +++ b/acis_thermal_check/acis_obs.py @@ -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 @@ -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") @@ -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 @@ -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 @@ -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 diff --git a/acis_thermal_check/main.py b/acis_thermal_check/main.py index 91554dd6..6a3b7b6f 100644 --- a/acis_thermal_check/main.py +++ b/acis_thermal_check/main.py @@ -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) @@ -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( diff --git a/acis_thermal_check/utils.py b/acis_thermal_check/utils.py index 5f6380a1..1952bcae 100644 --- a/acis_thermal_check/utils.py +++ b/acis_thermal_check/utils.py @@ -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(..). diff --git a/pyproject.toml b/pyproject.toml index c9e73033..cbb3ba57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ ignore = [ "S101", "D1", "D400", + "D401", "D415", "D203", "SIM105", @@ -50,6 +51,8 @@ ignore = [ "FBT003", "ARG002", "B904", + "PLR2004", + "PLR0915", ] extend-exclude = [ "doc",