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

Sourcery refactored xin branch #1

Open
wants to merge 1 commit into
base: xin
Choose a base branch
from
Open

Sourcery refactored xin branch #1

wants to merge 1 commit into from

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Jun 11, 2022

Branch xin refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the xin branch, then run:

git fetch origin sourcery/xin
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from xinetzone June 11, 2022 08:15
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

args = super().parse_args()
return args
return super().parse_args()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ArgParser.parse_args refactored with the following changes:

Comment on lines -93 to +92
raise Exception('No existing model_path: ' + args.model_path)
raise Exception(f'No existing model_path: {args.model_path}')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_logger refactored with the following changes:

Comment on lines -197 to +207
metrics = {}
logs = []
for i in range(args.num_proc):
for _ in range(args.num_proc):
log = queue.get()
logs = logs + log

for metric in logs[0].keys():
metrics[metric] = sum([log[metric] for log in logs]) / len(logs)
metrics = {
metric: sum(log[metric] for log in logs) / len(logs)
for metric in logs[0].keys()
}

for k, v in metrics.items():
print('Test average {} at [{}/{}]: {}'.format(k, args.step, args.max_step, v))
print(f'Test average {k} at [{args.step}/{args.max_step}]: {v}')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

Comment on lines -41 to +42
original_name = name[0:-6]
state_sum = target[original_name+'_state-data-']
original_name = name[:-6]
state_sum = target[f'{original_name}_state-data-']
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KGEServer._push_handler refactored with the following changes:

"""Get data from data_path/dataset/part_machine_id
"""Get data from data_path/dataset/part_machine_id
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_server_data refactored with the following changes:

