Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ repos:
# - id: end-of-file-fixer
# - id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.9.2'
rev: 'v0.12.2'
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.4.0
rev: v2.4.1
hooks:
- id: codespell
args: ["--write-changes", "--summary"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1 # Use the latest stable version
rev: v1.16.1 # Use the latest stable version
hooks:
- id: mypy
- repo: https://github.com/numpy/numpydoc
rev: v1.8.0
rev: v1.9.0
hooks:
- id: numpydoc-validation
exclude: |
Expand Down
2 changes: 1 addition & 1 deletion jwst/associations/lib/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SimpleConstraintABC(abc.ABC):
# Attributes to show in the string representation.
_str_attrs: tuple = ("name", "value")

def __new__(cls, *args, **kwargs): # noqa: ARG003
def __new__(cls, *args, **kwargs): # noqa: ARG004
"""
Force creation of the constraint attribute dict before anything else.

Expand Down
2 changes: 1 addition & 1 deletion jwst/associations/mkpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def mkpool(
# Make sure there's no duplicates
params = list(set(params))
params.sort()
defaults = {param: "null" for param in params}
defaults = dict.fromkeys(params, "null")
pool = AssociationPool(names=params, dtype=[object] * len(params))

# Set non-header values from hard-coded defaults
Expand Down
2 changes: 1 addition & 1 deletion jwst/lib/set_telescope_pointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ def get_mnemonics(
logger.info("Querying engineering DB: %s", engdb.base_url)

# Construct the mnemonic values structure.
mnemonics = {mnemonic: None for mnemonic in mnemonics_to_read}
mnemonics = dict.fromkeys(mnemonics_to_read)

# Retrieve the mnemonics from the engineering database.
# Check for whether the bracket values are used and
Expand Down
6 changes: 3 additions & 3 deletions jwst/scripts/collect_pipeline_cfgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def main():
$ collect_pipeline_cfgs .
"""
if len(sys.argv) < 2:
logging.error("ERROR: missing argument (destination directory")
logger.error("ERROR: missing argument (destination directory")
sys.exit(1)

if len(sys.argv) > 2:
logging.error("ERROR: too many arguments")
logger.error("ERROR: too many arguments")
sys.exit(1)

dst = sys.argv[1]
Expand All @@ -40,7 +40,7 @@ def main():

answer = input(msg).strip().lower()
if answer not in ["yes", "no", ""]:
logging.info(f"\n{answer} is not a valid response\n")
logger.info(f"\n{answer} is not a valid response\n")
else:
if answer in ["yes", ""]:
break
Expand Down
6 changes: 3 additions & 3 deletions jwst/scripts/schemadoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def get_docstrings(template, model_names, all_models=False):
try:
docstring = build_docstring(klass, template)
except Exception as err:
logging.error(f"{klassname} : {err}")
logger.error(f"{klassname} : {err}")
else:
logging.info(f".. {klassname} ..")
logging.info(docstring)
logger.info(f".. {klassname} ..")
logger.info(docstring)


def main():
Expand Down
10 changes: 6 additions & 4 deletions jwst/scripts/stfitsdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


logging.basicConfig(level=logging.INFO, format="", datefmt="", stream=sys.stdout)
logger = logging.getLogger()
logger.setLevel(logging.INFO)


def _is_number(s):
Expand Down Expand Up @@ -218,16 +220,16 @@ def main():
args.extension_tolerances
)
except (NameError, TypeError, ValueError, SyntaxError):
logging.error(err_msg)
logger.error(err_msg)
exit()

# Find the differences
logging.info("\n* STScI Custom FITSDiff")
logger.info("\n* STScI Custom FITSDiff")
try:
diff = STFITSDiff(file_a, file_b, **stfitsdiff_default_kwargs)
logging.info(diff.report())
logger.info(diff.report())
except (NameError, TypeError, ValueError, SyntaxError):
logging.error(err_msg)
logger.error(err_msg)


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions jwst/scripts/world_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def main():
else:
hdulist = method(model)
hdulist.writeto(output_file, overwrite=True)
logging.info(f"File written: {output_file}")
logger.info(f"File written: {output_file}")
del hdulist
model.close()

Expand Down Expand Up @@ -389,7 +389,7 @@ def imaging_coords(model):

def warn_user(*argv):
"""Send a warning message to stderr."""
logging.warning(*argv)
logger.warning(*argv)


if __name__ == "__main__":
Expand Down
Loading