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

[ruff] Enable ISC rule #3261

Merged
merged 1 commit into from
Feb 7, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ def __call__(self, multilevel_features, is_training=None):

input_levels = list(multilevel_features.keys())
if min(input_levels) > self._min_level:
raise ValueError(
msg = (
f"The minimum backbone level {min(input_levels)} should be "
+ f"less or equal to FPN minimum level {self._min_level}."
f"less or equal to FPN minimum level {self._min_level}."
)
raise ValueError(msg)

backbone_max_level = min(max(input_levels), self._max_level)
with tf.name_scope("fpn"):
Expand Down
2 changes: 1 addition & 1 deletion nncf/common/quantization/quantizer_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def select_qconfig(self, qconfig: QuantizerConfig) -> SingleConfigQuantizationPo
qconfig_any = deepcopy(qconfig)
qconfig_any.signedness_to_force = None
if qconfig_any not in self.possible_qconfigs:
msg = "Invalid selection for a quantizer config - " "tried to select {} among [{}]".format(
msg = "Invalid selection for a quantizer config - tried to select {} among [{}]".format(
qconfig, ",".join([str(q) for q in self.possible_qconfigs])
)
raise ValueError(msg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_output_name(model: torch.fx.GraphModule, node_name: str, output_port_id:
elif node.op == "output":
return node.all_input_nodes.index(graph_node)

msg = f"Node with name {node_name} expected to have an output," " no outputs were found."
msg = f"Node with name {node_name} expected to have an output, no outputs were found."
raise nncf.InternalError(msg)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion nncf/tensorflow/quantization/init_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_init_config_for_scope_and_group(self, node_name: str, group: QuantizerGr
)
)
if len(matches) > 1:
msg = f"Location {str(node_name)} matches more than one per-layer initialization parameter " "definition!"
msg = f"Location {str(node_name)} matches more than one per-layer initialization parameter definition!"
raise ValueError(msg)
if len(matches) == 1:
return matches[0]
Expand Down
2 changes: 1 addition & 1 deletion nncf/torch/model_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def get_input_info_from_config(config: NNCFConfig) -> ModelInputInfo:
return FillerInputInfo.from_nncf_config(config)

nncf_logger.debug(
"Config has no 'input_info' section, trying to use dataloader output as model inputs " "for graph building."
"Config has no 'input_info' section, trying to use dataloader output as model inputs for graph building."
)
exact_info = LoaderInputInfo.from_nncf_config_dataloaders(config)
if exact_info is not None:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ select = [
"UP", # pyupgrade
"EM", # flake8-errmsg
"INP", # flake8-no-pep420
"ISC", # flake8-implicit-str-concat
]
extend-select = [
"SIM", # https://pypi.org/project/flake8-simplify
Expand Down
2 changes: 1 addition & 1 deletion tests/openvino/tools/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def map_ignored_scope(ignored):
if operations is not None:
for op in operations:
if op.get("attributes") is not None:
msg = '"attributes" in the ignored operations ' "are not supported"
msg = '"attributes" in the ignored operations are not supported'
raise ValueError(msg)
ignored_operations.append(op["type"])
return {"ignored_scope": IgnoredScope(names=ignored.get("scope", []), types=ignored_operations)}
Expand Down