Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #415

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default_language_version:
node: 17.9.0
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v4.1.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-docstring-first
Expand All @@ -22,21 +22,21 @@ repos:
args:
- "--markdown-linebreak-ext=md"
- repo: "https://github.com/pre-commit/pygrep-hooks"
rev: v1.9.0
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-use-type-annotations
- repo: "https://github.com/pycqa/isort"
rev: 5.11.5
rev: 6.0.1
hooks:
- id: isort
- repo: "https://github.com/psf/black"
rev: 22.3.0
rev: 25.1.0
hooks:
- id: black
- repo: "https://github.com/pre-commit/mirrors-prettier"
rev: v2.6.2
rev: v4.0.0-alpha.8
hooks:
- id: prettier
exclude_types:
Expand All @@ -45,14 +45,14 @@ repos:
- "prettier"
- "[email protected]"
- repo: "https://github.com/asottile/pyupgrade"
rev: e695ecd365119ab4e5463f6e49bea5f4b7ca786b
rev: v3.19.1
# fix to v2.31.0, v2.32.0 requires python >= 3.7
hooks:
- id: pyupgrade
args:
- "--py36-plus"
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.4.1
hooks:
- id: codespell
args: [
Expand All @@ -70,7 +70,7 @@ repos:
additional_dependencies:
- tomli
- repo: "https://github.com/fsfe/reuse-tool"
rev: v0.14.0
rev: v5.0.2
hooks:
- id: reuse
additional_dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
)
@Source.produces(Nersc_Allocation_Info=pd.DataFrame)
class NerscAllocationInfo(Source.Source):

"""
Information of allocations on NERSC machines
"""
Expand Down
3 changes: 1 addition & 2 deletions src/decisionengine_modules/NERSC/sources/NerscJobInfo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0

""" Get job info from Nersc
"""
"""Get job info from Nersc"""
import pandas as pd

from decisionengine.framework.modules import Source
Expand Down
4 changes: 2 additions & 2 deletions src/decisionengine_modules/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

"""
PEP-0396 provides instructions for providing module versions
While we are at it, add a few other useful bits
PEP-0396 provides instructions for providing module versions
While we are at it, add a few other useful bits
"""
try:
# This is built by setuptools_scm
Expand Down
82 changes: 41 additions & 41 deletions src/decisionengine_modules/glideinwms/glide_frontend_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,9 @@ def create_glideclient_classads(
my_name = f"{self.frontend_name}.{self.fe_group}"
gc_classad = classads.GlideClientClassad(glidein_name, my_name)
# Make the classad name unique by adding credential id to it
gc_classad.adParams[
"Name"
] = f"{self.file_id_cache.file_id(cred, cred.filename)}_{gc_classad.adParams['Name']}"
gc_classad.adParams["Name"] = (
f"{self.file_id_cache.file_id(cred, cred.filename)}_{gc_classad.adParams['Name']}"
)
gc_classad.adParams["CollectorHost"] = factory_pool
gc_classad.adParams["FrontendName"] = self.frontend_name
gc_classad.adParams["GroupName"] = self.fe_group
Expand Down Expand Up @@ -670,7 +670,7 @@ def create_glideclientglobal_classads(self, glidefactory_classad, key_builder):
}
for cred in credentials:
if cred.advertise:
for (fname, data) in cred.loaded_data:
for fname, data in cred.loaded_data:
classad_attrs_to_encrypt[cred.file_id(fname)] = data
if hasattr(cred, "security_class"):
# Convert security_class to string for factory
Expand Down Expand Up @@ -946,7 +946,7 @@ def count_match(self, job_types, job_type, entries):
# Get group of jobs based on request cpus
job_groups = jobs.groupby("RequestCpus")

