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

Add more notebooks #52

Merged
merged 2 commits into from
Oct 13, 2022
Merged

Add more notebooks #52

merged 2 commits into from
Oct 13, 2022

Conversation

dachengx
Copy link
Collaborator

Try to solve #36

@dachengx dachengx marked this pull request as ready for review October 13, 2022 14:48
@@ -195,8 +195,8 @@ def _func(*args, **kwargs):
print(indent + f' Function <{name}> starts.')
start = time()
res = func(*args, **kwargs)
time = (time() - start) * 1e3
print(indent + f' Function <{name}> ends! Time cost = {time} msec.')
time_ = (time() - start) * 1e3

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS120 Found regular name with trailing underscore: time_

time = (time() - start) * 1e3
print(indent + f' Function <{name}> ends! Time cost = {time} msec.')
time_ = (time() - start) * 1e3
print(indent + f' Function <{name}> ends! Time cost = {time_:.2f} msec.')

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS221 Found line with high Jones Complexity: 15 > 14



@export
def tree_to_svg(graph_tree, save_as='data_types', view=True):

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D103 Missing docstring in public function

graph_tree.render(save_as, view=view)
with open(f'{save_as}.svg', mode='r') as f:
svg = add_spaces(f.readlines()[5:])
# os.remove(f'{save_as}.svg')

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
E800 Found commented out code



@export
def add_deps_to_graph_tree(context,

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W291 trailing whitespace

dep_plugin = context._plugin_class_registry[dep]
graph_tree.edge(plugin_name, dep_plugin.__name__)
graph_tree, _seen = add_plugins_to_graph_tree(
context,

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W291 trailing whitespace

context,
graph_tree,
plugin.depends_on,
_seen

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS121 Found usage of a variable marked as unused: _seen

context,
graph_tree,
plugin.depends_on,
_seen

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
C812 missing trailing comma

plugin.depends_on,
_seen
)
_seen.append(data_name)

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS121 Found usage of a variable marked as unused: _seen

_seen
)
_seen.append(data_name)
return graph_tree, _seen

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS121 Found usage of a variable marked as unused: _seen

@export
def add_deps_to_graph_tree(context,
graph_tree,
data_names: list = ['cs1', 'cs2', 'eff'],

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
B006 Do not use mutable data structures for argument defaults. They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.

@export
def add_deps_to_graph_tree(context,
graph_tree,
data_names: list = ['cs1', 'cs2', 'eff'],

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS404 Found complex default value

@export
def add_plugins_to_graph_tree(context,
graph_tree,
data_names: list = ['cs1', 'cs2', 'eff'],

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
B006 Do not use mutable data structures for argument defaults. They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.

@export
def add_plugins_to_graph_tree(context,
graph_tree,
data_names: list = ['cs1', 'cs2', 'eff'],

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS404 Found complex default value

context,
graph_tree,
plugin.depends_on,
_seen,

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS121 Found usage of a variable marked as unused: _seen

@dachengx dachengx merged commit ce52fe1 into master Oct 13, 2022
@dachengx dachengx deleted the add_notebook branch October 13, 2022 15:04
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.

None yet

1 participant