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
4 changes: 2 additions & 2 deletions lib/ramble/ramble/cmd/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _check_license(lines, path):
logger.warn(f"{path}: copyright date mismatch")
found.append(i)

if len(found) == len(license_lines) and found == list(sorted(found)):
if len(found) == len(license_lines) and found == sorted(found):
return

def old_license(line, path):
Expand Down Expand Up @@ -211,7 +211,7 @@ def verify(args):
if not os.path.exists(path):
continue
with open(path) as f:
lines = [line for line in f][:license_lines]
lines = list(f)[:license_lines]

error = _check_license(lines, path)
if error:
Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
# Same as above, but including keys for workspaces
# this allows us to unify config reading between configs and workspaces
all_schemas = copy.deepcopy(section_schemas)
all_schemas.update({key: ramble.schema.workspace.schema for key in ramble.schema.workspace.keys})
all_schemas.update(dict.fromkeys(ramble.schema.workspace.keys, ramble.schema.workspace.schema))

#: Builtin paths to configuration files in ramble
configuration_paths = (
Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/definitions/families.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ def as_str(self, n_indent: int = 0, **kwargs):

def add_families(self, families: List[str]):
"""Add new families to this object"""
updated_families = list(sorted(set(self.families + families)))
updated_families = sorted(set(self.families + families))
self.families = updated_families
2 changes: 1 addition & 1 deletion lib/ramble/ramble/experiment_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def finalize(self):
if var not in app_inst.keywords.keys or not app_inst.keywords.is_key_level(var):
self.variables[var] = app_inst.expander.expand_var(val)

self.variants = sorted(list(app_inst.experiment_variants().as_set()))
self.variants = sorted(app_inst.experiment_variants().as_set())

def to_dict(self):
"""Generate a dict for encoders (json, yaml) and uploaders.
Expand Down
8 changes: 4 additions & 4 deletions lib/ramble/ramble/language/language_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ def __new__(cls, name, bases, attr_dict):
pass

# De-duplicates directives from base classes
attr_dict["_directives_to_be_executed"] = [
x for x in llnl.util.lang.dedupe(attr_dict["_directives_to_be_executed"])
]
attr_dict["_directives_to_be_executed"] = list(
llnl.util.lang.dedupe(attr_dict["_directives_to_be_executed"])
)

# Move things to be executed from module scope (where they
# are collected first) to class scope
Expand Down Expand Up @@ -214,7 +214,7 @@ def _decorator(decorated_function):
@functools.wraps(decorated_function)
def _wrapper(*args, **_kwargs):
# First merge default args with kwargs
kwargs = dict()
kwargs = {}
for default_args in DirectiveMeta._default_args:
kwargs.update(default_args)
kwargs.update(_kwargs)
Expand Down
4 changes: 2 additions & 2 deletions lib/ramble/ramble/language/shared_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def maintainers(*names: str, **kwargs):
def _execute_maintainer(obj):
maintainers_from_base = getattr(obj, "maintainers", [])
# Here it is essential to copy, otherwise we might add to an empty list in the parent
obj.maintainers = list(sorted(set(maintainers_from_base + list(names))))
obj.maintainers = sorted(set(maintainers_from_base + list(names)))

return _execute_maintainer

Expand All @@ -597,7 +597,7 @@ def tags(*values: str, **kwargs):
def _execute_tag(obj):
tags_from_base = getattr(obj, "tags", [])
# Here it is essential to copy, otherwise we might add to an empty list in the parent
obj.tags = list(sorted(set(tags_from_base + list(values))))
obj.tags = sorted(set(tags_from_base + list(values)))

return _execute_tag

Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def add_group(group):

def add_subcommand_group(title, commands):
"""Add informational help group for a specific subcommand set."""
cmd_set = {c for c in commands}
cmd_set = set(commands)

# make a dict of commands of interest
cmds = {a.dest: a for a in self.actions if a.dest in cmd_set}
Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def render_objects(self, render_group, exclude_where=None, ignore_used=True, fat

elif var in defined_zips:
zip_len = defined_zips[var]["length"]
idx_vector = [i for i in range(0, zip_len)]
idx_vector = list(range(0, zip_len))

matrix_size = matrix_size * zip_len
vectors.append(idx_vector)
Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/util/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _iter_s3_contents(contents, prefix):


def _list_s3_objects(client, bucket, prefix, num_entries, start_after=None):
list_args = dict(Bucket=bucket, Prefix=prefix[1:], MaxKeys=num_entries)
list_args = {"Bucket": bucket, "Prefix": prefix[1:], "MaxKeys": num_entries}

if start_after is not None:
list_args["StartAfter"] = start_after
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ extend-exclude = [
[tool.ruff.lint]
# B905 requires Python 3.9 or up.
ignore = ["B905"]
extend-select = ["B"]
extend-select = ["B", "C4"]

[tool.ruff.lint.per-file-ignores]
"lib/ramble/ramble/*kit.py" = ["F403"]
Expand Down
9 changes: 3 additions & 6 deletions share/ramble/qa/flake8_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@


# compile all regular expressions.
pattern_exemptions = dict(
(
re.compile(file_pattern),
dict((code, [re.compile(p) for p in patterns]) for code, patterns in error_dict.items()),
)
pattern_exemptions = {
re.compile(file_pattern): {code: [re.compile(p) for p in patterns] for code, patterns in error_dict.items()}
for file_pattern, error_dict in pattern_exemptions.items()
)
}


class SpackFormatter(Pylint):
Expand Down