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
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ci:
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -21,31 +21,31 @@ repos:
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 26.3.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.3.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.13.2
rev: 9.0.0a3
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.9.1
hooks:
- id: nbstripout
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch
name: Prevent Commit to Main Branch
args: ["--branch", "main"]
stages: [pre-commit]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -58,8 +58,8 @@ repos:
additional_dependencies:
- "prettier@^3.2.4"
# docformatter - PEP 257 compliant docstring formatter
- repo: https://github.com/s-weigand/docformatter
rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.8
hooks:
- id: docformatter
additional_dependencies: [tomli]
Expand Down
23 changes: 23 additions & 0 deletions news/precomit-autofix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No News Added: Style change made with pre-commit auto-fixers. No functional changes were made to the code.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
27 changes: 15 additions & 12 deletions src/diffpy/labpdfproc/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ def _expand_user_input(args):


def set_input_lists(args):
"""Set input directory and files. It takes cli inputs, checks if
they are files or directories and creates a list of files to be
"""Set input directory and files.

It takes cli inputs, checks if they are files or directories
and creates a list of files to be
processed which is stored in the args Namespace.

Parameters
Expand All @@ -132,7 +134,6 @@ def set_input_lists(args):
args : argparse.Namespace
The updated arguments with the modified input list.
"""

input_paths = []
args = _expand_user_input(args)
for input_name in args.input:
Expand Down Expand Up @@ -224,7 +225,6 @@ def load_wavelength_from_config_file(args):
args : argparse.Namespace
The updated arguments with the updated wavelength and anode type.
"""

if args.wavelength is not None:
return normalize_wavelength(args)

Expand Down Expand Up @@ -453,7 +453,6 @@ def load_user_metadata(args):
The updated argparse Namespace
with user metadata inserted as key-value pairs.
"""

reserved_keys = set(vars(args).keys())

if args.user_metadata:
Expand All @@ -479,10 +478,12 @@ def load_user_metadata(args):


def load_user_info(args):
"""Load user info into args. If none is provided, call
check_and_build_global_config function from diffpy.utils to prompt
the user for inputs. Otherwise, call get_user_info with the provided
arguments.
"""Load user info into args.

If none is provided, call check_and_build_global_config
function from diffpy.utils to prompt
the user for inputs. Otherwise, call get_user_info
with the provided arguments.

Parameters
----------
Expand Down Expand Up @@ -550,9 +551,11 @@ def _check_saved_file_exists(args):


def preprocessing_args(args):
"""Perform preprocessing on the provided args. The process includes
loading package and user information, setting input, output,
wavelength, anode type, xtype, mu*D, and loading user metadata.
"""Perform preprocessing on the provided args.

The process includes loading package and user information,
setting input, output, wavelength, anode type, xtype,
mu*D, and loading user metadata.

Parameters
----------
Expand Down
Loading