Skip to content

Commit

Permalink
Added codespell in pre-commit and fixed files to compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
mambelli committed Feb 22, 2025
1 parent 3bf56ab commit 5a6597b
Show file tree
Hide file tree
Showing 29 changed files with 109 additions and 54 deletions.
8 changes: 8 additions & 0 deletions .codespell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC
SPDX-License-Identifier: Apache-2.0
-->

# Codespell Configuration

These files are documented at <https://docs.openverse.org/meta/codespell.html>.
2 changes: 2 additions & 0 deletions .codespell/ignore_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
;; SPDX-FileCopyrightText = "2017 Fermi Research Alliance, LLC"
;; SPDX-License-Identifier = "Apache-2.0"
23 changes: 23 additions & 0 deletions .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
;; SPDX-FileCopyrightText = "2017 Fermi Research Alliance, LLC"
;; SPDX-License-Identifier = "Apache-2.0"
;; DE/DEM words
FOM
fom
;; GWMS and HTCondor words
glidein
Glidein
glideinwms
GlideinWMS
apptainer
Apptainer
HTCondor
startd
schedd
collector
negotiator
classad
classads
ClassAd
ClassAdss
astroid
;;
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.11"

name: Python ${{ matrix.python-version }} unit tests
steps:
Expand Down
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ repos:
- id: pyupgrade
args:
- "--py36-plus"
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args: [
# codespell --toml pyproject.toml .
# Pass skip configuration as command line arguments rather than in the
# config file because neither cfg nor TOML support splitting this argument
# across multiple lines.
# Globs must match the Python `glob` module's format:
# https://docs.python.org/3/library/glob.html#module-glob
"-S",
".codespell/ignore_words.txt",
# Write changes in place
"-w",
]
additional_dependencies:
- tomli
- repo: "https://github.com/fsfe/reuse-tool"
rev: v0.14.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Files: src/*.jsonnet src/*/readme src/*.conf src/*.fixture src/*.csv src/*/AWS/s
Copyright: 2017 Fermi Research Alliance, LLC
License: Apache-2.0