Comment on lines -26 to +29
print('batch size ({}) is incompatible to the negative sample size ({}). Change the batch size to {}'.format(
old_batch_size, neg_sample_size, batch_size))
print(
f'batch size ({old_batch_size}) is incompatible to the negative sample size ({neg_sample_size}). Change the batch size to {batch_size}'
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_compatible_batch_size refactored with the following changes:

assert f_remote.status_code == 200, 'fail to open {}'.format(url)
assert f_remote.status_code == 200, f'fail to open {url}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _download_and_extract refactored with the following changes:

for i, l in enumerate(f):
pass
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _file_line refactored with the following changes:

Comment on lines -120 to +119
print('Reading {} triples....'.format(mode))
print(f'Reading {mode} triples....')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KGDataset.read_triple refactored with the following changes:

Comment on lines -167 to +166
print('Reading {} triples....'.format(mode))
print(f'Reading {mode} triples....')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PartitionKGDataset.read_triple refactored with the following changes:

Comment on lines -198 to +201
url = 'https://data.dgl.ai/dataset/{}.zip'.format(name)
url = f'https://data.dgl.ai/dataset/{name}.zip'

if not os.path.exists(os.path.join(path, name)):
print('File not found. Downloading from', url)
_download_and_extract(url, path, name + '.zip')
_download_and_extract(url, path, f'{name}.zip')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KGDatasetFB15k.__init__ refactored with the following changes:

Comment on lines -227 to +230
url = 'https://data.dgl.ai/dataset/{}.zip'.format(name)
url = f'https://data.dgl.ai/dataset/{name}.zip'

if not os.path.exists(os.path.join(path, name)):
print('File not found. Downloading from', url)
_download_and_extract(url, path, name + '.zip')
_download_and_extract(url, path, f'{name}.zip')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KGDatasetFB15k237.__init__ refactored with the following changes:

Comment on lines -256 to +259
url = 'https://data.dgl.ai/dataset/{}.zip'.format(name)
url = f'https://data.dgl.ai/dataset/{name}.zip'

if not os.path.exists(os.path.join(path, name)):
print('File not found. Downloading from', url)
_download_and_extract(url, path, name + '.zip')
_download_and_extract(url, path, f'{name}.zip')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KGDatasetWN18.__init__ refactored with the following changes:

Comment on lines -285 to +288
url = 'https://data.dgl.ai/dataset/{}.zip'.format(name)
url = f'https://data.dgl.ai/dataset/{name}.zip'

if not os.path.exists(os.path.join(path, name)):
print('File not found. Downloading from', url)
_download_and_extract(url, path, name + '.zip')
_download_and_extract(url, path, f'{name}.zip')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KGDatasetWN18rr.__init__ refactored with the following changes:

Comment on lines -313 to +316
url = 'https://data.dgl.ai/dataset/{}.zip'.format(name)
url = f'https://data.dgl.ai/dataset/{name}.zip'

if not os.path.exists(os.path.join(path, name)):
print('File not found. Downloading from', url)
_download_and_extract(url, path, '{}.zip'.format(name))
_download_and_extract(url, path, f'{name}.zip')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KGDatasetFreebase.__init__ refactored with the following changes:

Comment on lines -174 to +170
print('relation partition {} edges into {} parts'.format(len(heads), n))
print(f'relation partition {len(heads)} edges into {n} parts')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BalancedRelationPartition refactored with the following changes:

Comment on lines -262 to +255
print('random partition {} edges into {} parts'.format(len(heads), n))
print(f'random partition {len(heads)} edges into {n} parts')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function RandomPartition refactored with the following changes:

Comment on lines -627 to +620
raise Exception('get invalid type: ' + eval_type)
raise Exception(f'get invalid type: {eval_type}')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function EvalDataset.get_edges refactored with the following changes:

if model_name == 'RESCAL':
rel_dim = relation_dim * entity_dim
else:
rel_dim = relation_dim

rel_dim = relation_dim * entity_dim if model_name == 'RESCAL' else relation_dim
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KEModel.__init__ refactored with the following changes:

Comment on lines -160 to +162
self.entity_emb.save(path, dataset+'_'+self.model_name+'_entity')
self.entity_emb.save(path, f'{dataset}_{self.model_name}_entity')
if self.strict_rel_part or self.soft_rel_part:
self.global_relation_emb.save(path, dataset+'_'+self.model_name+'_relation')
self.global_relation_emb.save(path, f'{dataset}_{self.model_name}_relation')
else:
self.relation_emb.save(path, dataset+'_'+self.model_name+'_relation')
self.relation_emb.save(path, f'{dataset}_{self.model_name}_relation')

self.score_func.save(path, dataset+'_'+self.model_name)
self.score_func.save(path, f'{dataset}_{self.model_name}')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KEModel.save_emb refactored with the following changes:

Comment on lines -178 to +176
self.entity_emb.load(path, dataset+'_'+self.model_name+'_entity')
self.relation_emb.load(path, dataset+'_'+self.model_name+'_relation')
self.score_func.load(path, dataset+'_'+self.model_name)
self.entity_emb.load(path, f'{dataset}_{self.model_name}_entity')
self.relation_emb.load(path, f'{dataset}_{self.model_name}_relation')
self.score_func.load(path, f'{dataset}_{self.model_name}')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KEModel.load_emb refactored with the following changes:

if neg_deg_sample:
neg_g.neg_sample_size = neg_sample_size
mask = mask.reshape(num_chunks, chunk_size, neg_sample_size)
return neg_score * mask
else:
if not neg_deg_sample:
return neg_score
neg_g.neg_sample_size = neg_sample_size
mask = mask.reshape(num_chunks, chunk_size, neg_sample_size)
return neg_score * mask
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KEModel.predict_neg_score refactored with the following changes:

res = nd.sqrt(nd.clip(squared_res, 1e-30, np.finfo(np.float32).max))
return res
return nd.sqrt(nd.clip(squared_res, 1e-30, np.finfo(np.float32).max))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function batched_l2_dist refactored with the following changes:

Comment on lines -39 to +38
res = nd.norm(a - b, ord=1, axis=-1)
return res
return nd.norm(a - b, ord=1, axis=-1)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function batched_l1_dist refactored with the following changes:

Comment on lines -203 to +201
self.projection_emb.save(path, name+'projection')
self.projection_emb.save(path, f'{name}projection')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TransRScore.save refactored with the following changes:

Comment on lines -317 to +321
file_name = os.path.join(path, name+'.npy')
file_name = os.path.join(path, f'{name}.npy')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ExternalEmbedding.load refactored with the following changes:

Comment on lines -31 to +39
np.random.seed(42)

from models.mxnet.score_fun import *
from models.mxnet.tensor_models import ExternalEmbedding
else:
import torch as th
th.manual_seed(42)
np.random.seed(42)

from models.pytorch.score_fun import *
from models.pytorch.tensor_models import ExternalEmbedding
np.random.seed(42)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 31-39 refactored with the following changes:

Comment on lines -127 to +128
neg_score = self.head_neg_score(neg_head, rel, tail,
num_chunks, chunk_size, neg_sample_size)
return self.head_neg_score(
neg_head, rel, tail, num_chunks, chunk_size, neg_sample_size
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BaseKEModel.predict_neg_score refactored with the following changes:

assert f_remote.status_code == 200, 'fail to open {}'.format(url)
assert f_remote.status_code == 200, f'fail to open {url}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function _download refactored with the following changes:

bin_path = "/tmp/dataset/livejournal/livejournal_{}.bin".format(format)
bin_path = f"/tmp/dataset/livejournal/livejournal_{format}.bin"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_graph refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Jun 11, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.11%.

Quality metrics Before After Change
Complexity 7.87 ⭐ 7.73 ⭐ -0.14 👍
Method Length 74.26 🙂 74.06 🙂 -0.20 👍
Working memory 12.13 😞 12.22 😞 0.09 👎
Quality 57.01% 🙂 56.90% 🙂 -0.11% 👎
Other metrics Before After Change
Lines 13535 13470 -65
Changed files Quality Before Quality After Quality Change
apps/kg/eval.py 43.37% 😞 44.10% 😞 0.73% 👍
apps/kg/kvserver.py 71.86% 🙂 71.82% 🙂 -0.04% 👎
apps/kg/partition.py 45.99% 😞 43.46% 😞 -2.53% 👎
apps/kg/train.py 25.70% 😞 25.68% 😞 -0.02% 👎
apps/kg/train_mxnet.py 44.09% 😞 42.87% 😞 -1.22% 👎
apps/kg/train_pytorch.py 26.79% 😞 26.89% 😞 0.10% 👍
apps/kg/utils.py 85.03% ⭐ 81.91% ⭐ -3.12% 👎
apps/kg/dataloader/KGDataset.py 68.38% 🙂 68.66% 🙂 0.28% 👍
apps/kg/dataloader/sampler.py 44.33% 😞 44.94% 😞 0.61% 👍
apps/kg/models/general_models.py 52.17% 🙂 53.01% 🙂 0.84% 👍
apps/kg/models/mxnet/score_fun.py 68.57% 🙂 68.56% 🙂 -0.01% 👎
apps/kg/models/mxnet/tensor_models.py 73.41% 🙂 73.40% 🙂 -0.01% 👎
apps/kg/models/pytorch/score_fun.py 74.24% 🙂 74.22% 🙂 -0.02% 👎
apps/kg/models/pytorch/tensor_models.py 62.02% 🙂 62.04% 🙂 0.02% 👍
apps/kg/tests/test_score.py 66.69% 🙂 67.19% 🙂 0.50% 👍
benchmarks/benchmarks/utils.py 72.78% 🙂 72.70% 🙂 -0.08% 👎
benchmarks/benchmarks/api/bench_add_self_loop.py 79.84% ⭐ 79.84% ⭐ 0.00%
benchmarks/benchmarks/api/bench_batch.py 77.07% ⭐ 77.21% ⭐ 0.14% 👍
benchmarks/benchmarks/api/bench_builtin_apply_edges.py 67.32% 🙂 67.32% 🙂 0.00%
benchmarks/benchmarks/api/bench_builtin_apply_edges_hetero.py 53.22% 🙂 53.22% 🙂 0.00%
benchmarks/benchmarks/api/bench_builtin_multi_update_all.py 51.34% 🙂 52.56% 🙂 1.22% 👍
benchmarks/benchmarks/api/bench_builtin_update_all_coo.py 61.44% 🙂 61.44% 🙂 0.00%
benchmarks/benchmarks/api/bench_builtin_update_all_csc.py 59.83% 🙂 59.83% 🙂 0.00%
benchmarks/benchmarks/api/bench_edge_ids.py 58.21% 🙂 58.21% 🙂 0.00%
benchmarks/benchmarks/api/bench_edge_subgraph.py 73.35% 🙂 73.35% 🙂 0.00%
benchmarks/benchmarks/api/bench_find_edges.py 63.52% 🙂 63.52% 🙂 0.00%
benchmarks/benchmarks/api/bench_format_conversion.py 70.67% 🙂 70.67% 🙂 0.00%
benchmarks/benchmarks/api/bench_heterograph_construction.py 70.73% 🙂 70.73% 🙂 0.00%
benchmarks/benchmarks/api/bench_homograph_edge_construction.py 76.32% ⭐ 76.32% ⭐ 0.00%
benchmarks/benchmarks/api/bench_homograph_scipy_construction.py 72.33% 🙂 72.33% 🙂 0.00%
benchmarks/benchmarks/api/bench_in_degrees.py 64.41% 🙂 64.41% 🙂 0.00%
benchmarks/benchmarks/api/bench_in_edges.py 64.41% 🙂 64.41% 🙂 0.00%
benchmarks/benchmarks/api/bench_in_subgraph.py 74.04% 🙂 74.04% 🙂 0.00%
benchmarks/benchmarks/api/bench_khop.py 75.88% ⭐ 75.88% ⭐ 0.00%
benchmarks/benchmarks/api/bench_knn_graph.py 64.01% 🙂 64.01% 🙂 0.00%
benchmarks/benchmarks/api/bench_metis_partition.py 77.47% ⭐ 77.47% ⭐ 0.00%
benchmarks/benchmarks/api/bench_nn_graphconv.py 63.90% 🙂 63.90% 🙂 0.00%
benchmarks/benchmarks/api/bench_nn_heterographconv.py 53.81% 🙂 53.81% 🙂 0.00%
benchmarks/benchmarks/api/bench_node_subgraph.py 73.90% 🙂 73.90% 🙂 0.00%
benchmarks/benchmarks/api/bench_random_walk.py 74.94% 🙂 74.94% 🙂 0.00%
benchmarks/benchmarks/api/bench_readout.py 41.80% 😞 43.29% 😞 1.49% 👍
benchmarks/benchmarks/api/bench_reverse.py 73.67% 🙂 73.67% 🙂 0.00%
benchmarks/benchmarks/api/bench_sample_neighbors.py 66.32% 🙂 66.32% 🙂 0.00%
benchmarks/benchmarks/api/bench_to_block.py 67.55% 🙂 67.55% 🙂 0.00%
benchmarks/benchmarks/api/bench_udf_apply_edges.py 65.30% 🙂 65.30% 🙂 0.00%
benchmarks/benchmarks/api/bench_udf_multi_update_all.py 50.45% 🙂 50.07% 🙂 -0.38% 👎
benchmarks/benchmarks/api/bench_udf_update_all.py 52.51% 🙂 52.51% 🙂 0.00%
benchmarks/benchmarks/api/bench_unbatch.py 78.79% ⭐ 78.94% ⭐ 0.15% 👍
benchmarks/benchmarks/kernel/bench_edgesoftmax.py 68.93% 🙂 68.93% 🙂 0.00%
benchmarks/benchmarks/kernel/bench_gsddmm_u_dot_v.py 65.32% 🙂 67.09% 🙂 1.77% 👍
benchmarks/benchmarks/kernel/bench_gspmm_copy_u.py 64.64% 🙂 64.64% 🙂 0.00%
benchmarks/benchmarks/kernel/bench_gspmm_u_mul_e_sum.py 60.91% 🙂 62.57% 🙂 1.66% 👍
benchmarks/benchmarks/model_acc/bench_gat.py 64.47% 🙂 64.70% 🙂 0.23% 👍
benchmarks/benchmarks/model_acc/bench_gcn.py 64.62% 🙂 64.95% 🙂 0.33% 👍
benchmarks/benchmarks/model_acc/bench_gcn_udf.py 69.22% 🙂 69.50% 🙂 0.28% 👍
benchmarks/benchmarks/model_acc/bench_rgcn.py 41.09% 😞 41.29% 😞 0.20% 👍
benchmarks/benchmarks/model_acc/bench_rgcn_ns.py 38.96% 😞 39.16% 😞 0.20% 👍
benchmarks/benchmarks/model_acc/bench_sage.py 66.91% 🙂 67.26% 🙂 0.35% 👍
benchmarks/benchmarks/model_acc/bench_sage_ns.py 52.32% 🙂 52.78% 🙂 0.46% 👍
benchmarks/benchmarks/model_speed/bench_gat.py 55.03% 🙂 55.75% 🙂 0.72% 👍
benchmarks/benchmarks/model_speed/bench_gat_ns.py 49.55% 😞 49.55% 😞 0.00%
benchmarks/benchmarks/model_speed/bench_gcn_udf.py 63.73% 🙂 64.39% 🙂 0.66% 👍
benchmarks/benchmarks/model_speed/bench_pinsage.py 69.43% 🙂 69.42% 🙂 -0.01% 👎
benchmarks/benchmarks/model_speed/bench_rgcn.py 35.29% 😞 36.29% 😞 1.00% 👍
benchmarks/benchmarks/model_speed/bench_rgcn_hetero_ns.py 45.23% 😞 44.34% 😞 -0.89% 👎
benchmarks/benchmarks/model_speed/bench_rgcn_homogeneous_ns.py 35.86% 😞 35.83% 😞 -0.03% 👎
benchmarks/benchmarks/model_speed/bench_sage.py 58.83% 🙂 58.83% 🙂 0.00%
benchmarks/benchmarks/model_speed/bench_sage_ns.py 51.63% 🙂 51.63% 🙂 0.00%
benchmarks/benchmarks/model_speed/bench_sage_unsupervised_ns.py 56.54% 🙂 55.84% 🙂 -0.70% 👎
benchmarks/benchmarks/multigpu/bench_multigpu_rgcn.py 21.97% ⛔ 21.97% ⛔ 0.00%
benchmarks/benchmarks/multigpu/bench_multigpu_sage.py 48.58% 😞 48.50% 😞 -0.08% 👎
benchmarks/benchmarks/multigpu/rgcn_model.py 70.61% 🙂 69.96% 🙂 -0.65% 👎
benchmarks/scripts/generate_excel.py 58.49% 🙂 58.46% 🙂 -0.03% 👎
benchmarks/scripts/replace_branch.py 47.30% 😞 44.33% 😞 -2.97% 👎
dglgo/dglgo/cli/export_cli.py 82.09% ⭐ 81.89% ⭐ -0.20% 👎
dglgo/dglgo/cli/recipe_cli.py 75.81% ⭐ 73.77% 🙂 -2.04% 👎
dglgo/dglgo/model/edge_encoder/bilinear.py 78.46% ⭐ 79.22% ⭐ 0.76% 👍
dglgo/dglgo/model/edge_encoder/dot.py 80.03% ⭐ 81.07% ⭐ 1.04% 👍
dglgo/dglgo/model/graph_encoder/pna.py 69.19% 🙂 69.22% 🙂 0.03% 👍
dglgo/dglgo/model/node_encoder/gat.py 61.61% 🙂 60.95% 🙂 -0.66% 👎
dglgo/dglgo/pipeline/graphpred/gen.py 71.01% 🙂 70.28% 🙂 -0.73% 👎
dglgo/dglgo/pipeline/linkpred/gen.py 64.38% 🙂 62.09% 🙂 -2.29% 👎
dglgo/dglgo/pipeline/nodepred/gen.py 69.44% 🙂 68.67% 🙂 -0.77% 👎
dglgo/dglgo/pipeline/nodepred_sample/gen.py 65.44% 🙂 64.83% 🙂 -0.61% 👎
dglgo/dglgo/utils/factory.py 85.56% ⭐ 86.37% ⭐ 0.81% 👍
dglgo/tests/test_pipeline.py 69.80% 🙂 69.70% 🙂 -0.10% 👎
docs/source/conf.py 60.43% 🙂 60.43% 🙂 0.00%
examples/mxnet/_deprecated/gcmc/data.py 45.47% 😞 45.73% 😞 0.26% 👍
examples/mxnet/_deprecated/gcmc/model.py 54.07% 🙂 53.02% 🙂 -1.05% 👎
examples/mxnet/_deprecated/gcmc/train.py 33.82% 😞 33.52% 😞 -0.30% 👎
examples/mxnet/_deprecated/gcmc/utils.py 84.76% ⭐ 85.75% ⭐ 0.99% 👍
examples/mxnet/_deprecated/sampling/gcn_cv_sc.py 39.91% 😞 39.27% 😞 -0.64% 👎
examples/mxnet/_deprecated/sampling/gcn_ns_sc.py 56.59% 🙂 56.66% 🙂 0.07% 👍
examples/mxnet/_deprecated/sampling/graphsage_cv.py 42.27% 😞 42.27% 😞 0.00%
examples/mxnet/_deprecated/sampling/multi_process_train.py 58.69% 🙂 59.82% 🙂 1.13% 👍
examples/mxnet/_deprecated/sampling/run_store_server.py 55.85% 🙂 55.82% 🙂 -0.03% 👎
examples/mxnet/_deprecated/sampling/train.py 52.40% 🙂 53.57% 🙂 1.17% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
apps/kg/train.py run 68 ⛔ 928 ⛔ 30 ⛔ 1.99% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
apps/kg/train_pytorch.py train 43 ⛔ 454 ⛔ 26 ⛔ 7.11% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
benchmarks/benchmarks/multigpu/bench_multigpu_rgcn.py run 42 ⛔ 692 ⛔ 23 ⛔ 7.65% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
apps/kg/train_pytorch.py dist_train_test 42 ⛔ 523 ⛔ 21 ⛔ 8.90% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
examples/mxnet/_deprecated/sampling/graphsage_cv.py graphsage_cv_train 35 ⛔ 673 ⛔ 22 ⛔ 10.40% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants