diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..c642d5ef --- /dev/null +++ b/.coveragerc @@ -0,0 +1,18 @@ +[run] +omit = + tests/* + +[report] +exclude_lines = + pragma: no cover + def __repr__ + if self.debug: + if settings.DEBUG + raise AssertionError + raise NotImplementedError + if 0: + if __name__ == .__main__.: + if TYPE_CHECKING: + class .*\bProtocol\): + @(abc\.)?abstractmethod + pass \ No newline at end of file diff --git a/.github/workflows/github-actions-python-package.yml b/.github/workflows/github-actions-python-package.yml index 98cbd177..0fd92566 100644 --- a/.github/workflows/github-actions-python-package.yml +++ b/.github/workflows/github-actions-python-package.yml @@ -27,3 +27,8 @@ jobs: run: | wget https://files.dice-research.org/datasets/dice-embeddings/KGs.zip --no-check-certificate && unzip KGs.zip python -m pytest -p no:warnings -x + - name: Coverage report + run: | + pip install coverage + coverage run -m pytest + coverage report -m \ No newline at end of file diff --git a/README.md b/README.md index 73192d29..f7cccec2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +[![Coverage](https://img.shields.io/badge/coverage-54%25-green)](https://dice-group.github.io/dice-embeddings/usage/main.html#coverage-report) +[![Pypi](https://img.shields.io/badge/pypi-0.1.4-blue)](https://pypi.org/project/dicee/0.1.4/) +[![Docs](https://img.shields.io/badge/documentation-0.1.4-yellow)](https://dice-group.github.io/dice-embeddings/index.html) + + # DICE Embeddings: Hardware-agnostic Framework for Large-scale Knowledge Graph Embeddings Knowledge graph embedding research has mainly focused on learning continuous representations of knowledge graphs towards the link prediction problem. diff --git a/docs/usage/main.md b/docs/usage/main.md index 9f89c45d..c8af55bc 100644 --- a/docs/usage/main.md +++ b/docs/usage/main.md @@ -324,6 +324,52 @@ To test the Docker image: docker run --rm -v ~/.local/share/dicee/KGs:/dicee/KGs dice-embeddings ./main.py --model AConEx --embedding_dim 16 ``` +## Coverage Report + +The coverage report is generated using [coverage.py](https://coverage.readthedocs.io/en/7.6.0/): + +``` +Name Stmts Miss Cover Missing +------------------------------------------------------------------------------------ +dicee/__init__.py 7 0 100% +dicee/abstracts.py 201 82 59% 104-105, 123, 146-147, 152, 165, 197, 240-254, 257-260, 263-266, 301, 314-317, 320-324, 364-375, 390-398, 413, 424-428, 555-575, 581-585, 589-591 +dicee/callbacks.py 245 102 58% 50-55, 67-73, 76, 88-93, 98-103, 106-109, 116-133, 138-142, 146-147, 276-280, 286-287, 305-311, 314, 319-320, 332-338, 344-353, 358-360, 405, 416-429, 433-468, 480-486 +dicee/config.py 93 2 98% 141-142 +dicee/dataset_classes.py 299 74 75% 41, 54, 87, 93, 99-106, 109, 112, 115-139, 195-201, 204, 207-209, 314, 325-328, 344, 410-411, 429, 528-536, 539, 543-557, 700-707, 710-714 +dicee/eval_static_funcs.py 227 95 58% 101, 106, 111, 258-353, 360-411 +dicee/evaluator.py 262 51 81% 46, 51, 56, 84, 89-90, 93, 109, 126, 137, 141, 146, 177-188, 195-206, 314, 344-367, 455, 465, 482-487 +dicee/executer.py 113 4 96% 116, 258-259, 291 +dicee/knowledge_graph.py 65 3 95% 79, 110, 114 +dicee/knowledge_graph_embeddings.py 636 443 30% 27, 30-31, 39-52, 57-90, 93-127, 131-139, 170-184, 215-228, 254-274, 324-327, 330-333, 346, 381-426, 484-486, 502-503, 509-517, 522-525, 528-533, 538, 547, 592-598, 630, 688-1053, 1084-1145, 1149-1177, 1200, 1227-1265 +dicee/models/__init__.py 9 0 100% +dicee/models/base_model.py 234 31 87% 54, 56, 82, 88-103, 157, 190, 230, 236, 245, 248, 252, 259, 263, 265, 280, 288-289, 296-297, 351, 354, 427, 439 +dicee/models/clifford.py 556 357 36% 31-42, 68-117, 122-133, 156-168, 190-220, 235, 237, 241, 248-249, 276-280, 303-311, 325-327, 332-333, 364-384, 406, 413, 417-478, 495-499, 511, 514, 519, 524, 571-607, 625-631, 644, 647, 652, 657, 686-692, 705, 708, 713, 718, 728-737, 753-754, 774-845, 856-859, 884-909, 933-966, 1002-1006, 1019, 1029, 1032, 1037, 1042, 1047, 1051, 1055, 1064-1065, 1095, 1102, 1107, 1135-1139, 1167-1176, 1186-1194, 1212-1214, 1232-1234, 1250-1252 +dicee/models/complex.py 151 15 90% 86-109 +dicee/models/dualE.py 59 10 83% 93-102, 142-156 +dicee/models/function_space.py 262 221 16% 10-24, 28-37, 40-49, 53-70, 77-86, 89-98, 101-110, 114-126, 134-156, 159-165, 168-185, 188-194, 197-205, 208, 213-234, 243-246, 250-254, 258-267, 271-292, 301-307, 311-328, 332-335, 344-352, 355, 366-372, 392-406, 424-438, 443-453, 461-465, 474-478 +dicee/models/octonion.py 227 83 63% 21-44, 320-329, 334-345, 348-370, 374-416, 426-474 +dicee/models/pykeen_models.py 50 5 90% 60-63, 118 +dicee/models/quaternion.py 192 69 64% 7-21, 30-55, 68-72, 107, 185, 328-342, 345-364, 368-389, 399-426 +dicee/models/real.py 61 12 80% 36-39, 66-69, 87, 103-106 +dicee/models/static_funcs.py 10 0 100% +dicee/models/transformers.py 236 189 20% 24-43, 46, 60-75, 84-102, 105-116, 123-125, 128, 134-151, 155-180, 186-190, 193-197, 203-207, 210-212, 229-256, 265-268, 271-276, 279-304, 310-315, 319-372, 376-398, 404-414 +dicee/query_generator.py 374 346 7% 18-52, 56, 62-65, 69-70, 78-92, 100-147, 155-188, 192-206, 212-269, 274-303, 307-443, 453-472, 480-501, 508-512, 517, 522-528 +dicee/read_preprocess_save_load_kg/__init__.py 3 0 100% +dicee/read_preprocess_save_load_kg/preprocess.py 256 41 84% 34, 40, 78, 102-127, 133, 138-151, 184, 214, 388-389, 444 +dicee/read_preprocess_save_load_kg/read_from_disk.py 36 11 69% 33, 38-40, 47, 55, 58-72 +dicee/read_preprocess_save_load_kg/save_load_disk.py 45 18 60% 39-60 +dicee/read_preprocess_save_load_kg/util.py 219 126 42% 65-67, 72-73, 91-97, 100-102, 107-109, 121, 134, 140-143, 148-156, 161-167, 172-177, 182-187, 199-220, 226-282, 286-290, 294-295, 299, 303-304, 334, 351, 356, 363-364 +dicee/sanity_checkers.py 54 23 57% 8-12, 21-31, 46, 51, 58, 64-79, 85, 89, 96 +dicee/static_funcs.py 418 163 61% 40, 50, 56-61, 83, 105-106, 115, 138, 152, 157-159, 163-165, 167, 194-198, 246, 254, 263-268, 290-304, 316-336, 340-357, 362, 386-387, 392-393, 410-411, 413-414, 416-417, 419-420, 428, 446-450, 467-470, 474-479, 483-487, 491-492, 498-500, 526-527, 539-542, 547-550, 559-610, 615-627, 644-658, 661-669 +dicee/static_funcs_training.py 123 63 49% 118-215, 223-224 +dicee/static_preprocess_funcs.py 100 44 56% 17-25, 52, 56, 64, 67, 78, 91-115, 120-123, 128-131, 136-139 +dicee/trainer/__init__.py 1 0 100% +dicee/trainer/dice_trainer.py 126 13 90% 27-32, 91, 98, 103-108, 147 +dicee/trainer/torch_trainer.py 79 4 95% 31, 196, 207-208 +dicee/trainer/torch_trainer_ddp.py 152 128 16% 13-14, 43, 47-72, 83-112, 131-137, 140-149, 164-194, 204-217, 226-246, 251-260, 263-272, 275-299, 302-309 +------------------------------------------------------------------------------------ +TOTAL 6181 2828 54% +``` ## How to cite Currently, we are working on our manuscript describing our framework.