Files: .codecov.yml .coveragerc .editorconfig .gitignore .lgtm.yaml .pep8speaks.yml .pre-commit-config.yaml .pylintrc _config.yml pyproject.toml uv.lock
Files: .codecov.yml .codespell/ignore_lines.txt .codespell/ignore_words.txt .coveragerc .editorconfig .gitignore .lgtm.yaml .pep8speaks.yml .pre-commit-config.yaml .pylintrc _config.yml pyproject.toml uv.lock
Copyright: 2017 Fermi Research Alliance, LLC
License: Apache-2.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@
"refId": "A"
}
],
"title": "Transform Averge GlideinRequestManifests",
"title": "Transform Average GlideinRequestManifests",
"type": "timeseries"
},
{
Expand Down
8 changes: 4 additions & 4 deletions doc/source/release_notes/release_notes_1.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Full list of commits since version 1.7.3
Release 1.7.3
-------------

Enable token+proxy hybrid configuration, to send a proxy in a ddition to tokens to support OSG Gratia probes.
Enable token+proxy hybrid configuration, to send a proxy in addition to tokens to support OSG Gratia probes.

Full list of commits since version 1.7.2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -108,7 +108,7 @@ This release features:
The RPM package was renamed from decisionengine-standard-library to decisionengine_modules. rpm/yum updates from the old RPM will work correctly.

.. note::
The "channel_name" key in the Source Proxy config dictionaries needs to be changed to "source_channel". "channel_name" is now being used to describe the name of the channel itself, not the name of the channel the Source Proxy is gettting information from.
The "channel_name" key in the Source Proxy config dictionaries needs to be changed to "source_channel". "channel_name" is now being used to describe the name of the channel itself, not the name of the channel the Source Proxy is getting information from.


Issues fixed in this release
Expand Down Expand Up @@ -140,7 +140,7 @@ Full list of commits since version 1.6.0

`77a79ad <https://github.com/HEPCloud/decisionengine_modules/commit/77a79adb0c6b6a81441f77cb0d1b62fe1a614a75>`_: Use latest version of bill calc

`385266c <https://github.com/HEPCloud/decisionengine_modules/commit/385266c417c18eba3c8aedecc6f6a4e6aca6b92f>`_: Fix requiements to match our usage
`385266c <https://github.com/HEPCloud/decisionengine_modules/commit/385266c417c18eba3c8aedecc6f6a4e6aca6b92f>`_: Fix requirements to match our usage

`56e2d9e <https://github.com/HEPCloud/decisionengine_modules/commit/56e2d9e288295a5d6d0987b9250acc644a54b809>`_: Add config for lgtm

Expand Down Expand Up @@ -188,7 +188,7 @@ Full list of commits since version 1.6.0

`5435707 <https://github.com/HEPCloud/decisionengine_modules/commit/54357079948adf0e3f68618efe6bb76a3a0af651>`_: Check for configuration error.

`4f7fc04 <https://github.com/HEPCloud/decisionengine_modules/commit/4f7fc044f1761cbf915d405e235a1d7cc9b9812c>`_: Accomodate breaking changes introduced by the framework.
`4f7fc04 <https://github.com/HEPCloud/decisionengine_modules/commit/4f7fc044f1761cbf915d405e235a1d7cc9b9812c>`_: Accommodate breaking changes introduced by the framework.

`a27f92a <https://github.com/HEPCloud/decisionengine_modules/commit/a27f92afc1f5ef2b3d16c03cc311a49593a168cf>`_: Added 1.6.2 release notes, from branch 1.6

Expand Down
4 changes: 2 additions & 2 deletions doc/source/release_notes/release_notes_2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ chanism. This allows to trigger this action through a GitHub API or directly thr

`9044b64 <https://github.com/HEPCloud/decisionengine_modules/commit/9044b64d3dc813e9eabc36d04c125392f2efecb9>`_: Add token authentication to the glideinwms module

`97ca32a <https://github.com/HEPCloud/decisionengine_modules/commit/97ca32ad84d26b9059f6eda8988c8ddd80a0466a>`_: Modified pre-commit bot suggestions. Avoid pyupgrade that requires pytohn 3.7
`97ca32a <https://github.com/HEPCloud/decisionengine_modules/commit/97ca32ad84d26b9059f6eda8988c8ddd80a0466a>`_: Modified pre-commit bot suggestions. Avoid pyupgrade that requires python 3.7

`95a7d7b <https://github.com/HEPCloud/decisionengine_modules/commit/95a7d7b8835776da4ed16a3a6268da96cabe74e6>`_: Test the arguments used to call publish_to_htcondor.

Expand Down Expand Up @@ -219,7 +219,7 @@ chanism. This allows to trigger this action through a GitHub API or directly thr

`d57ac6e <https://github.com/HEPCloud/decisionengine_modules/commit/d57ac6ee7376191f482fd0bebe14f013b8e16e79>`_: Set Apache 2.0 license and added REUSE compliance

`cf43119 <https://github.com/HEPCloud/decisionengine_modules/commit/cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71>`_: Set fail-fast to false to allow py3.6 tests to complete also when higher version fail. Temporarly downgraded from py3.10 to py3.9 because the condor dependency is not available yet for py3.10.
`cf43119 <https://github.com/HEPCloud/decisionengine_modules/commit/cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71>`_: Set fail-fast to false to allow py3.6 tests to complete also when higher version fail. Temporarily downgraded from py3.10 to py3.9 because the condor dependency is not available yet for py3.10.

`e2707e5 <https://github.com/HEPCloud/decisionengine_modules/commit/e2707e589142d40afdc5716fd4c4d6c9a38bc64e>`_: Ignoring E203, whitespace after ':', since black is adding the whitespace

Expand Down
2 changes: 1 addition & 1 deletion package/ci/EL7/python3-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

CMD=${1:- -m pytest}
LOGFILE=${2:- pytest.log}
# set defaul DE_BRANCH to master or eventually set it as entrypoint script argument
# set default DE_BRANCH to master or eventually set it as entrypoint script argument
DE_BRANCH=${3:-master}

# check DE modules branch
Expand Down
2 changes: 1 addition & 1 deletion package/ci/EL8/python3-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

CMD=${1:- -m pytest}
LOGFILE=${2:- pytest.log}
# set defaul DE_BRANCH to master or eventually set it as entrypoint script argument
# set default DE_BRANCH to master or eventually set it as entrypoint script argument
DE_BRANCH=${3:-master}

# check DE modules branch
Expand Down
2 changes: 1 addition & 1 deletion package/ci/EL9/python3-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

CMD=${1:- -m pytest}
LOGFILE=${2:- pytest.log}
# set defaul DE_BRANCH to master or eventually set it as entrypoint script argument
# set default DE_BRANCH to master or eventually set it as entrypoint script argument
DE_BRANCH=${3:-master}

# check DE modules branch
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ flake8-statistics = "True"
line-length = 120
target-version = ['py36']

[tool.codespell]
exclude-file = ".codespell/ignore_lines.txt"
ignore-words = ".codespell/ignore_words.txt"

[tool.isort]
src_paths = ["doc", "src"]
py_version = 36
Expand Down
2 changes: 1 addition & 1 deletion src/decisionengine_modules/AWS/pandas_scratch_pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def load_data_frame(list_of_dicts):
merged_pd = pd.merge_asof(jobs_pd, resource_spot_pd, left_on="RequestCpus", right_on="ResourceCpus")
print(merged_pd)

# create a new column that gives a boolean determining wether or not the row matches memory requirments
# create a new column that gives a boolean determining whether or not the row matches memory requirements
merged_pd = merged_pd.assign(Match=merged_pd.RequestMemory <= merged_pd.ResourceMemory)
merged_pd = merged_pd.assign(estimatedCost=merged_pd.RequestTime * merged_pd.SpotPrice)

Expand Down
4 changes: 2 additions & 2 deletions src/decisionengine_modules/AWS/sources/AWSSpotPrice.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def spot_price_summary(self, spot_price_history):
availability zone and instance type
:type spot_price_history: :obj:`list`
:arg spot_price_history: list of dictonaries
:arg spot_price_history: list of dictionaries
:rtype: :obj:`list`: list of spot price data (:class:`SpotPriceData`)
"""

Expand Down Expand Up @@ -205,7 +205,7 @@ def acquire(self):
:rtype: pandas frame (:class:`pd.DataFramelist`)
"""

# Load kown accounts configuration
# Load known accounts configuration
# account configuration is dynamic
self.logger.debug("in AWSSpotPrice acquire")
account_dict = load_config.load(self.config_file, 5, 20, self.logger)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
This data is taken from billing and arranged as dictionary of
AccountConstants instead of separate class for each billing class.
This way is more covenient to use in programms.
This way is more convenient to use in programs.
"""

EXPECTED_NAMES = [
Expand Down
2 changes: 1 addition & 1 deletion src/decisionengine_modules/AWS/transforms/AWSOccupancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __ne__(self, other):

class OccupancyForRegion:
"""
AWS capacity data and metods
AWS capacity data and methods
"""

def __init__(self, region="us-west-2", profile_name=None, instance_types=None):
Expand Down
2 changes: 1 addition & 1 deletion src/decisionengine_modules/AWS/transforms/AWSSpotPrice.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def spot_price_summary(self, spot_price_history):
availability zone and instance type
:type spot_price_history: :obj:`list`
:arg spot_price_history: list of dictonaries
:arg spot_price_history: list of dictionaries
:rtype: :obj:`list`: list of spot price data (:class:`SpotPriceData`)
"""

Expand Down
4 changes: 2 additions & 2 deletions src/decisionengine_modules/AWS/transforms/FigureOfMerit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

"""
Calculates price / preformance and figure of merit and
saves it into the output file acording to design document.
Calculates price / performance and figure of merit and
saves it into the output file according to design document.
"""
import copy
Expand Down
6 changes: 3 additions & 3 deletions src/decisionengine_modules/GCE/transforms/GceFigureOfMerit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

"""
Calculates price / preformance and figure of merit and
saves it into the output file acording to design document.
Calculates price / performance and figure of merit and
saves it into the output file according to design document.
"""
import sys
Expand Down Expand Up @@ -47,7 +47,7 @@ def transform(self, data_block):
]
except AttributeError:
occupancy = 0
self.logger.debug("GceFigureOfMerit transform: Looks like no VMs runnig in GCE.")
self.logger.debug("GceFigureOfMerit transform: Looks like no VMs running in GCE.")
else:
occupancy = float(occupancy_df["Occupancy"].values[0]) if not occupancy_df.empty else 0

Expand Down
2 changes: 1 addition & 1 deletion src/decisionengine_modules/NERSC/sources/NerscJobInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

_MAX_RETRIES = 10
_RETRY_BACKOFF_FACTOR = 1
# TODO this is a default column list and needs to be overriden from configuration
# TODO this is a default column list and needs to be overridden from configuration


@Source.supports_config(
Expand Down
4 changes: 2 additions & 2 deletions src/decisionengine_modules/NERSC/sources/NerscSFApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def check_accesstoken(self, nersc_user):
self.logger.debug(f"{rawfile} does not exist. Need to generate")
else:
atoken = None
with open(rawfile) as afile:
atoken = afile.read()
with open(rawfile) as a_file:
atoken = a_file.read()
atoken = atoken.rstrip()
# HK> If the access token is expired, the flow goes directly to except jwt.ExpiredSign

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

"""
Calculates price / preformance and figure of merit and
saves it into the output file acording to design document.
Calculates price / performance and figure of merit and
saves it into the output file according to design document.
"""
import sys
Expand Down
Loading

0 comments on commit 5a6597b

Please sign in to comment.