From 642bfc47ea981f4328c95aa42ed5e9bd2cb4e3a3 Mon Sep 17 00:00:00 2001
From: Thuan Nguyen
Date: Fri, 26 Jan 2018 10:17:47 -0800
Subject: [PATCH] Cpp python style check (#215)
* Add C++ and python style check to travis.
* Update all C++/python code that violate coding standards.
---
.clang_format.hook | 7 +-
.flake8 | 2 +
.pre-commit-config.yaml | 12 +-
.travis.yml | 8 +-
demo/README.md | 10 +-
demo/mxnet/mxnet_demo.py | 41 +-
.../cifar10_image_classification_vgg.py | 26 +-
demo/vdl_scratch.py | 19 +-
docs/README.md | 12 +-
docs/graph_data_format.md | 5 +-
docs/introduction/introduction_en.md | 20 +-
docs/quick_start_cn.md | 2 +-
docs/quick_start_en.md | 12 +-
frontend/mock/API.md | 2 +-
.../mock/data/plugin/histograms/histograms.js | 400 +++++++++---------
frontend/mock/data/plugin/images/images.js | 2 -
.../component/Notification/Notification.md | 3 -
frontend/src/scalars/index.js | 2 -
frontend/src/service.js | 1 -
setup.py | 4 +-
travis/check_style.sh | 23 +
visualdl/__init__.py | 2 +-
visualdl/logic/histogram.h | 2 +-
visualdl/logic/sdk.cc | 3 +-
visualdl/python/cache.py | 6 +-
visualdl/python/storage.py | 6 +-
visualdl/python/test_storage.py | 1 -
visualdl/server/graph.py | 29 +-
visualdl/server/graph_test.py | 3 +-
visualdl/server/graph_test.sh | 1 -
visualdl/server/graphviz_graph.py | 5 +-
visualdl/server/lib.py | 15 +-
visualdl/server/lib_test.py | 1 +
visualdl/server/mock/data.py | 2 +-
visualdl/server/mock/download_mock_models.sh | 1 -
visualdl/server/setup.py | 7 +-
visualdl/server/storage_mock.py | 5 +-
visualdl/storage/storage.h | 2 +-
visualdl/storage/tablet.h | 3 +-
visualdl/test.py | 5 +-
visualdl/utils/concurrency.h | 2 +-
visualdl/utils/test_concurrency.cc | 2 +-
visualdl/utils/test_image.cc | 1 -
43 files changed, 377 insertions(+), 340 deletions(-)
create mode 100644 .flake8
create mode 100755 travis/check_style.sh
diff --git a/.clang_format.hook b/.clang_format.hook
index 1d928216..41af31f2 100755
--- a/.clang_format.hook
+++ b/.clang_format.hook
@@ -1,13 +1,14 @@
#!/bin/bash
set -e
-readonly VERSION="3.8"
+readonly SUPPORTED_VERSION="3.8"
+
version=$(clang-format -version)
-if ! [[ $version == *"$VERSION"* ]]; then
+if ! [[ $version == *"$SUPPORTED_VERSION"* ]]; then
echo "clang-format version check failed."
- echo "a version contains '$VERSION' is needed, but get '$version'"
+ echo "a version contains '$SUPPORTED_VERSION' is needed, but get '$version'"
echo "you can install the right version, and make an soft-link to '\$PATH' env"
exit -1
fi
diff --git a/.flake8 b/.flake8
new file mode 100644
index 00000000..79a16af7
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,2 @@
+[flake8]
+max-line-length = 120
\ No newline at end of file
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7cfe3b54..f70fa5d4 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -22,4 +22,14 @@
description: Format files with ClangFormat.
entry: bash ./.clang_format.hook -i
language: system
- files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto)$
+ files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$
+
+
+- repo: local
+ hooks:
+ - id: python-format-checker
+ name: python-format-checker
+ description: Format python files using PEP8 standard
+ entry: flake8
+ language: system
+ files: \.(py)$
diff --git a/.travis.yml b/.travis.yml
index dfdb03a2..076f70ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,6 +13,10 @@ os:
# TODO(ChunweiYan) support osx in the future
#- osx
+env:
+ - JOB=check_style
+ - JOB=test
+
addons:
apt:
packages:
@@ -29,12 +33,14 @@ addons:
- nodejs
before_install:
+ - if [[ "$JOB" == "check_style" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; sudo pip install pre-commit flake8; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install brew-pip; fi
script:
- /bin/bash ./tests.sh all
+ - if [[ "$JOB" == "check_style" ]]; then ./travis/check_style.sh; fi
+ - if [[ "$JOB" == "test" ]]; then /bin/bash ./tests.sh all; fi
notifications:
email:
diff --git a/demo/README.md b/demo/README.md
index 08ca00aa..4720b53b 100644
--- a/demo/README.md
+++ b/demo/README.md
@@ -1,19 +1,19 @@
# VisualDL demos
-VisualDL supports Python and C++ based DL frameworks,
+VisualDL supports Python and C++ based DL frameworks,
there are several demos for different platforms.
## PaddlePaddle
Locates in `./paddle`.
-This is a visualization for `resnet` on `cifar10` dataset, we visualize the CONV parameters,
+This is a visualization for `resnet` on `cifar10` dataset, we visualize the CONV parameters,
and there are some interesting patterns.
## PyTorch GAN
Locates in `./pytorch-CycleGAN-and-pix2pix`.
This submodule is forked from [pytorch-CycleGAN-and-pix2pix](
-https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix),
+https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix),
great model and the generated fake images are really funny.
This demo only works with CycleGAN mode, read [CycleGAN train doc](https://github.com/Superjomn/pytorch-CycleGAN-and-pix2pix#cyclegan-traintest) and [changes to the original code](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/compare/master...Superjomn:master) for more information.
@@ -21,7 +21,7 @@ This demo only works with CycleGAN mode, read [CycleGAN train doc](https://githu
## MxNet Mnist
Locates in `./mxnet_demo`.
-By adding VisualDL as callbacks to `model.fit`,
-we can use the Python SDK in MxNet,
+By adding VisualDL as callbacks to `model.fit`,
+we can use the Python SDK in MxNet,
but it seems that only the outside program can only retrieve parameters in epoch callbacks,
that limits the number of steps for visualization.
diff --git a/demo/mxnet/mxnet_demo.py b/demo/mxnet/mxnet_demo.py
index 1575aad5..b5984713 100644
--- a/demo/mxnet/mxnet_demo.py
+++ b/demo/mxnet/mxnet_demo.py
@@ -1,5 +1,3 @@
-import numpy as np
-import mxnet as mx
import logging
import mxnet as mx
@@ -10,7 +8,6 @@ from visualdl import LogWriter
mnist = mx.test_utils.get_mnist()
batch_size = 100
-
# Provide a folder to store data for log, model, image, etc. VisualDL's visualization will be
# based on this folder.
logdir = "./tmp"
@@ -44,8 +41,10 @@ def add_scalar():
for name, value in name_value:
scalar0.add_record(cnt_step, value)
cnt_step += 1
+
return _callback
+
def add_image_histogram():
def _callback(iter_no, sym, arg, aux):
image0.start_sampling()
@@ -57,6 +56,7 @@ def add_image_histogram():
histogram0.add_record(iter_no, list(data))
image0.finish_sampling()
+
return _callback
@@ -65,18 +65,22 @@ def add_image_histogram():
logging.getLogger().setLevel(logging.DEBUG) # logging to stdout
-train_iter = mx.io.NDArrayIter(mnist['train_data'], mnist['train_label'], batch_size, shuffle=True)
-val_iter = mx.io.NDArrayIter(mnist['test_data'], mnist['test_label'], batch_size)
+train_iter = mx.io.NDArrayIter(
+ mnist['train_data'], mnist['train_label'], batch_size, shuffle=True)
+val_iter = mx.io.NDArrayIter(mnist['test_data'], mnist['test_label'],
+ batch_size)
data = mx.sym.var('data')
# first conv layer
conv1 = mx.sym.Convolution(data=data, kernel=(5, 5), num_filter=20)
tanh1 = mx.sym.Activation(data=conv1, act_type="tanh")
-pool1 = mx.sym.Pooling(data=tanh1, pool_type="max", kernel=(2, 2), stride=(2, 2))
+pool1 = mx.sym.Pooling(
+ data=tanh1, pool_type="max", kernel=(2, 2), stride=(2, 2))
# second conv layer
conv2 = mx.sym.Convolution(data=pool1, kernel=(5, 5), num_filter=50)
tanh2 = mx.sym.Activation(data=conv2, act_type="tanh")
-pool2 = mx.sym.Pooling(data=tanh2, pool_type="max", kernel=(2, 2), stride=(2, 2))
+pool2 = mx.sym.Pooling(
+ data=tanh2, pool_type="max", kernel=(2, 2), stride=(2, 2))
# first fullc layer
flatten = mx.sym.flatten(data=pool2)
fc1 = mx.symbol.FullyConnected(data=flatten, num_hidden=500)
@@ -89,21 +93,22 @@ lenet = mx.sym.SoftmaxOutput(data=fc2, name='softmax')
# create a trainable module on CPU
lenet_model = mx.mod.Module(symbol=lenet, context=mx.cpu())
-
# train with the same
-lenet_model.fit(train_iter,
- eval_data=val_iter,
- optimizer='sgd',
- optimizer_params={'learning_rate': 0.1},
- eval_metric='acc',
- # integrate our customized callback method
- batch_end_callback=[add_scalar()],
- epoch_end_callback=[add_image_histogram()],
- num_epoch=5)
+lenet_model.fit(
+ train_iter,
+ eval_data=val_iter,
+ optimizer='sgd',
+ optimizer_params={'learning_rate': 0.1},
+ eval_metric='acc',
+ # integrate our customized callback method
+ batch_end_callback=[add_scalar()],
+ epoch_end_callback=[add_image_histogram()],
+ num_epoch=5)
test_iter = mx.io.NDArrayIter(mnist['test_data'], None, batch_size)
prob = lenet_model.predict(test_iter)
-test_iter = mx.io.NDArrayIter(mnist['test_data'], mnist['test_label'], batch_size)
+test_iter = mx.io.NDArrayIter(mnist['test_data'], mnist['test_label'],
+ batch_size)
# predict accuracy for lenet
acc = mx.metric.Accuracy()
diff --git a/demo/paddle/cifar10_image_classification_vgg.py b/demo/paddle/cifar10_image_classification_vgg.py
index 976c98a7..e2102303 100644
--- a/demo/paddle/cifar10_image_classification_vgg.py
+++ b/demo/paddle/cifar10_image_classification_vgg.py
@@ -117,8 +117,11 @@ elif net_type == "resnet":
else:
raise ValueError("%s network is not supported" % net_type)
-predict = fluid.layers.fc(input=net, size=classdim, act='softmax',
- param_attr=ParamAttr(name="param1", initializer=NormalInitializer()))
+predict = fluid.layers.fc(
+ input=net,
+ size=classdim,
+ act='softmax',
+ param_attr=ParamAttr(name="param1", initializer=NormalInitializer()))
cost = fluid.layers.cross_entropy(input=predict, label=label)
avg_cost = fluid.layers.mean(x=cost)
@@ -131,8 +134,7 @@ BATCH_SIZE = 16
PASS_NUM = 1
train_reader = paddle.batch(
- paddle.reader.shuffle(
- paddle.dataset.cifar.train10(), buf_size=128 * 10),
+ paddle.reader.shuffle(paddle.dataset.cifar.train10(), buf_size=128 * 10),
batch_size=BATCH_SIZE)
place = fluid.CPUPlace()
@@ -150,9 +152,10 @@ param1_var = start_up_program.global_block().var("param1")
for pass_id in range(PASS_NUM):
accuracy.reset(exe)
for data in train_reader():
- loss, conv1_out, param1, acc = exe.run(fluid.default_main_program(),
- feed=feeder.feed(data),
- fetch_list=[avg_cost, conv1, param1_var] + accuracy.metrics)
+ loss, conv1_out, param1, acc = exe.run(
+ fluid.default_main_program(),
+ feed=feeder.feed(data),
+ fetch_list=[avg_cost, conv1, param1_var] + accuracy.metrics)
pass_acc = accuracy.eval(exe)
if sample_num == 0:
@@ -165,11 +168,14 @@ for pass_id in range(PASS_NUM):
idx = idx1
if idx != -1:
image_data = data[0][0]
- input_image_data = np.transpose(image_data.reshape(data_shape), axes=[1, 2, 0])
- input_image.set_sample(idx, input_image_data.shape, input_image_data.flatten())
+ input_image_data = np.transpose(
+ image_data.reshape(data_shape), axes=[1, 2, 0])
+ input_image.set_sample(idx, input_image_data.shape,
+ input_image_data.flatten())
conv_image_data = conv1_out[0][0]
- conv_image.set_sample(idx, conv_image_data.shape, conv_image_data.flatten())
+ conv_image.set_sample(idx, conv_image_data.shape,
+ conv_image_data.flatten())
sample_num += 1
if sample_num % num_samples == 0:
diff --git a/demo/vdl_scratch.py b/demo/vdl_scratch.py
index e8bec7b5..df95b10a 100644
--- a/demo/vdl_scratch.py
+++ b/demo/vdl_scratch.py
@@ -1,13 +1,9 @@
#!/user/bin/env python
-import math
import os
import random
-import subprocess
-
import numpy as np
from PIL import Image
-from scipy.stats import norm
from visualdl import ROOT, LogWriter
from visualdl.server.log import logger as log
@@ -44,10 +40,10 @@ with logw.mode('train') as logger:
for step in range(1, 50):
histogram0.add_record(step,
- np.random.normal(
- 0.1 + step * 0.003,
- 200. / (120 + step),
- size=1000))
+ np.random.normal(
+ 0.1 + step * 0.003,
+ 200. / (120 + step),
+ size=1000))
# create image
with logw.mode("train") as logger:
image = logger.image("scratch/dog", 4) # randomly sample 4 images one pass
@@ -70,11 +66,10 @@ with logw.mode("train") as logger:
# a more efficient way to sample images
# check whether this image will be taken by reservoir sampling
- idx = image.is_sample_taken()
+ idx = image.is_sample_taken()
if idx >= 0:
data = np.array(
- dog_jpg.crop((left_x, left_y, right_x,
- right_y))).flatten()
+ dog_jpg.crop((left_x, left_y, right_x, right_y))).flatten()
# add this image to log
image.set_sample(idx, target_shape, data)
# you can also just write followig codes, it is more clear, but need to
@@ -95,6 +90,7 @@ with logw.mode("train") as logger:
image0.add_sample(shape, list(data))
image0.finish_sampling()
+
def download_graph_image():
'''
This is a scratch demo, it do not generate a ONNX proto, but just download an image
@@ -110,4 +106,5 @@ def download_graph_image():
f.write(graph_image)
log.warning('graph ready!')
+
download_graph_image()
diff --git a/docs/README.md b/docs/README.md
index 8825363c..d631d972 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -9,7 +9,7 @@ Most of the DNN platforms are using Python. VisualDL supports Python out of the
By just adding a few lines of configuration to the code, VisualDL can provide a rich visual support for the training process.
In addition to Python SDK, the underlying VisualDL is written in C++, and its exposed C++ SDK can be integrated into other platforms.
-Users can access the original features and monitor customized matrix.
+Users can access the original features and monitor customized matrix.
## Components
VisualDL supports four componments:
@@ -27,7 +27,7 @@ Compatible with ONNX (Open Neural Network Exchange) [https://github.com/onnx/onn
### scalar
-Show the error trend throughout the training.
+Show the error trend throughout the training.
@@ -64,7 +64,7 @@ logger = LogWriter(dir, sync_cycle=10)
with logger.mode("train"):
# create a scalar component called 'scalars/scalar0'
scalar0 = logger.scalar("scalars/scalar0")
-
+
# add some records during DL model running, lets start from another block.
with logger.mode("train"):
@@ -86,12 +86,12 @@ namespace cp = visualdl::components;
int main() {
const std::string dir = "./tmp";
vs::LogWriter logger(dir, 10);
-
+
logger.SetMode("train");
auto tablet = logger.AddTablet("scalars/scalar0");
-
+
cp::Scalar scalar0(tablet);
-
+
for (int step = 0; step < 1000; step++) {
float v = (float)std::rand() / RAND_MAX;
scalar0.AddRecord(step, v);
diff --git a/docs/graph_data_format.md b/docs/graph_data_format.md
index 4dd3cec9..d01c03a4 100644
--- a/docs/graph_data_format.md
+++ b/docs/graph_data_format.md
@@ -8,7 +8,7 @@ Facebook has an open-source project called [ONNX](http://onnx.ai/)(Open Neural N
## IR of ONNX
The description of ONNX IR can be found [here](https://github.com/onnx/onnx/blob/master/docs/IR.md). The most important part is the definition of [Graph](https://github.com/onnx/onnx/blob/master/docs/IR.md#graphs).
-Each computation data flow graph is structured as a list of nodes that form the graph. Each node is called an operator. Nodes have zero or more inputs, one or more outputs, and zero or more attribute-value pairs.
+Each computation data flow graph is structured as a list of nodes that form the graph. Each node is called an operator. Nodes have zero or more inputs, one or more outputs, and zero or more attribute-value pairs.
## Rest API data format
Frontend uses rest API to get data from the server. The data format will be JSON. The data structure of a Graph is as below. Each Graph has three vectors:
@@ -112,6 +112,3 @@ Frontend uses rest API to get data from the server. The data format will be JSON
]
}
```
-
-
-
diff --git a/docs/introduction/introduction_en.md b/docs/introduction/introduction_en.md
index 65d7bd51..f9af1a43 100644
--- a/docs/introduction/introduction_en.md
+++ b/docs/introduction/introduction_en.md
@@ -1,7 +1,7 @@
## Visual DL
`Visual DL`: makes your deep learning jobs more alive via visualization.
-At present, most deep learning frameworks are using Python. The status of training process is recorded
+At present, most deep learning frameworks are using Python. The status of training process is recorded
by logs. A sample log is as follow:
@@ -22,7 +22,7 @@ Visual DL can help you visualize the whole training process and construct plots
The above is just one of Visual DL's many features. Visual DL has the following advantages:
-### Comprehensive Usability
+### Comprehensive Usability
1. Scalar: support scalar line/dot data visualization, like the figure above.
- can show metrics such as loss, accuracy, etc via lines and dots and let user see trends easily
@@ -40,22 +40,22 @@ The above is just one of Visual DL's many features. Visual DL has the following
-3. Histogram: display of parameter distribution, easy to check distribution curves in each tensor,
+3. Histogram: display of parameter distribution, easy to check distribution curves in each tensor,
show the trend of parameter distribution.
- help users understand the training process and the underneath reason for the change from one parameter distribution to another
- - help users judge if the training is on the track. For example, if parameter change rate becomes close to 0 or grows rapidly,
- then exploding and vanishing gradients might happen
+ - help users judge if the training is on the track. For example, if parameter change rate becomes close to 0 or grows rapidly,
+ then exploding and vanishing gradients might happen
4. Graph: visualize the model structure of deep learning networks.
- - Graph supports the preview of [ONNX](http://onnx.ai/) model. Since models of MXNet, Caffe2, PyTorch and CNTK can be converted to ONNX models easily,
+ - Graph supports the preview of [ONNX](http://onnx.ai/) model. Since models of MXNet, Caffe2, PyTorch and CNTK can be converted to ONNX models easily,
Visual DL can also support these models indirectly
- easy to see wrong configuration of a network
- help understand network structure
-
+
@@ -63,8 +63,8 @@ show the trend of parameter distribution.
### Easy to Integrate
-Visual DL provides independent Python SDK. If the training task is based on Python, user can simply
-use Visual DL by installing the Visual DL wheel package and importing it into her/his own project.
+Visual DL provides independent Python SDK. If the training task is based on Python, user can simply
+use Visual DL by installing the Visual DL wheel package and importing it into her/his own project.
a. Install Visual DL package.
@@ -100,7 +100,7 @@ visualDL --logdir ./log --port 8080
```
### Purely Open Source
-As a deep learning visualization tool, Visual DL support most deep learning frameworks. On the SDK perspective,
+As a deep learning visualization tool, Visual DL support most deep learning frameworks. On the SDK perspective,
it is easy to integrate into Python and C++ projects. Through ONNX, Visual DL's Graph component can support
many popular frameworks such as PaddlePaddle, MXNet, PyTorch and Caffe2.
diff --git a/docs/quick_start_cn.md b/docs/quick_start_cn.md
index 6ee6ed75..372eafb4 100644
--- a/docs/quick_start_cn.md
+++ b/docs/quick_start_cn.md
@@ -10,7 +10,7 @@ VisualDL 是一个面向深度学习任务的可视化工具,可用于训练
VisualDL提供原生的Python和C++ SDK,可以支持多种深度学习平台。用户可以在特定深度学习平台上利用Python SDK进行简单配置来支持可视化,也可以利用 C++ SDK深入嵌入到平台底层。
## 一个简单的Scalar的Python使用示例
-为了简单,我们先尝试使用Python SDK。
+为了简单,我们先尝试使用Python SDK。
使用VisualDL的第一步是创建一个 `LogWriter` 来存储用于可视化的数据
diff --git a/docs/quick_start_en.md b/docs/quick_start_en.md
index 322523b8..1f4e2d2e 100644
--- a/docs/quick_start_en.md
+++ b/docs/quick_start_en.md
@@ -8,8 +8,8 @@ Currently, VisualDL supports visualization features as follows:
- Histogram: can be used to show parameter distribution and trend.
- Graph: can be used to visualize model structure.
-VisualDL provides both Python SDK and C++ SDK in nature. It can support various frameworks.
-Users can retrieve visualization data by simply adding a few lines of code using Pythong SDK.
+VisualDL provides both Python SDK and C++ SDK in nature. It can support various frameworks.
+Users can retrieve visualization data by simply adding a few lines of code using Pythong SDK.
In addition, users can also have a deep integration by using the C++ SDK at a lower level.
## A Simple Python Demo on Scalar
@@ -25,8 +25,8 @@ from random import random
logw = LogWriter("./random_log", sync_cycle=30)
```
-The first parameter points to a folder; the second parameter `sync_cycle` specifies out of how memory operations should be
-store the data into hard drive.
+The first parameter points to a folder; the second parameter `sync_cycle` specifies out of how memory operations should be
+store the data into hard drive.
There are different modes for model training, such as training, validating and testing. All these correspond to `mode' in VisualDL.
We can use the following pattern to specify mode:
@@ -84,7 +84,7 @@ VisualDL's C++ SDK is very similar to its Python SDK. The Python demo above can
```
## Visualization Based on ONNX Model Structure
-VisualDL supports the visualization for the format in [ONNX](https://github.com/onnx/onnx).
+VisualDL supports the visualization for the format in [ONNX](https://github.com/onnx/onnx).
Currently, ONNX supports format conversion among various deep learning frameworks such as `MXNet`, `PyTorch`, `Caffe2`, `Caffe`.
```
@@ -96,5 +96,3 @@ For example, for the MNIST dataset, Graph component can render model graph as be
-
-
diff --git a/frontend/mock/API.md b/frontend/mock/API.md
index 5574e014..6a4ed5dd 100644
--- a/frontend/mock/API.md
+++ b/frontend/mock/API.md
@@ -24,4 +24,4 @@ response:
## data/plugins_listing
-url: data/plugins_listing
\ No newline at end of file
+url: data/plugins_listing
diff --git a/frontend/mock/data/plugin/histograms/histograms.js b/frontend/mock/data/plugin/histograms/histograms.js
index c5d7e126..8e022f79 100644
--- a/frontend/mock/data/plugin/histograms/histograms.js
+++ b/frontend/mock/data/plugin/histograms/histograms.js
@@ -19,225 +19,225 @@ module.exports = function (path, queryParam, postParam) {
data: [
[1515224840.945252, 0, [
[-4.826786994934082, -5.099814079160488, 0.0],
- [-5.099814079160488, -4.636194617418625, 1.0],
- [-3.8315657995195243, -3.48324163592684, 125.0],
- [-3.48324163592684, -3.1665833053880363, 436.0],
- [-2.6170109961884593, -2.379100905625872, 5362.0],
- [-2.379100905625872, -2.1628190051144287, 9589.0],
- [-1.47723448201245, -1.3429404381931362, 54279.0],
- [-1.3429404381931362, -1.220854943811942, 64480.0],
- [-1.0089710279437536, -0.917246389039776, 89844.0],
- [-0.917246389039776, -0.8338603536725235, 93854.0],
- [-0.8338603536725235, -0.7580548669750213, 96552.0],
- [-0.7580548669750213, -0.6891407881591103, 96980.0],
- [-0.6891407881591103, -0.6264916255991911, 97035.0],
- [-0.6264916255991911, -0.56953784145381, 94798.0],
- [-1.316866795643118e-05, -1.1971516324028345e-05, 8.0],
- [-1.1971516324028345e-05, -1.0883196658207586e-05, 1.0],
- [-1.0883196658207586e-05, -9.893815143825077e-06, 1.0],
- [-9.893815143825077e-06, -8.994377403477343e-06, 2.0],
- [-8.994377403477343e-06, -8.176706730433948e-06, 2.0],
- [-8.176706730433948e-06, -7.4333697549399525e-06, 2.0],
- [-7.4333697549399525e-06, -6.757608868127229e-06, 1.0],
- [-6.757608868127229e-06, -6.143280789206572e-06, 4.0],
- [-6.143280789206572e-06, -5.077091561327744e-06, 0.0],
- [-5.077091561327744e-06, -4.615537783025222e-06, 1.0],
- [-4.615537783025222e-06, -4.1959434391138375e-06, 0.0],
- [-4.1959434391138375e-06, -3.8144940355580335e-06, 2.0],
- [-3.8144940355580335e-06, -3.467721850507303e-06, 1.0],
- [-3.467721850507303e-06, -2.865885826865539e-06, 0.0],
- [-2.865885826865539e-06, -2.605350751695944e-06, 1.0],
- [-2.605350751695944e-06, -2.153182439418135e-06, 0.0],
- [-1.2154153537011338e-06, -1.1049230488192125e-06, 1.0],
- [-1.1049230488192125e-06, -5.670002325218022e-07, 0.0],
- [2.5662008430919505e-05, 2.822820927401146e-05, 8.0],
- [2.822820927401146e-05, 3.1051030201412604e-05, 4.0],
- [3.1051030201412604e-05, 3.415613322155387e-05, 4.0],
- [3.415613322155387e-05, 3.757174654370926e-05, 6.0],
- [3.757174654370926e-05, 4.132892119808019e-05, 7.0],
- [4.132892119808019e-05, 4.546181331788821e-05, 8.0],
- [4.546181331788821e-05, 5.000799464967703e-05, 19.0],
- [5.000799464967703e-05, 5.500879411464474e-05, 18.0],
- [5.500879411464474e-05, 6.050967352610922e-05, 10.0],
- [6.050967352610922e-05, 6.656064087872014e-05, 12.0],
- [6.656064087872014e-05, 7.321670496659217e-05, 13.0],
- [7.321670496659217e-05, 8.053837546325138e-05, 14.0],
- [8.053837546325138e-05, 8.859221300957652e-05, 18.0],
- [8.859221300957652e-05, 9.745143431053419e-05, 22.0],
- [9.745143431053419e-05, 0.00010719657774158762, 23.0],
- [0.00010719657774158762, 0.00011791623551574639, 34.0],
- [0.917246389039776, 1.0089710279437536, 124200.0],
- [1.0089710279437536, 1.109868130738129, 119511.0],
- [1.109868130738129, 1.220854943811942, 111589.0],
- [1.220854943811942, 1.3429404381931362, 101296.0],
- [2.8787120958073054, 3.1665833053880363, 3382.0],
- [3.1665833053880363, 3.48324163592684, 1351.0],
- [3.48324163592684, 3.8315657995195243, 468.0],
+ [-5.099814079160488, -4.636194617418625, 1.0],
+ [-3.8315657995195243, -3.48324163592684, 125.0],
+ [-3.48324163592684, -3.1665833053880363, 436.0],
+ [-2.6170109961884593, -2.379100905625872, 5362.0],
+ [-2.379100905625872, -2.1628190051144287, 9589.0],
+ [-1.47723448201245, -1.3429404381931362, 54279.0],
+ [-1.3429404381931362, -1.220854943811942, 64480.0],
+ [-1.0089710279437536, -0.917246389039776, 89844.0],
+ [-0.917246389039776, -0.8338603536725235, 93854.0],
+ [-0.8338603536725235, -0.7580548669750213, 96552.0],
+ [-0.7580548669750213, -0.6891407881591103, 96980.0],
+ [-0.6891407881591103, -0.6264916255991911, 97035.0],
+ [-0.6264916255991911, -0.56953784145381, 94798.0],
+ [-1.316866795643118e-05, -1.1971516324028345e-05, 8.0],
+ [-1.1971516324028345e-05, -1.0883196658207586e-05, 1.0],
+ [-1.0883196658207586e-05, -9.893815143825077e-06, 1.0],
+ [-9.893815143825077e-06, -8.994377403477343e-06, 2.0],
+ [-8.994377403477343e-06, -8.176706730433948e-06, 2.0],
+ [-8.176706730433948e-06, -7.4333697549399525e-06, 2.0],
+ [-7.4333697549399525e-06, -6.757608868127229e-06, 1.0],
+ [-6.757608868127229e-06, -6.143280789206572e-06, 4.0],
+ [-6.143280789206572e-06, -5.077091561327744e-06, 0.0],
+ [-5.077091561327744e-06, -4.615537783025222e-06, 1.0],
+ [-4.615537783025222e-06, -4.1959434391138375e-06, 0.0],
+ [-4.1959434391138375e-06, -3.8144940355580335e-06, 2.0],
+ [-3.8144940355580335e-06, -3.467721850507303e-06, 1.0],
+ [-3.467721850507303e-06, -2.865885826865539e-06, 0.0],
+ [-2.865885826865539e-06, -2.605350751695944e-06, 1.0],
+ [-2.605350751695944e-06, -2.153182439418135e-06, 0.0],
+ [-1.2154153537011338e-06, -1.1049230488192125e-06, 1.0],
+ [-1.1049230488192125e-06, -5.670002325218022e-07, 0.0],
+ [2.5662008430919505e-05, 2.822820927401146e-05, 8.0],
+ [2.822820927401146e-05, 3.1051030201412604e-05, 4.0],
+ [3.1051030201412604e-05, 3.415613322155387e-05, 4.0],
+ [3.415613322155387e-05, 3.757174654370926e-05, 6.0],
+ [3.757174654370926e-05, 4.132892119808019e-05, 7.0],
+ [4.132892119808019e-05, 4.546181331788821e-05, 8.0],
+ [4.546181331788821e-05, 5.000799464967703e-05, 19.0],
+ [5.000799464967703e-05, 5.500879411464474e-05, 18.0],
+ [5.500879411464474e-05, 6.050967352610922e-05, 10.0],
+ [6.050967352610922e-05, 6.656064087872014e-05, 12.0],
+ [6.656064087872014e-05, 7.321670496659217e-05, 13.0],
+ [7.321670496659217e-05, 8.053837546325138e-05, 14.0],
+ [8.053837546325138e-05, 8.859221300957652e-05, 18.0],
+ [8.859221300957652e-05, 9.745143431053419e-05, 22.0],
+ [9.745143431053419e-05, 0.00010719657774158762, 23.0],
+ [0.00010719657774158762, 0.00011791623551574639, 34.0],
+ [0.917246389039776, 1.0089710279437536, 124200.0],
+ [1.0089710279437536, 1.109868130738129, 119511.0],
+ [1.109868130738129, 1.220854943811942, 111589.0],
+ [1.220854943811942, 1.3429404381931362, 101296.0],
+ [2.8787120958073054, 3.1665833053880363, 3382.0],
+ [3.1665833053880363, 3.48324163592684, 1351.0],
+ [3.48324163592684, 3.8315657995195243, 468.0],
[3.8315657995195243, 4.214722379471477, 105.0]
]
- ],
+ ],
[1515224846.83122, 70, [
- [-5.609264373779297, -5.609795487076537, 0.0],
- [-5.609795487076537, -5.099814079160488, 5.0],
- [-5.099814079160488, -4.636194617418625, 26.0],
- [-4.636194617418625, -4.214722379471477, 114.0],
- [-4.214722379471477, -3.8315657995195243, 379.0],
- [-3.8315657995195243, -3.48324163592684, 1072.0],
- [-3.48324163592684, -3.1665833053880363, 2542.0],
- [-3.1665833053880363, -2.8787120958073054, 5260.0],
- [-2.8787120958073054, -2.6170109961884593, 9568.0],
- [-2.6170109961884593, -2.379100905625872, 15632.0],
- [-2.379100905625872, -2.1628190051144287, 23154.0],
- [-2.1628190051144287, -1.9661990955585713, 31489.0],
- [-1.9661990955585713, -1.7874537232350647, 41367.0],
- [-1.7874537232350647, -1.624957930213695, 50809.0],
- [-0.052566063576589855, -0.04778733052417259, 10183.0],
- [-0.04778733052417259, -0.043443027749247805, 9196.0],
- [-0.01143990698806325, -0.010399915443693864, 2264.0],
- [-0.010399915443693864, -0.00945446858517624, 2012.0],
- [0.0007211649713244094, 0.0007932814684568504, 152.0],
- [0.0007932814684568504, 0.0008726096153025355, 168.0],
- [0.0008726096153025355, 0.0009598705768327891, 179.0],
+ [-5.609264373779297, -5.609795487076537, 0.0],
+ [-5.609795487076537, -5.099814079160488, 5.0],
+ [-5.099814079160488, -4.636194617418625, 26.0],
+ [-4.636194617418625, -4.214722379471477, 114.0],
+ [-4.214722379471477, -3.8315657995195243, 379.0],
+ [-3.8315657995195243, -3.48324163592684, 1072.0],
+ [-3.48324163592684, -3.1665833053880363, 2542.0],
+ [-3.1665833053880363, -2.8787120958073054, 5260.0],
+ [-2.8787120958073054, -2.6170109961884593, 9568.0],
+ [-2.6170109961884593, -2.379100905625872, 15632.0],
+ [-2.379100905625872, -2.1628190051144287, 23154.0],
+ [-2.1628190051144287, -1.9661990955585713, 31489.0],
+ [-1.9661990955585713, -1.7874537232350647, 41367.0],
+ [-1.7874537232350647, -1.624957930213695, 50809.0],
+ [-0.052566063576589855, -0.04778733052417259, 10183.0],
+ [-0.04778733052417259, -0.043443027749247805, 9196.0],
+ [-0.01143990698806325, -0.010399915443693864, 2264.0],
+ [-0.010399915443693864, -0.00945446858517624, 2012.0],
+ [0.0007211649713244094, 0.0007932814684568504, 152.0],
+ [0.0007932814684568504, 0.0008726096153025355, 168.0],
+ [0.0008726096153025355, 0.0009598705768327891, 179.0],
[0.0009598705768327891, 0.001055857634516068, 198.0],
- [0.47069243095356195, 0.5177616740489182, 96395.0],
- [0.5177616740489182, 0.56953784145381, 103088.0],
- [0.56953784145381, 0.6264916255991911, 110245.0],
- [0.6264916255991911, 0.6891407881591103, 116777.0],
- [0.6891407881591103, 0.7580548669750213, 123501.0],
- [0.7580548669750213, 0.8338603536725235, 127806.0],
- [0.8338603536725235, 0.917246389039776, 132276.0],
- [0.917246389039776, 1.0089710279437536, 134169.0],
- [1.0089710279437536, 1.109868130738129, 133209.0],
- [1.109868130738129, 1.220854943811942, 129736.0],
- [2.6170109961884593, 2.8787120958073054, 14814.0],
- [2.8787120958073054, 3.1665833053880363, 8284.0],
- [3.8315657995195243, 4.214722379471477, 699.0],
- [4.214722379471477, 4.636194617418625, 245.0],
- [4.636194617418625, 5.099814079160488, 64.0],
- [5.099814079160488, 5.609795487076537, 22.0],
- [5.609795487076537, 6.1707750357841915, 2.0],
+ [0.47069243095356195, 0.5177616740489182, 96395.0],
+ [0.5177616740489182, 0.56953784145381, 103088.0],
+ [0.56953784145381, 0.6264916255991911, 110245.0],
+ [0.6264916255991911, 0.6891407881591103, 116777.0],
+ [0.6891407881591103, 0.7580548669750213, 123501.0],
+ [0.7580548669750213, 0.8338603536725235, 127806.0],
+ [0.8338603536725235, 0.917246389039776, 132276.0],
+ [0.917246389039776, 1.0089710279437536, 134169.0],
+ [1.0089710279437536, 1.109868130738129, 133209.0],
+ [1.109868130738129, 1.220854943811942, 129736.0],
+ [2.6170109961884593, 2.8787120958073054, 14814.0],
+ [2.8787120958073054, 3.1665833053880363, 8284.0],
+ [3.8315657995195243, 4.214722379471477, 699.0],
+ [4.214722379471477, 4.636194617418625, 245.0],
+ [4.636194617418625, 5.099814079160488, 64.0],
+ [5.099814079160488, 5.609795487076537, 22.0],
+ [5.609795487076537, 6.1707750357841915, 2.0],
[6.1707750357841915, 6.077327728271484, 0.0]
]
- ],
+ ],
[1515224850.414384, 100, [
- [-5.622415065765381, -6.1707750357841915, 0.0],
- [-6.1707750357841915, -5.609795487076537, 1.0],
- [-4.636194617418625, -4.214722379471477, 130.0],
- [-4.214722379471477, -3.8315657995195243, 364.0],
- [-3.8315657995195243, -3.48324163592684, 1063.0],
- [-3.48324163592684, -3.1665833053880363, 2440.0],
- [-2.6170109961884593, -2.379100905625872, 15079.0],
- [-2.379100905625872, -2.1628190051144287, 22447.0],
- [-1.0089710279437536, -0.917246389039776, 89632.0],
- [-0.917246389039776, -0.8338603536725235, 91513.0],
- [-0.8338603536725235, -0.7580548669750213, 91158.0],
- [-0.7580548669750213, -0.6891407881591103, 89568.0],
- [-0.6891407881591103, -0.6264916255991911, 88244.0],
- [-0.6264916255991911, -0.56953784145381, 84929.0],
- [-4.757441129747921e-08, 5.15454756838002e-07, 0.0],
- [5.15454756838002e-07, 5.670002325218022e-07, 1.0],
- [5.670002325218022e-07, 6.237002557739824e-07, 0.0],
- [6.237002557739824e-07, 6.860702813513807e-07, 1.0],
- [6.860702813513807e-07, 8.301450404351707e-07, 0.0],
- [8.301450404351707e-07, 9.131595444786879e-07, 1.0],
+ [-5.622415065765381, -6.1707750357841915, 0.0],
+ [-6.1707750357841915, -5.609795487076537, 1.0],
+ [-4.636194617418625, -4.214722379471477, 130.0],
+ [-4.214722379471477, -3.8315657995195243, 364.0],
+ [-3.8315657995195243, -3.48324163592684, 1063.0],
+ [-3.48324163592684, -3.1665833053880363, 2440.0],
+ [-2.6170109961884593, -2.379100905625872, 15079.0],
+ [-2.379100905625872, -2.1628190051144287, 22447.0],
+ [-1.0089710279437536, -0.917246389039776, 89632.0],
+ [-0.917246389039776, -0.8338603536725235, 91513.0],
+ [-0.8338603536725235, -0.7580548669750213, 91158.0],
+ [-0.7580548669750213, -0.6891407881591103, 89568.0],
+ [-0.6891407881591103, -0.6264916255991911, 88244.0],
+ [-0.6264916255991911, -0.56953784145381, 84929.0],
+ [-4.757441129747921e-08, 5.15454756838002e-07, 0.0],
+ [5.15454756838002e-07, 5.670002325218022e-07, 1.0],
+ [5.670002325218022e-07, 6.237002557739824e-07, 0.0],
+ [6.237002557739824e-07, 6.860702813513807e-07, 1.0],
+ [6.860702813513807e-07, 8.301450404351707e-07, 0.0],
+ [8.301450404351707e-07, 9.131595444786879e-07, 1.0],
[9.131595444786879e-07, 1.0044754989265568e-06, 1.0],
- [1.0044754989265568e-06, 1.6177178357762093e-06, 0.0],
- [6.757608868127229e-06, 7.4333697549399525e-06, 1.0],
- [7.4333697549399525e-06, 8.176706730433948e-06, 2.0],
- [8.176706730433948e-06, 8.994377403477343e-06, 1.0],
- [8.994377403477343e-06, 9.893815143825077e-06, 0.0],
- [9.893815143825077e-06, 1.0883196658207586e-05, 3.0],
- [1.0883196658207586e-05, 1.1971516324028345e-05, 2.0],
- [1.1971516324028345e-05, 1.316866795643118e-05, 3.0],
- [1.316866795643118e-05, 1.44855347520743e-05, 4.0],
- [3.757174654370926e-05, 4.132892119808019e-05, 8.0],
- [4.132892119808019e-05, 4.546181331788821e-05, 8.0],
- [4.546181331788821e-05, 5.000799464967703e-05, 7.0],
- [5.000799464967703e-05, 5.500879411464474e-05, 10.0],
- [5.500879411464474e-05, 6.050967352610922e-05, 13.0],
- [6.050967352610922e-05, 6.656064087872014e-05, 11.0],
- [6.656064087872014e-05, 7.321670496659217e-05, 15.0],
- [7.321670496659217e-05, 8.053837546325138e-05, 16.0],
- [8.053837546325138e-05, 8.859221300957652e-05, 27.0],
- [8.859221300957652e-05, 9.745143431053419e-05, 17.0],
- [0.8338603536725235, 0.917246389039776, 130481.0],
- [0.917246389039776, 1.0089710279437536, 133238.0],
- [1.0089710279437536, 1.109868130738129, 131855.0],
- [1.109868130738129, 1.220854943811942, 129006.0],
- [2.6170109961884593, 2.8787120958073054, 14697.0],
- [2.8787120958073054, 3.1665833053880363, 8234.0],
- [3.1665833053880363, 3.48324163592684, 4187.0],
- [3.48324163592684, 3.8315657995195243, 1800.0],
- [4.636194617418625, 5.099814079160488, 67.0],
- [5.099814079160488, 5.609795487076537, 22.0],
- [5.609795487076537, 6.1707750357841915, 3.0],
+ [1.0044754989265568e-06, 1.6177178357762093e-06, 0.0],
+ [6.757608868127229e-06, 7.4333697549399525e-06, 1.0],
+ [7.4333697549399525e-06, 8.176706730433948e-06, 2.0],
+ [8.176706730433948e-06, 8.994377403477343e-06, 1.0],
+ [8.994377403477343e-06, 9.893815143825077e-06, 0.0],
+ [9.893815143825077e-06, 1.0883196658207586e-05, 3.0],
+ [1.0883196658207586e-05, 1.1971516324028345e-05, 2.0],
+ [1.1971516324028345e-05, 1.316866795643118e-05, 3.0],
+ [1.316866795643118e-05, 1.44855347520743e-05, 4.0],
+ [3.757174654370926e-05, 4.132892119808019e-05, 8.0],
+ [4.132892119808019e-05, 4.546181331788821e-05, 8.0],
+ [4.546181331788821e-05, 5.000799464967703e-05, 7.0],
+ [5.000799464967703e-05, 5.500879411464474e-05, 10.0],
+ [5.500879411464474e-05, 6.050967352610922e-05, 13.0],
+ [6.050967352610922e-05, 6.656064087872014e-05, 11.0],
+ [6.656064087872014e-05, 7.321670496659217e-05, 15.0],
+ [7.321670496659217e-05, 8.053837546325138e-05, 16.0],
+ [8.053837546325138e-05, 8.859221300957652e-05, 27.0],
+ [8.859221300957652e-05, 9.745143431053419e-05, 17.0],
+ [0.8338603536725235, 0.917246389039776, 130481.0],
+ [0.917246389039776, 1.0089710279437536, 133238.0],
+ [1.0089710279437536, 1.109868130738129, 131855.0],
+ [1.109868130738129, 1.220854943811942, 129006.0],
+ [2.6170109961884593, 2.8787120958073054, 14697.0],
+ [2.8787120958073054, 3.1665833053880363, 8234.0],
+ [3.1665833053880363, 3.48324163592684, 4187.0],
+ [3.48324163592684, 3.8315657995195243, 1800.0],
+ [4.636194617418625, 5.099814079160488, 67.0],
+ [5.099814079160488, 5.609795487076537, 22.0],
+ [5.609795487076537, 6.1707750357841915, 3.0],
[6.1707750357841915, 6.0968852043151855, 0.0]
]
- ],
+ ],
[1515224852.17382, 120, [
- [-5.641714572906494, -6.1707750357841915, 0.0],
- [-6.1707750357841915, -5.609795487076537, 1.0],
- [-5.609795487076537, -5.099814079160488, 8.0],
- [-5.099814079160488, -4.636194617418625, 23.0],
- [-4.636194617418625, -4.214722379471477, 134.0],
- [-4.214722379471477, -3.8315657995195243, 325.0],
- [-3.8315657995195243, -3.48324163592684, 980.0],
- [-3.48324163592684, -3.1665833053880363, 2241.0],
- [-3.1665833053880363, -2.8787120958073054, 4732.0],
- [-2.8787120958073054, -2.6170109961884593, 8511.0],
- [-2.6170109961884593, -2.379100905625872, 14412.0],
- [-2.379100905625872, -2.1628190051144287, 21324.0],
- [-2.1628190051144287, -1.9661990955585713, 30265.0],
+ [-5.641714572906494, -6.1707750357841915, 0.0],
+ [-6.1707750357841915, -5.609795487076537, 1.0],
+ [-5.609795487076537, -5.099814079160488, 8.0],
+ [-5.099814079160488, -4.636194617418625, 23.0],
+ [-4.636194617418625, -4.214722379471477, 134.0],
+ [-4.214722379471477, -3.8315657995195243, 325.0],
+ [-3.8315657995195243, -3.48324163592684, 980.0],
+ [-3.48324163592684, -3.1665833053880363, 2241.0],
+ [-3.1665833053880363, -2.8787120958073054, 4732.0],
+ [-2.8787120958073054, -2.6170109961884593, 8511.0],
+ [-2.6170109961884593, -2.379100905625872, 14412.0],
+ [-2.379100905625872, -2.1628190051144287, 21324.0],
+ [-2.1628190051144287, -1.9661990955585713, 30265.0],
[-1.9661990955585713, -1.7874537232350647, 39939.0],
- [-1.7874537232350647, -1.624957930213695, 49754.0],
- [-1.624957930213695, -1.47723448201245, 59029.0],
- [-1.47723448201245, -1.3429404381931362, 67624.0],
- [-1.3429404381931362, -1.220854943811942, 75809.0],
- [-1.220854943811942, -1.109868130738129, 82164.0],
- [-1.109868130738129, -1.0089710279437536, 86962.0],
- [-1.0089710279437536, -0.917246389039776, 90354.0],
- [-0.917246389039776, -0.8338603536725235, 91382.0],
- [-0.8338603536725235, -0.7580548669750213, 91667.0],
+ [-1.7874537232350647, -1.624957930213695, 49754.0],
+ [-1.624957930213695, -1.47723448201245, 59029.0],
+ [-1.47723448201245, -1.3429404381931362, 67624.0],
+ [-1.3429404381931362, -1.220854943811942, 75809.0],
+ [-1.220854943811942, -1.109868130738129, 82164.0],
+ [-1.109868130738129, -1.0089710279437536, 86962.0],
+ [-1.0089710279437536, -0.917246389039776, 90354.0],
+ [-0.917246389039776, -0.8338603536725235, 91382.0],
+ [-0.8338603536725235, -0.7580548669750213, 91667.0],
[-0.7580548669750213, -0.6891407881591103, 90086.0],
- [-0.6891407881591103, -0.6264916255991911, 88401.0],
- [-0.6264916255991911, -0.56953784145381, 85407.0],
- [3.1051030201412604e-05, 3.415613322155387e-05, 8.0],
- [8.053837546325138e-05, 8.859221300957652e-05, 11.0],
- [0.012583897686869577, 0.013842287455556535, 2645.0],
- [0.013842287455556535, 0.01522651620111219, 3037.0],
- [0.01522651620111219, 0.01674916782122341, 3297.0],
- [0.01674916782122341, 0.018424084603345752, 3686.0],
- [0.018424084603345752, 0.02026649306368033, 3954.0],
- [0.02026649306368033, 0.022293142370048362, 4388.0],
- [0.022293142370048362, 0.0245224566070532, 4888.0],
- [0.0245224566070532, 0.026974702267758523, 5350.0],
- [0.026974702267758523, 0.02967217249453438, 5800.0],
- [0.02967217249453438, 0.03263938974398782, 6459.0],
- [0.03263938974398782, 0.035903328718386605, 7217.0],
+ [-0.6891407881591103, -0.6264916255991911, 88401.0],
+ [-0.6264916255991911, -0.56953784145381, 85407.0],
+ [3.1051030201412604e-05, 3.415613322155387e-05, 8.0],
+ [8.053837546325138e-05, 8.859221300957652e-05, 11.0],
+ [0.012583897686869577, 0.013842287455556535, 2645.0],
+ [0.013842287455556535, 0.01522651620111219, 3037.0],
+ [0.01522651620111219, 0.01674916782122341, 3297.0],
+ [0.01674916782122341, 0.018424084603345752, 3686.0],
+ [0.018424084603345752, 0.02026649306368033, 3954.0],
+ [0.02026649306368033, 0.022293142370048362, 4388.0],
+ [0.022293142370048362, 0.0245224566070532, 4888.0],
+ [0.0245224566070532, 0.026974702267758523, 5350.0],
+ [0.026974702267758523, 0.02967217249453438, 5800.0],
+ [0.02967217249453438, 0.03263938974398782, 6459.0],
+ [0.03263938974398782, 0.035903328718386605, 7217.0],
[0.035903328718386605, 0.03949366159022527, 7816.0],
- [0.03949366159022527, 0.043443027749247805, 8647.0],
+ [0.03949366159022527, 0.043443027749247805, 8647.0],
[0.043443027749247805, 0.04778733052417259, 9398.0],
- [0.04778733052417259, 0.052566063576589855, 10457.0],
- [0.052566063576589855, 0.057822669934248845, 11420.0],
- [0.057822669934248845, 0.06360493692767373, 12728.0],
- [0.06360493692767373, 0.06996543062044111, 13975.0],
- [0.06996543062044111, 0.07696197368248522, 15413.0],
- [0.07696197368248522, 0.08465817105073375, 17143.0],
- [0.08465817105073375, 0.09312398815580714, 19025.0],
- [0.09312398815580714, 0.10243638697138786, 20509.0],
+ [0.04778733052417259, 0.052566063576589855, 10457.0],
+ [0.052566063576589855, 0.057822669934248845, 11420.0],
+ [0.057822669934248845, 0.06360493692767373, 12728.0],
+ [0.06360493692767373, 0.06996543062044111, 13975.0],
+ [0.06996543062044111, 0.07696197368248522, 15413.0],
+ [0.07696197368248522, 0.08465817105073375, 17143.0],
+ [0.08465817105073375, 0.09312398815580714, 19025.0],
+ [0.09312398815580714, 0.10243638697138786, 20509.0],
[0.10243638697138786, 0.11268002566852665, 22060.0],
- [0.11268002566852665, 0.12394802823537933, 24938.0],
+ [0.11268002566852665, 0.12394802823537933, 24938.0],
[0.12394802823537933, 0.13634283105891729, 27263.0],
- [1.7874537232350647, 1.9661990955585713, 68215.0],
- [1.9661990955585713, 2.1628190051144287, 51944.0],
- [2.1628190051144287, 2.379100905625872, 36899.0],
- [2.379100905625872, 2.6170109961884593, 23872.0],
- [4.636194617418625, 5.099814079160488, 68.0],
- [5.099814079160488, 5.609795487076537, 22.0],
- [5.609795487076537, 6.1707750357841915, 3.0],
+ [1.7874537232350647, 1.9661990955585713, 68215.0],
+ [1.9661990955585713, 2.1628190051144287, 51944.0],
+ [2.1628190051144287, 2.379100905625872, 36899.0],
+ [2.379100905625872, 2.6170109961884593, 23872.0],
+ [4.636194617418625, 5.099814079160488, 68.0],
+ [5.099814079160488, 5.609795487076537, 22.0],
+ [5.609795487076537, 6.1707750357841915, 3.0],
[6.1707750357841915, 6.084466934204102, 0.0]
]
- ],
+ ],
]
}
};
diff --git a/frontend/mock/data/plugin/images/images.js b/frontend/mock/data/plugin/images/images.js
index c5510f69..bb56ae3c 100644
--- a/frontend/mock/data/plugin/images/images.js
+++ b/frontend/mock/data/plugin/images/images.js
@@ -37,5 +37,3 @@ module.exports = function (path, queryParam, postParam) {
}
};
};
-
-
diff --git a/frontend/src/common/component/Notification/Notification.md b/frontend/src/common/component/Notification/Notification.md
index c9af0be0..ca2953d9 100644
--- a/frontend/src/common/component/Notification/Notification.md
+++ b/frontend/src/common/component/Notification/Notification.md
@@ -174,6 +174,3 @@ export default {
| onClose | Function | | on-close callback |
| duration | Number | 3000 | duration |
| type | String | | include success,error,warning,info, others not use |
-
-
-
diff --git a/frontend/src/scalars/index.js b/frontend/src/scalars/index.js
index badb8048..44c14d33 100644
--- a/frontend/src/scalars/index.js
+++ b/frontend/src/scalars/index.js
@@ -13,5 +13,3 @@ router.add({
rule: '/scalars',
Component: Scalar
});
-
-
diff --git a/frontend/src/service.js b/frontend/src/service.js
index 21281bba..743936df 100644
--- a/frontend/src/service.js
+++ b/frontend/src/service.js
@@ -15,4 +15,3 @@ export const getPluginHistogramsTags = makeService('/data/plugin/histograms/tags
export const getPluginHistogramsHistograms = makeService('/data/plugin/histograms/histograms');
export const getPluginGraphsGraph = makeService('/data/plugin/graphs/graph');
-
diff --git a/setup.py b/setup.py
index 63e463cf..08a26faa 100644
--- a/setup.py
+++ b/setup.py
@@ -3,10 +3,10 @@ from __future__ import absolute_import
import os
import sys
from distutils.spawn import find_executable
-from distutils import sysconfig, dep_util, log
+from distutils import log
import setuptools.command.build_py
import setuptools
-from setuptools import setup, find_packages, Distribution, Extension
+from setuptools import setup, Extension
import subprocess
TOP_DIR = os.path.realpath(os.path.dirname(__file__))
diff --git a/travis/check_style.sh b/travis/check_style.sh
new file mode 100755
index 00000000..3c0af30d
--- /dev/null
+++ b/travis/check_style.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+function abort(){
+ echo "Your change doesn't follow VisualDL's code style." 1>&2
+ echo "Please use pre-commit to check what is wrong." 1>&2
+ exit 1
+}
+
+trap 'abort' 0
+set -e
+
+cd $TRAVIS_BUILD_DIR
+export PATH=/usr/bin:$PATH
+pre-commit install
+clang-format --version
+
+flake8 --version
+
+if ! pre-commit run -a ; then
+ git diff
+ exit 1
+fi
+
+trap : 0
diff --git a/visualdl/__init__.py b/visualdl/__init__.py
index d253f9e4..0b55c25f 100644
--- a/visualdl/__init__.py
+++ b/visualdl/__init__.py
@@ -2,6 +2,6 @@ from __future__ import absolute_import
import os
-from .python.storage import *
+from .python.storage import * # noqa: F401,F403
ROOT = os.path.dirname(__file__)
diff --git a/visualdl/logic/histogram.h b/visualdl/logic/histogram.h
index 95b74c8c..fd9485c8 100644
--- a/visualdl/logic/histogram.h
+++ b/visualdl/logic/histogram.h
@@ -15,10 +15,10 @@ limitations under the License. */
#ifndef VISUALDL_LOGIC_HISTOGRAM_H
#define VISUALDL_LOGIC_HISTOGRAM_H
-#include "visualdl/utils/logging.h"
#include
#include
#include
+#include "visualdl/utils/logging.h"
namespace visualdl {
diff --git a/visualdl/logic/sdk.cc b/visualdl/logic/sdk.cc
index 864b4598..33f00d42 100644
--- a/visualdl/logic/sdk.cc
+++ b/visualdl/logic/sdk.cc
@@ -32,7 +32,8 @@ std::string g_log_dir;
LogWriter LogWriter::AsMode(const std::string& mode) {
for (auto ch : "%/") {
CHECK(mode.find(ch) == std::string::npos)
- << "character "<< ch << " is a reserved word, it is not allowed in mode.";
+ << "character " << ch
+ << " is a reserved word, it is not allowed in mode.";
}
LogWriter writer = *this;
diff --git a/visualdl/python/cache.py b/visualdl/python/cache.py
index 040c97a4..011b1cde 100644
--- a/visualdl/python/cache.py
+++ b/visualdl/python/cache.py
@@ -12,9 +12,11 @@ class MemCache(object):
def expired(self, timeout):
return timeout > 0 and time.time() - self.time >= timeout
+
'''
A global dict to help cache some temporary data.
'''
+
def __init__(self, timeout=-1):
self._timeout = timeout
self._data = {}
@@ -24,13 +26,15 @@ class MemCache(object):
def get(self, key):
rcd = self._data.get(key, None)
- if not rcd: return None
+ if not rcd:
+ return None
# do not delete the key to accelerate speed
if rcd.expired(self._timeout):
rcd.clear()
return None
return rcd.value
+
if __name__ == '__main__':
import unittest
diff --git a/visualdl/python/storage.py b/visualdl/python/storage.py
index cd433d78..28d9ef1c 100644
--- a/visualdl/python/storage.py
+++ b/visualdl/python/storage.py
@@ -4,13 +4,16 @@ from visualdl import core
dtypes = ("float", "double", "int32", "int64")
+
def check_tag_name_valid(tag):
assert '%' not in tag, "character % is a reserved word, it is not allowed in tag."
+
def check_mode_name_valid(tag):
for char in ['%', '/']:
assert char not in tag, "character %s is a reserved word, it is not allowed in mode." % char
+
class LogReader(object):
"""LogReader is a Python wrapper to read and analysis the data that
saved with data format defined in storage.proto. user can get
@@ -125,7 +128,8 @@ class LogWriter(object):
create a new LogWriter with mode and return it.
"""
check_mode_name_valid(mode)
- LogWriter.cur_mode = LogWriter(self.dir, self.sync_cycle, self.writer.as_mode(mode))
+ LogWriter.cur_mode = LogWriter(self.dir, self.sync_cycle,
+ self.writer.as_mode(mode))
return LogWriter.cur_mode
def scalar(self, tag, type='float'):
diff --git a/visualdl/python/test_storage.py b/visualdl/python/test_storage.py
index 76c9b71f..e2083fc3 100644
--- a/visualdl/python/test_storage.py
+++ b/visualdl/python/test_storage.py
@@ -9,7 +9,6 @@ from visualdl import LogReader, LogWriter
pprint.pprint(sys.path)
-
class StorageTest(unittest.TestCase):
def setUp(self):
self.dir = "./tmp/storage_test"
diff --git a/visualdl/server/graph.py b/visualdl/server/graph.py
index c8e70a0b..61a05c3f 100644
--- a/visualdl/server/graph.py
+++ b/visualdl/server/graph.py
@@ -9,8 +9,8 @@ import onnx
def debug_print(json_obj):
- print(json.dumps(
- json_obj, sort_keys=True, indent=4, separators=(',', ': ')))
+ print(
+ json.dumps(json_obj, sort_keys=True, indent=4, separators=(',', ': ')))
def reorganize_inout(json_obj, key):
@@ -54,8 +54,8 @@ def rename_model(model_json):
for variable in variables:
old_name = variable['name']
new_shape = [int(dim) for dim in variable['shape']]
- new_name = old_name + '\ndata_type=' + str(variable['data_type']) \
- + '\nshape=' + str(new_shape)
+ new_name = old_name + '\ndata_type=' + str(
+ variable['data_type']) + '\nshape=' + str(new_shape)
variable['name'] = new_name
rename_edge(model, old_name, new_name)
@@ -234,8 +234,8 @@ def get_level_to_all(node_links, model_json):
if out_level not in output_to_level:
output_to_level[out_idx] = out_level
else:
- raise Exception(
- "output " + out_name + "have multiple source")
+ raise Exception("output " + out_name +
+ "have multiple source")
level_to_outputs = dict()
for out_idx in output_to_level:
level = output_to_level[out_idx]
@@ -353,6 +353,7 @@ class GraphPreviewGenerator(object):
'''
Generate a graph image for ONNX proto.
'''
+
def __init__(self, model_json):
self.model = model_json
# init graphviz graph
@@ -360,8 +361,7 @@ class GraphPreviewGenerator(object):
self.model['name'],
layout="dot",
concentrate="true",
- rankdir="TB",
- )
+ rankdir="TB", )
self.op_rank = self.graph.rank_group('same', 2)
self.param_rank = self.graph.rank_group('same', 1)
@@ -396,10 +396,9 @@ class GraphPreviewGenerator(object):
self.args.add(target)
if source in self.args or target in self.args:
- edge = self.add_edge(
- style="dashed,bold", color="#aaaaaa", **item)
+ self.add_edge(style="dashed,bold", color="#aaaaaa", **item)
else:
- edge = self.add_edge(style="bold", color="#aaaaaa", **item)
+ self.add_edge(style="bold", color="#aaaaaa", **item)
if not show:
self.graph.display(path)
@@ -448,8 +447,7 @@ class GraphPreviewGenerator(object):
fontname="Arial",
fontcolor="#ffffff",
width="1.3",
- height="0.84",
- )
+ height="0.84", )
def add_arg(self, name):
return self.graph.node(
@@ -483,17 +481,16 @@ def draw_graph(model_pb_path, image_dir):
if min_width is None or im.size[0] < min_width:
min_width = im.size
best_image = image_path
- except:
+ except Exception:
pass
return best_image
if __name__ == '__main__':
- import os
import sys
current_path = os.path.abspath(os.path.dirname(sys.argv[0]))
json_str = load_model(current_path + "/mock/inception_v1_model.pb")
- #json_str = load_model(current_path + "/mock/squeezenet_model.pb")
+ # json_str = load_model(current_path + "/mock/squeezenet_model.pb")
# json_str = load_model('./mock/shufflenet/model.pb')
debug_print(json_str)
assert json_str
diff --git a/visualdl/server/graph_test.py b/visualdl/server/graph_test.py
index 68461cee..9f13b7db 100644
--- a/visualdl/server/graph_test.py
+++ b/visualdl/server/graph_test.py
@@ -28,7 +28,8 @@ class GraphTest(unittest.TestCase):
# label_100: (in-edge)
# {u'source': u'fire6/squeeze1x1_1', u'target': u'node_34', u'label': u'label_100'}
- self.assertEqual(json_obj['edges'][100]['source'], 'fire6/squeeze1x1_1')
+ self.assertEqual(json_obj['edges'][100]['source'],
+ 'fire6/squeeze1x1_1')
self.assertEqual(json_obj['edges'][100]['target'], 'node_34')
self.assertEqual(json_obj['edges'][100]['label'], 'label_100')
diff --git a/visualdl/server/graph_test.sh b/visualdl/server/graph_test.sh
index b8d4ea65..35fa4ad3 100644
--- a/visualdl/server/graph_test.sh
+++ b/visualdl/server/graph_test.sh
@@ -9,4 +9,3 @@ cd ..
python graph_test.py
rm ./mock/*.pb
-
diff --git a/visualdl/server/graphviz_graph.py b/visualdl/server/graphviz_graph.py
index ef0a6553..cbb2f778 100644
--- a/visualdl/server/graphviz_graph.py
+++ b/visualdl/server/graphviz_graph.py
@@ -1,8 +1,5 @@
-import os
import random
import subprocess
-import sys
-import tempfile
def crepr(v):
@@ -28,7 +25,7 @@ class Rank(object):
return ''
return '{' + 'rank={};'.format(self.kind) + \
- ','.join([node.name for node in self.nodes]) + '}'
+ ','.join([node.name for node in self.nodes]) + '}'
# the python package graphviz is too poor.
diff --git a/visualdl/server/lib.py b/visualdl/server/lib.py
index c3385a76..d4d88130 100644
--- a/visualdl/server/lib.py
+++ b/visualdl/server/lib.py
@@ -106,7 +106,8 @@ def get_image_tag_steps(storage, mode, tag):
record = image.record(step_index, sample_index)
shape = record.shape()
# TODO(ChunweiYan) remove this trick, some shape will be empty
- if not shape: continue
+ if not shape:
+ continue
try:
query = urllib.urlencode({
'sample': 0,
@@ -121,7 +122,7 @@ def get_image_tag_steps(storage, mode, tag):
'wall_time': image.timestamp(step_index),
'query': query,
})
- except:
+ except Exception:
logger.error("image sample out of range")
return res
@@ -164,7 +165,7 @@ def get_histogram(storage, mode, tag, num_samples=100):
try:
# some bug with protobuf, some times may overflow
record = histogram.record(i)
- except:
+ except Exception:
continue
res.append([])
@@ -177,9 +178,7 @@ def get_histogram(storage, mode, tag, num_samples=100):
for j in xrange(record.num_instances()):
instance = record.instance(j)
data.append(
- [instance.left(),
- instance.right(),
- instance.frequency()])
+ [instance.left(), instance.right(), instance.frequency()])
if len(res) < num_samples:
return res
@@ -206,11 +205,12 @@ def retry(ntimes, function, time2sleep, *args, **kwargs):
for i in xrange(ntimes):
try:
return function(*args, **kwargs)
- except:
+ except Exception:
error_info = '\n'.join(map(str, sys.exc_info()))
logger.error("Unexpected error: %s" % error_info)
time.sleep(time2sleep)
+
def cache_get(cache):
def _handler(key, func, *args, **kwargs):
data = cache.get(key)
@@ -220,4 +220,5 @@ def cache_get(cache):
cache.set(key, data)
return data
return data
+
return _handler
diff --git a/visualdl/server/lib_test.py b/visualdl/server/lib_test.py
index e03cf226..ae3bd7b4 100644
--- a/visualdl/server/lib_test.py
+++ b/visualdl/server/lib_test.py
@@ -8,6 +8,7 @@ from storage_mock import add_histogram, add_image, add_scalar
_retry_counter = 0
+
class LibTest(unittest.TestCase):
def setUp(self):
dir = "./tmp/mock"
diff --git a/visualdl/server/mock/data.py b/visualdl/server/mock/data.py
index 984b760b..23af7da1 100644
--- a/visualdl/server/mock/data.py
+++ b/visualdl/server/mock/data.py
@@ -102,7 +102,7 @@ def sequence_data():
def graph_data():
- return """{
+ return """{
"title": {
"text": "MLP"
},
diff --git a/visualdl/server/mock/download_mock_models.sh b/visualdl/server/mock/download_mock_models.sh
index 6cb2374b..d65d3581 100644
--- a/visualdl/server/mock/download_mock_models.sh
+++ b/visualdl/server/mock/download_mock_models.sh
@@ -6,4 +6,3 @@ cp squeezenet/model.pb squeezenet_model.pb
rm -rf squeezenet
rm squeezenet.tar.gz
-
diff --git a/visualdl/server/setup.py b/visualdl/server/setup.py
index b20a62b8..a864d225 100644
--- a/visualdl/server/setup.py
+++ b/visualdl/server/setup.py
@@ -1,9 +1,8 @@
from setuptools import setup
-packages = ['visualdl',
- 'visualdl.onnx',
- 'visualdl.mock',
- 'visualdl.frontend.dist']
+packages = [
+ 'visualdl', 'visualdl.onnx', 'visualdl.mock', 'visualdl.frontend.dist'
+]
setup(
name="visualdl",
diff --git a/visualdl/server/storage_mock.py b/visualdl/server/storage_mock.py
index cf4a6054..98690fd5 100644
--- a/visualdl/server/storage_mock.py
+++ b/visualdl/server/storage_mock.py
@@ -1,6 +1,4 @@
import random
-import time
-import unittest
import numpy as np
@@ -36,4 +34,5 @@ def add_histogram(writer, mode, tag, num_buckets):
with writer.mode(mode) as writer:
histogram = writer.histogram(tag, num_buckets)
for i in range(10):
- histogram.add_record(i, np.random.normal(0.1 + i * 0.01, size=1000))
+ histogram.add_record(i, np.random.normal(
+ 0.1 + i * 0.01, size=1000))
diff --git a/visualdl/storage/storage.h b/visualdl/storage/storage.h
index dde01cda..745bd004 100644
--- a/visualdl/storage/storage.h
+++ b/visualdl/storage/storage.h
@@ -15,7 +15,6 @@ limitations under the License. */
#ifndef VISUALDL_STORAGE_STORAGE_H
#define VISUALDL_STORAGE_STORAGE_H
-#include "visualdl/utils/logging.h"
#include
#include
#include
@@ -25,6 +24,7 @@ limitations under the License. */
#include "visualdl/storage/tablet.h"
#include "visualdl/utils/filesystem.h"
#include "visualdl/utils/guard.h"
+#include "visualdl/utils/logging.h"
namespace visualdl {
static const std::string meta_file_name = "storage.meta";
diff --git a/visualdl/storage/tablet.h b/visualdl/storage/tablet.h
index d41fb122..e71cc9fe 100644
--- a/visualdl/storage/tablet.h
+++ b/visualdl/storage/tablet.h
@@ -15,11 +15,10 @@ limitations under the License. */
#ifndef VISUALDL_TABLET_H
#define VISUALDL_TABLET_H
-#include "visualdl/utils/logging.h"
-
#include "visualdl/logic/im.h"
#include "visualdl/storage/record.h"
#include "visualdl/storage/storage.pb.h"
+#include "visualdl/utils/logging.h"
#include "visualdl/utils/string.h"
namespace visualdl {
diff --git a/visualdl/test.py b/visualdl/test.py
index 19373434..9d089dbd 100644
--- a/visualdl/test.py
+++ b/visualdl/test.py
@@ -1,8 +1,9 @@
import sys
+
import unittest
import numpy as np
-sys.path.append('../../build')
+sys.path.append('../../build') # noqa: E402
import core
im = core.im()
@@ -62,7 +63,7 @@ class TabletTester(unittest.TestCase):
class ImTester(unittest.TestCase):
def test_persist(self):
im.clear_tablets()
- tablet = im.add_tablet("tab0", 111)
+ im.add_tablet("tab0", 111)
self.assertEqual(im.storage().tablets_size(), 1)
im.storage().set_dir("./1")
im.persist_to_disk()
diff --git a/visualdl/utils/concurrency.h b/visualdl/utils/concurrency.h
index a34d9033..75aeafba 100644
--- a/visualdl/utils/concurrency.h
+++ b/visualdl/utils/concurrency.h
@@ -15,11 +15,11 @@ limitations under the License. */
#ifndef VISUALDL_UTILS_CONCURRENCY_H
#define VISUALDL_UTILS_CONCURRENCY_H
-#include "visualdl/utils/logging.h"
#include
#include
#include
#include
+#include "visualdl/utils/logging.h"
namespace visualdl {
namespace cc {
diff --git a/visualdl/utils/test_concurrency.cc b/visualdl/utils/test_concurrency.cc
index 778d1fff..ea735485 100644
--- a/visualdl/utils/test_concurrency.cc
+++ b/visualdl/utils/test_concurrency.cc
@@ -14,8 +14,8 @@ limitations under the License. */
#include "visualdl/utils/concurrency.h"
-#include "visualdl/utils/logging.h"
#include
+#include "visualdl/utils/logging.h"
namespace visualdl {
diff --git a/visualdl/utils/test_image.cc b/visualdl/utils/test_image.cc
index c5c68292..36ad4211 100644
--- a/visualdl/utils/test_image.cc
+++ b/visualdl/utils/test_image.cc
@@ -30,4 +30,3 @@ TEST(image, NormalizeImage) {
NormalizeImage(&image, arr, 3, 128);
}
-
--
GitLab