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

Use yapf for automatic formatting #136

Merged
merged 3 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/pre-commit/mirrors-yapf
rev: '5441be1' # Use the sha / tag you want to point at
hooks:
- id: yapf
26 changes: 26 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[style]
based_on_style = pep8
align_closing_bracket_with_visual_indent = true
arithmetic_precedence_indication = true
coalesce_brackets = true
continuation_align_style = space
continuation_indent_width = 8
dedent_closing_brackets = false
each_dict_entry_on_separate_line = false
force_multiline_dict = false
indent_closing_brackets = true
indent_dictionary_value = true
space_between_ending_comma_and_closing_bracket = false
split_arguments_when_comma_terminated = true
split_all_comma_separated_values = false
split_before_bitwise_operator = true
split_before_arithmetic_operator = true
split_before_closing_bracket = true
split_before_dot = true
split_before_expression_after_opening_paren = true
split_before_first_argument = true
split_before_logical_operator = true
split_complex_comprehension = true
split_penalty_after_opening_bracket = 0
split_penalty_for_added_line_split = 0
use_tabs = false
2 changes: 2 additions & 0 deletions .yapfignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doc/conf.py
skan/_testdata.py
6 changes: 2 additions & 4 deletions benchmarks/bench_skan.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ def bench_suite():
times = OrderedDict()
skeleton = np.load(os.path.join(rundir, 'infected3.npz'))['skeleton']
with timer() as t_build_graph:
g, indices = csr.skeleton_to_csgraph(skeleton,
spacing=2.24826)
g, indices = csr.skeleton_to_csgraph(skeleton, spacing=2.24826)
times['build graph'] = t_build_graph[0]
with timer() as t_build_graph2:
g, indices = csr.skeleton_to_csgraph(skeleton,
spacing=2.24826)
g, indices = csr.skeleton_to_csgraph(skeleton, spacing=2.24826)
times['build graph again'] = t_build_graph2[0]
with timer() as t_stats:
stats = csr.branch_statistics(g)
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

if __name__ == '__main__':
setup()

5 changes: 1 addition & 4 deletions skan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@

__version__ = '0.10.0-dev'

__all__ = ['skeleton_to_csgraph',
'branch_statistics',
'summarize',
'Skeleton']
__all__ = ['skeleton_to_csgraph', 'branch_statistics', 'summarize', 'Skeleton']
Loading