Skip to content

Commit 4a1dbc1

Browse files
Merge pull request #445 from vladistan/fixes-by-ruff
Fixes proposed by Ruff
2 parents 512f7c2 + 8c7e2bf commit 4a1dbc1

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

linkml_runtime/index/object_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _index(self, obj: Any, parent_key=None, parent=None):
7070
return {k: self._index(v, parent_key, parent) for k, v in obj.items()}
7171
cls_name = type(obj).__name__
7272
if cls_name in self._class_map:
73-
cls = self._class_map[cls_name]
73+
self._class_map[cls_name]
7474
pk_val = self._key(obj)
7575
self._source_object_cache[pk_val] = obj
7676
if pk_val not in self._child_to_parent:

linkml_runtime/utils/enumerations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def __setitem__(cls, key, value):
1818
raise ValueError(f"{cls.__name__} - {key} already assigned")
1919
cls.__dict__[key] = value
2020

21-
def __setattr__(self, key, value):
21+
def __setattr__(cls, key, value):
2222
from linkml_runtime.linkml_model.meta import PermissibleValue
2323

24-
if self._defn.code_set and isinstance(value, PermissibleValue) and value.meaning:
25-
print(f"Validating {value.meaning} against {self._defn.code_set}")
24+
if cls._defn.code_set and isinstance(value, PermissibleValue) and value.meaning:
25+
print(f"Validating {value.meaning} against {cls._defn.code_set}")
2626
super().__setattr__(key, value)
2727

2828
def __contains__(cls, item) -> bool:

linkml_runtime/utils/ruleutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ def subclass_to_rules(
136136

137137

138138
def rule_subsumed_by_class(view: SchemaView, rule, cls: ClassDefinition):
139-
induced_slots = view.class_induced_slots(cls.name)
139+
view.class_induced_slots(cls.name)
140140
return False
141141

142142

143143
def remove_redundant_rules(view: SchemaView, class_name: ClassDefinitionName):
144-
induced_slots = view.class_induced_slots(class_name)
144+
view.class_induced_slots(class_name)
145145
cls = view.get_class(class_name)
146146
redundant_rules = []
147147
for rule in cls.rules:

linkml_runtime/utils/schemaops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ def roll_down(sv: SchemaView, classes: list[CLASS_NAME] = None, mixins=True, is_
7272
if is_a and c.is_a is not None:
7373
del c.is_a
7474
for d in dels:
75-
d_cls = sv.get_class(d)
75+
sv.get_class(d)
7676
sv.delete_class(d)
7777
sv.set_modified()

0 commit comments

Comments
 (0)