Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 13, 2024
1 parent 1774a2a commit d05113c
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/stpipe/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Support for the new 'stpipe' CLI (see stpipe.cmdline for the
implementation of 'strun').
"""

from .main import handle_args

__all__ = ["handle_args"]
1 change: 1 addition & 0 deletions src/stpipe/cli/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Implements the 'stpipe list' command, which lists available
Step subclasses.
"""

import argparse
import re
import sys
Expand Down
1 change: 1 addition & 0 deletions src/stpipe/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Main function and argument parser for stpipe.
"""

import argparse
import sys
import traceback
Expand Down
1 change: 1 addition & 0 deletions src/stpipe/cmdline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Various utilities to handle running Steps from the commandline.
"""

import io
import os
import os.path
Expand Down
1 change: 1 addition & 0 deletions src/stpipe/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
will eventually fully replace config_parser.py, but we'll need to maintain
both until we replace configobj with traitlets.
"""

from copy import deepcopy
from datetime import datetime, timezone

Expand Down
1 change: 1 addition & 0 deletions src/stpipe/config_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Our configuration files are ConfigObj/INI files.
"""

import logging
import os
import os.path
Expand Down
1 change: 1 addition & 0 deletions src/stpipe/crds_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
directly in modules other than this crds_client so that dependency order and
general integration can be managed here.
"""

import re

import crds
Expand Down
1 change: 1 addition & 0 deletions src/stpipe/format_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Format template string allowing partial formatting.
"""

from collections import defaultdict
from string import Formatter

Expand Down
1 change: 1 addition & 0 deletions src/stpipe/function_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
A Step whose only purpose is to wrap an ordinary function.
"""

from .step import Step


Expand Down
1 change: 1 addition & 0 deletions src/stpipe/hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Pre- and post-hooks
"""

import ast
import inspect

Expand Down
1 change: 1 addition & 0 deletions src/stpipe/integration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Entry point implementations.
"""

import os

from asdf.resource import DirectoryResourceMapping
Expand Down
1 change: 1 addition & 0 deletions src/stpipe/log.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Logging setup etc.
"""

import fnmatch
import io
import logging
Expand Down
1 change: 1 addition & 0 deletions src/stpipe/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Pipeline
"""

from collections.abc import Sequence
from os.path import dirname, join
from typing import ClassVar
Expand Down
19 changes: 10 additions & 9 deletions src/stpipe/step.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Step
"""

import gc
import os
import sys
Expand Down Expand Up @@ -103,9 +104,9 @@ def load_spec_file(cls, preserve_comments=_not_set):
for reference_file_type in cls.reference_file_types:
override_name = crds_client.get_override_name(reference_file_type)
spec[override_name] = "is_string_or_datamodel(default=None)"
spec.inline_comments[
override_name
] = f"# Override the {reference_file_type} reference file"
spec.inline_comments[override_name] = (
f"# Override the {reference_file_type} reference file"
)
return spec

@classmethod
Expand Down Expand Up @@ -481,9 +482,9 @@ def run(self, *args):
if isinstance(args[0], Sequence):
for model in args[0]:
try:
model[
f"meta.cal_step.{self.class_alias}"
] = "SKIPPED"
model[f"meta.cal_step.{self.class_alias}"] = (
"SKIPPED"
)
except AttributeError as e: # noqa: PERF203
self.log.info(
"Could not record skip into DataModel "
Expand All @@ -492,9 +493,9 @@ def run(self, *args):
)
elif isinstance(args[0], AbstractDataModel):
try:
args[0][
f"meta.cal_step.{self.class_alias}"
] = "SKIPPED"
args[0][f"meta.cal_step.{self.class_alias}"] = (
"SKIPPED"
)
except AttributeError as e:
self.log.info(
"Could not record skip into DataModel"
Expand Down
1 change: 1 addition & 0 deletions src/stpipe/utilities.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Utilities
"""

import inspect
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions tests/test_format_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""FormatTemplate tests"""

from functools import partial

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_step.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test step.Step"""

import logging
import re
from typing import ClassVar
Expand Down

0 comments on commit d05113c

Please sign in to comment.