for (req_cpus, group) in job_groups:
for req_cpus, group in job_groups:
# Group jobs by matching criteria: RequestCpus for now
# We care about job counts for each group
job_count = len(group)
Expand Down Expand Up @@ -1073,31 +1073,31 @@ def identify_limits_triggered(

# Identify the limits triggered for advertising in glideresource
if count_status["Total"] >= self.entry_max_glideins: # max_running
limits_triggered[
"TotalGlideinsPerEntry"
] = f"count={count_status['Total']}, limit={self.entry_max_glideins,}"
limits_triggered["TotalGlideinsPerEntry"] = (
f"count={count_status['Total']}, limit={self.entry_max_glideins,}"
)
if count_status["Idle"] >= self.entry_max_slots_idle: # max_vms_idle
limits_triggered[
"IdleGlideinsPerEntry"
] = f"count={count_status['Idle']}, limit={self.entry_max_slots_idle}"
limits_triggered["IdleGlideinsPerEntry"] = (
f"count={count_status['Idle']}, limit={self.entry_max_slots_idle}"
)
if total_glideins >= self.total_max_slots: # was total_max_glideins
limits_triggered["TotalGlideinsPerGroup"] = f"count={total_glideins}, limit={self.total_max_slots}"
if total_idle_glideins >= self.total_max_slots_idle: # was total_max_vms_idle
limits_triggered["IdleGlideinsPerGroup"] = f"count={total_idle_glideins}, limit={self.total_max_slots_idle}"
if fe_total_glideins >= self.fe_total_max_slots: # fe_total_max_glideins
limits_triggered["TotalGlideinsPerFrontend"] = f"count={fe_total_glideins}, limit={self.fe_total_max_slots}"
if fe_total_idle_glideins >= self.fe_total_max_slots_idle: # fe_total_max_vms_idle
limits_triggered[
"IdleGlideinsPerFrontend"
] = f"count={fe_total_idle_glideins}, limit={self.fe_total_max_slots_idle}"
limits_triggered["IdleGlideinsPerFrontend"] = (
f"count={fe_total_idle_glideins}, limit={self.fe_total_max_slots_idle}"
)
if global_total_glideins >= self.global_total_max_slots: # global_total_max_glideins
limits_triggered[
"TotalGlideinsGlobal"
] = f"count={global_total_glideins}, limit={self.global_total_max_slots}"
limits_triggered["TotalGlideinsGlobal"] = (
f"count={global_total_glideins}, limit={self.global_total_max_slots}"
)
if global_total_idle_glideins >= self.global_total_max_slots_idle: # global_total_max_vms_idle
limits_triggered[
"IdleGlideinsGlobal"
] = f"count={global_total_idle_glideins}, limit={self.global_total_max_slots_idle}"
limits_triggered["IdleGlideinsGlobal"] = (
f"count={global_total_idle_glideins}, limit={self.global_total_max_slots_idle}"
)

def compute_glidein_min_idle(
self,
Expand Down Expand Up @@ -1178,37 +1178,37 @@ def compute_glidein_min_idle(

if count_status["Idle"] >= self.entry_curb_slots_idle:
glidein_min_idle /= 2 # above first threshold, reduce
limits_triggered[
"CurbIdleGlideinsPerEntry"
] = f"count={count_status['Idle']}, curb={self.entry_curb_slots_idle,}"
limits_triggered["CurbIdleGlideinsPerEntry"] = (
f"count={count_status['Idle']}, curb={self.entry_curb_slots_idle,}"
)
if total_glideins >= self.total_curb_slots:
glidein_min_idle /= 2 # above global threshold, reduce further
limits_triggered["CurbTotalGlideinsPerGroup"] = f"count={total_glideins}, curb={self.total_curb_slots}"
if total_idle_glideins >= self.total_curb_slots_idle:
glidein_min_idle /= 2 # above global threshold, reduce further
limits_triggered[
"CurbIdleGlideinsPerGroup"
] = f"count={total_idle_glideins}, curb={self.total_curb_slots_idle}"
limits_triggered["CurbIdleGlideinsPerGroup"] = (
f"count={total_idle_glideins}, curb={self.total_curb_slots_idle}"
)
if fe_total_glideins >= self.fe_total_curb_slots:
glidein_min_idle /= 2 # above global threshold, reduce further
limits_triggered[
"CurbTotalGlideinsPerFrontend"
] = f"count={fe_total_glideins}, curb={self.fe_total_curb_slots}"
limits_triggered["CurbTotalGlideinsPerFrontend"] = (
f"count={fe_total_glideins}, curb={self.fe_total_curb_slots}"
)
if fe_total_idle_glideins >= self.fe_total_curb_slots_idle:
glidein_min_idle /= 2 # above global threshold, reduce further
limits_triggered[
"CurbIdleGlideinsPerFrontend"
] = f"count={fe_total_idle_glideins}, curb={self.fe_total_curb_slots_idle}"
limits_triggered["CurbIdleGlideinsPerFrontend"] = (
f"count={fe_total_idle_glideins}, curb={self.fe_total_curb_slots_idle}"
)
if global_total_glideins >= self.global_total_curb_slots:
glidein_min_idle /= 2 # above global threshold, reduce further
limits_triggered[
"CurbTotalGlideinsGlobal"
] = f"count={global_total_glideins}, curb={self.global_total_curb_slots}"
limits_triggered["CurbTotalGlideinsGlobal"] = (
f"count={global_total_glideins}, curb={self.global_total_curb_slots}"
)
if global_total_idle_glideins >= self.global_total_curb_slots_idle:
glidein_min_idle /= 2 # above global threshold, reduce further
limits_triggered[
"CurbIdleGlideinsGlobal"
] = f"count={global_total_idle_glideins}, curb={self.global_total_curb_slots_idle}"
limits_triggered["CurbIdleGlideinsGlobal"] = (
f"count={global_total_idle_glideins}, curb={self.global_total_curb_slots_idle}"
)

if glidein_min_idle < 1:
glidein_min_idle = 1
Expand Down Expand Up @@ -1809,7 +1809,7 @@ def count_match_fom_bff(self, job_types, job_type, entries):

dbg_info.append(f"{len(job_groups)} job groups")

for (req_cpus, job_group) in job_groups:
for req_cpus, job_group in job_groups:
# Group jobs by matching criteria: RequestCpus for now
# We only care about job counts for each group
job_count = len(job_group)
Expand Down Expand Up @@ -1913,7 +1913,7 @@ def count_match_fom_dff(self, job_types, job_type, entries):
# Get group of jobs based on request cpus
job_groups = jobs.groupby("RequestCpus")

for (req_cpus, job_group) in job_groups:
for req_cpus, job_group in job_groups:
# Group jobs by matching criteria: RequestCpus for now
# We care about job counts for each group
job_count = len(job_group)
Expand Down Expand Up @@ -1950,7 +1950,7 @@ def count_match_fom_dff(self, job_types, job_type, entries):
# Start with entries with lowest FOM and fill them first
job_count_matched = 0

for (_fom, fom_group_entries) in fom_matches:
for _fom, fom_group_entries in fom_matches:
job_count_unmatched = job_count - job_count_matched
if job_count_unmatched > 0:
# Distribute the jobs equally among this entry group
Expand Down
2 changes: 1 addition & 1 deletion src/decisionengine_modules/util/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

"""
Utils to simplify testing
Utils to simplify testing
"""
import datetime # noqa: F401

Expand Down
Loading