Skip to content

Commit

Permalink
docs: format ipynb with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
kenibrewer authored Apr 3, 2024
1 parent c1d2138 commit eb8a886
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions pycytominer/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pycytominer package metadata."""

__project__ = "pycytominer"
# These version placeholders are updated during build by poetry-dynamic-versioning
__version__ = "0.0.0"
Expand Down
1 change: 1 addition & 0 deletions pycytominer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pycytominer is a suite of common functions used to process high dimensional readouts from high-throughput cell experiments."""

from pycytominer import __about__

from .aggregate import aggregate
Expand Down
8 changes: 6 additions & 2 deletions pycytominer/cyto_utils/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,13 +914,17 @@ def _sqlite_strata_conditions(df, dtypes, n=1):
[3] | [1, 2]
[4] | [1]
>>> _sqlite_strata_conditions(df, dtypes={'TableNumber': 'integer', 'ImageNumber': 'integer'}, n=1)
>>> _sqlite_strata_conditions(
... df, dtypes={"TableNumber": "integer", "ImageNumber": "integer"}, n=1
... )
["(TableNumber in (1) and ImageNumber in (1))",
"(TableNumber in (2) and ImageNumber in (1, 2, 3))",
"(TableNumber in (3) and ImageNumber in (1, 2))",
"(TableNumber in (4) and ImageNumber in (1))"]
>>> _sqlite_strata_conditions(df, dtypes={'TableNumber': 'text', 'ImageNumber': 'integer'}, n=2)
>>> _sqlite_strata_conditions(
... df, dtypes={"TableNumber": "text", "ImageNumber": "integer"}, n=2
... )
["(TableNumber in ('1') and ImageNumber in (1))
or (TableNumber in ('2') and ImageNumber in (1, 2, 3))",
"(TableNumber in ('3') and ImageNumber in (1, 2))
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ version_files = [
target-version = "py38"
line-length = 88
fix = true
extend-include = ["*.ipynb"]

[tool.ruff.lint]
select = [
Expand Down Expand Up @@ -160,6 +161,7 @@ ignore = [
# DoNotAssignLambda
"E731",
]
exclude = ["*.ipynb"]

[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings.
Expand Down
16 changes: 8 additions & 8 deletions walkthroughs/single_cell_usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"# ignore mix type warnings from pandas\n",
"import warnings\n",
"\n",
"warnings.filterwarnings(\"ignore\")\n"
"warnings.filterwarnings(\"ignore\")"
]
},
{
Expand Down Expand Up @@ -86,7 +86,7 @@
"sc_profiles_path = out_dir / \"nf1_single_cell_profile.csv.gz\"\n",
"anno_profiles_path = out_dir / \"nf1_annotated_profile.csv.gz\"\n",
"norm_profiles_path = out_dir / \"nf1_normalized_profile.csv.gz\"\n",
"feat_profiles_path = out_dir / \"nf1_features_profile.csv.gz\"\n"
"feat_profiles_path = out_dir / \"nf1_features_profile.csv.gz\""
]
},
{
Expand Down Expand Up @@ -128,7 +128,7 @@
" },\n",
" \"Per_Cells\": {\"Per_Cytoplasm\": \"Cells_Number_Object_Number\"},\n",
" \"Per_Nuclei\": {\"Per_Cytoplasm\": \"Nuclei_Number_Object_Number\"},\n",
"}\n"
"}"
]
},
{
Expand Down Expand Up @@ -177,7 +177,7 @@
"# compressed csv file\n",
"single_cell_profile.merge_single_cells(\n",
" sc_output_file=sc_profiles_path, compression_options=\"gzip\"\n",
")\n"
")"
]
},
{
Expand Down Expand Up @@ -208,7 +208,7 @@
"platemap_df = pd.read_csv(plate_map)\n",
"\n",
"# displaying platemap\n",
"print(platemap_df.columns.tolist())\n"
"print(platemap_df.columns.tolist())"
]
},
{
Expand Down Expand Up @@ -249,7 +249,7 @@
")\n",
"\n",
"# save message display\n",
"print(f\"Annotated profile saved in: {anno_profiles_path}\")\n"
"print(f\"Annotated profile saved in: {anno_profiles_path}\")"
]
},
{
Expand Down Expand Up @@ -296,7 +296,7 @@
")\n",
"\n",
"# save message display\n",
"print(f\"Normalized profile saved in: {norm_profiles_path}\")\n"
"print(f\"Normalized profile saved in: {norm_profiles_path}\")"
]
},
{
Expand Down Expand Up @@ -341,7 +341,7 @@
")\n",
"\n",
"# save message display\n",
"print(f\"Selected features profile saved in: {feat_profiles_path}\")\n"
"print(f\"Selected features profile saved in: {feat_profiles_path}\")"
]
},
{
Expand Down

0 comments on commit eb8a886

Please sign in to comment.