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
3 changes: 3 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[mypy]
ignore_missing_imports = True
pretty = True

[mypy-yaml.*]
ignore_missing_imports = True
40 changes: 26 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
fail_fast: true

repos:
- repo: https://github.com/myint/autoflake
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
- id: autoflake
args:
- --in-place
- --remove-unused-variables
- --in-place
- --remove-unused-variables
# - --remove-all-unused-imports

- repo: https://github.com/ambv/black
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
- id: black
args: [--diff, --check, -l 79]

- repo: https://github.com/PyCQA/isort
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- id: isort
args:
- --line-length=79
- --src=lm_service
- repo: https://github.com/pre-commit/mirrors-mypy
- --line-length=79
- --src=graph_cast
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
- id: mypy
# args:
# - --module lm_service
exclude: ^test/
# - --module graph_cast
exclude: (^test/|^run/)
# args: [--strict]

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.4.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '4', --preserve-quotes]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: pretty-format-json
args: [--autofix, --indent, '4']

# - repo: https://github.com/pre-commit/mirrors-pylint
# rev: v2.14.5
# hooks:
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ isort:

.PHONY: autoflake
autoflake:
autoflake --remove-unused-variables --verbose --in-place ./lm_service/**/*py
autoflake --remove-unused-variables --verbose --in-place ./graph_cast/**/*py

all: autoflake black isort mypy
.PHONY: prettyyaml
prettyyaml:
find . -name "*yaml" -and -not -ipath './.*' -type f | xargs pretty-format-yaml --autofix --indent 4

.PHONY: prettyjson
prettyjson:
find . -name "*json" -and -not -ipath './.*' -type f | xargs pretty-format-json --autofix --indent 4

all: autoflake black isort mypy prettyyaml prettyjson

#.PHONY: pylint
#pylint:
# pylint lm_service
# pylint package_name


57 changes: 25 additions & 32 deletions conf/json/freshcaller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,44 @@ general:
json:
type: item
edges:
-
how: all
source:
name: participant
target:
name: call
maps:
-
how: dict
- how: all
source:
name: participant
target:
name: call
-
type: item
descend_key: participants
maps:
- how: dict
name: call
- type: item
descend_key: participants
maps:
- type: list
maps:
-
type: list
maps:
-
type: item
maps:
-
how: dict
name: participant
- type: item
maps:
- how: dict
name: participant
vertex_collections:
collections:
call:
basename: calls
fields:
- id
- created_time
- id
- created_time
index:
- id
- id
participant:
basename: participants
fields:
- id
- participant_type
- id
- participant_type
index:
- id
- id
extra_index:
-
type: hash
unique: false
fields:
- issn
- type: hash
unique: false
fields:
- issn
dummy:
basename: dummies

122 changes: 57 additions & 65 deletions conf/json/kg_v0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ general:
json:
type: item
weights:
- source:
name: concept
target:
name: concept
vertex:
- name: publication
field: id
- source:
name: concept
target:
name: concept
vertex:
- name: publication
mapper:
id: publication

edges:
-
how: all
source:
name: publication
target:
name: concept
anchor: meta
fields:
- anchor
- how: all
source:
name: publication
target:
name: concept
anchor: meta
fields:
- anchor
# weights:
# - source:
# name: publication
Expand All @@ -31,68 +32,59 @@ json:
# condition:
# anchor: main
maps:
-
how: dict
name: publication
map:
publication_id: id
- how: dict
name: publication
map:
publication_id: id

-
type: item
descend_key: triples
- type: item
descend_key: triples
maps:
- type: list
maps:
-
type: list
- type: item
edges:
- how: all
source:
name: concept
anchor: meta
target:
name: concept
anchor: core
weight_exclusive:
- tritype
maps:
- type: item
descend_key: triple_meta
maps:
- how: dict
__extra:
anchor: meta
name: concept
- type: list
descend_key: triple
maps:
-
type: item
edges:
-
how: all
source:
name: concept
anchor: meta
target:
name: concept
anchor: core
weight_exclusive:
- tritype
maps:
-
type: item
descend_key: triple_meta
maps:
-
how: dict
__extra:
anchor: meta
name: concept
-
type: list
descend_key: triple
maps:
-
how: dict
__extra:
anchor: core
name: concept
map:
type: tritype
- how: dict
__extra:
anchor: core
name: concept
map:
type: tritype


vertex_collections:
collections:
publication:
basename: publications
fields:
- id
- id
index:
- id
- id
concept:
basename: concepts
fields:
- hash
- text
- hash
- text
index:
- hash
- hash

Loading