Issues (931)

mandos/knowledge.py (10 issues)

1
from __future__ import annotations
0 ignored issues
show
Missing module docstring
Loading history...
2
import abc
3
from dataclasses import dataclass
4
from typing import Union, Type, FrozenSet, Mapping
5
6
from pocketutils.core.dot_dict import NestedDotDict
0 ignored issues
show
Unable to import 'pocketutils.core.dot_dict'
Loading history...
7
8
from mandos import MandosResources
9
from mandos.model import Search
10
11
12
@dataclass(frozen=True, eq=True, repr=True)
0 ignored issues
show
Missing class docstring
Loading history...
13
class Source(metaclass=abc.ABCMeta):
14
    meta_ref: str
15
    ref: str
16
    name: str
17
    params: Mapping[str, Union[None, str, int, float]]
18
    target: Type[Search]
19
20
21
@dataclass(frozen=True, eq=True, repr=True)
0 ignored issues
show
Missing class docstring
Loading history...
22
class KnowledgeSet:
23
    sources: FrozenSet[Source]
24
25
    @classmethod
26
    def create(cls, param_values: Mapping[str, Union[None, str, int, float]]) -> KnowledgeSet:
0 ignored issues
show
Missing function or method docstring
Loading history...
The argument param_values seems to be unused.
Loading history...
27
        _data = NestedDotDict.read_json(MandosResources.path("knowledge.json"))
28
        knowledge = []
0 ignored issues
show
The variable knowledge seems to be unused.
Loading history...
29
        params = {v["key"]: v for v in _data["params"]}
30
        for source in _data["sources"]:
0 ignored issues
show
The variable source seems to be unused.
Loading history...
31
            for pkey, pvalue in params.items():
0 ignored issues
show
The variable pkey seems to be unused.
Loading history...
The variable pvalue seems to be unused.
Loading history...
32
                pass
33