Skip to content

Commit

Permalink
Merge pull request #1015 from PMEAL/fix_nightly_builds
Browse files Browse the repository at this point in the history
Moved ruff config to pyproject.toml #maint
Updated example for ibip #docs
Fixed use of skeletonize_3d #bug
  • Loading branch information
jgostick authored Jan 16, 2025
2 parents f23ecf9 + 21eed8a commit 5be91c6
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 95 deletions.
22 changes: 13 additions & 9 deletions examples/simulations/tutorials/using_ibip.ipynb

Large diffs are not rendered by default.

88 changes: 88 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,91 @@ exclude_lines = [
"raise NotImplementedError",
"if __name__ == .__main__.:",
]

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]

# Same as Black.
line-length = 92
indent-width = 4

# Assume Python 3.10
target-version = "py310"

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F", "W", "E2"]
extend-select = ["I"]
ignore = ["E731", "F841", "E226", "I001"]
preview = true

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401", "F403", "I001"]
"_gdd.py" = ["ALL"]
"test/**" = ["F841"]
"test_snow2.py" = ["E241"]


[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = true

# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
85 changes: 0 additions & 85 deletions ruff.toml

This file was deleted.

2 changes: 1 addition & 1 deletion src/porespy/metrics/_regionprops.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pandas import DataFrame
from skimage.measure import mesh_surface_area, regionprops
from skimage.measure._regionprops import RegionProperties
from skimage.morphology import ball, skeletonize_3d
from skimage.morphology import ball, skeletonize

from porespy.tools import bbox_to_slices, extract_subsection

Expand Down

0 comments on commit 5be91c6

Please sign in to comment.