Skip to content

Commit

Permalink
ci: [pre-commit.ci] pre-commit autoupdate (#1222)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.0 →
v0.8.2](astral-sh/ruff-pre-commit@v0.7.0...v0.8.2)
- [github.com/executablebooks/mdformat: 0.7.18 →
0.7.19](hukkin/mdformat@0.7.18...0.7.19)
- [github.com/pre-commit/mirrors-mypy: v1.12.1 →
v1.13.0](pre-commit/mirrors-mypy@v1.12.1...v1.13.0)
<!--pre-commit.ci end-->

## Summary by Sourcery

CI:
- Update pre-commit hooks for ruff-pre-commit from v0.7.0 to v0.7.1 and
mirrors-mypy from v1.12.1 to v1.13.0.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and Czaki authored Dec 10, 2024
1 parent 917c93a commit 287f452
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .napari/DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The list of available measurements could be extensible using the PartSeg plugin
![Simple Measurement](https://i.imgur.com/Rnq6lF5.png)

Set of measurements that could be calculated per component respecting data voxel size.
In comparison to *Measurement* list of available measures is limited to ones that do not need
In comparison to *Measurement* list of available measures is limited to ones that do not need
*Mask* information and could be calculated per component.

This widget is equivalent to the PartSeg ROI Mask Simple Measurement window.
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.8.2
hooks:
- id: ruff
- repo: https://github.com/pre-commit/pygrep-hooks
Expand All @@ -36,7 +36,7 @@ repos:
- mdformat-toc

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.12.1' # Use the sha / tag you want to point at
rev: 'v1.13.0' # Use the sha / tag you want to point at
hooks:
- id: mypy
files: ^package/PartSegImage/.+\.py
Expand Down
18 changes: 9 additions & 9 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ This release drop support for python 3.8 and napari below 0.4.19.
- Fix coverage files upload by enable hidden files upload ([#1186](https://github.com/4DNucleome/PartSeg/pull/1186))
- \[pre-commit.ci\] pre-commit autoupdate ([#1184](https://github.com/4DNucleome/PartSeg/pull/1184))
- Use PyQt6 in pre-tests ([#1196](https://github.com/4DNucleome/PartSeg/pull/1196))
- Add missed code from #1191 ([#1197](https://github.com/4DNucleome/PartSeg/pull/1197))
- Add missed code from #1191 ([#1197](https://github.com/4DNucleome/PartSeg/pull/1197))
- \[pre-commit.ci\] pre-commit autoupdate ([#1189](https://github.com/4DNucleome/PartSeg/pull/1189))
- Auto add "skip check PR title" label in update dependencies PR ([#1199](https://github.com/4DNucleome/PartSeg/pull/1199))
- Auto add "skip check PR title" label in update dependencies PR ([#1199](https://github.com/4DNucleome/PartSeg/pull/1199))

### Build

Expand Down Expand Up @@ -172,7 +172,7 @@ This release drop support for python 3.8 and napari below 0.4.19.
- Move coverage back to main workflow ([#1055](https://github.com/4DNucleome/PartSeg/pull/1055))
- \[pre-commit.ci\] pre-commit autoupdate ([#1056](https://github.com/4DNucleome/PartSeg/pull/1056))
- \[pre-commit.ci\] pre-commit autoupdate ([#1059](https://github.com/4DNucleome/PartSeg/pull/1059))
- Update `actions/upload-artifact` and `actions/download-artifact` from 3 to 4 ([#1062](https://github.com/4DNucleome/PartSeg/pull/1062))
- Update `actions/upload-artifact` and `actions/download-artifact` from 3 to 4 ([#1062](https://github.com/4DNucleome/PartSeg/pull/1062))
- \[pre-commit.ci\] pre-commit autoupdate ([#1064](https://github.com/4DNucleome/PartSeg/pull/1064))
- Group actions update ([#1065](https://github.com/4DNucleome/PartSeg/pull/1065))
- \[pre-commit.ci\] pre-commit autoupdate ([#1068](https://github.com/4DNucleome/PartSeg/pull/1068))
Expand Down Expand Up @@ -253,7 +253,7 @@ This release drop support for python 3.8 and napari below 0.4.19.
### 🐛 Bug Fixes

- Fix possible problem of double registration napari plugin in PartSeg bundle ([#974](https://github.com/4DNucleome/PartSeg/pull/974))
- Bump OS versions for part of testing workflows. ([#977](https://github.com/4DNucleome/PartSeg/pull/977))
- Bump OS versions for part of testing workflows. ([#977](https://github.com/4DNucleome/PartSeg/pull/977))
- Bump os version for main tests workflow. ([#979](https://github.com/4DNucleome/PartSeg/pull/979))
- Ensure that the module `PartSegCore.channel_class` is present in bundle ([#980](https://github.com/4DNucleome/PartSeg/pull/980))
- Lower npe2 schema version to work with older napari version ([#981](https://github.com/4DNucleome/PartSeg/pull/981))
Expand Down Expand Up @@ -472,11 +472,11 @@ This release drop support for python 3.8 and napari below 0.4.19.

### 🚜 Refactor

- Clean potential vulnerabilities ([#630](https://github.com/4DNucleome/PartSeg/pull/630))
- Clean potential vulnerabilities ([#630](https://github.com/4DNucleome/PartSeg/pull/630))

### 🧪 Testing

- Add more tests for common GUI elements ([#622](https://github.com/4DNucleome/PartSeg/pull/622))
- Add more tests for common GUI elements ([#622](https://github.com/4DNucleome/PartSeg/pull/622))
- Report coverage per package. ([#639](https://github.com/4DNucleome/PartSeg/pull/639))
- Update conda environment to not use PyQt5 in test ([#646](https://github.com/4DNucleome/PartSeg/pull/646))
- Add tests files to calculate coverage ([#655](https://github.com/4DNucleome/PartSeg/pull/655))
Expand Down Expand Up @@ -714,13 +714,13 @@ This release drop support for python 3.8 and napari below 0.4.19.

### Features

- Add CellFromNucleusFlow "Cell from nucleus flow" cell segmentation method (#367)
- Add CellFromNucleusFlow "Cell from nucleus flow" cell segmentation method (#367)
- When cutting components in PartSeg ROI mask allow not masking outer data (#379)
- Theme selection in GUI (#381)
- Allow return points from ROI extraction algorithm (#382)
- Add measurement to get ROI annotation by name. (#386)
- PartSeg ROI extraction algorithms as napari plugins (#387)
- Add Pearson, Mander's, Intensity, Spearman colocalization measurements (#392)
- Add Pearson, Mander's, Intensity, Spearman colocalization measurements (#392)
- Separate standalone napari settings from PartSeg embedded napari settings (#397)

### Performance
Expand Down Expand Up @@ -921,7 +921,7 @@ This release drop support for python 3.8 and napari below 0.4.19.
## 0.9.6

- fix bug in loading project with mask
- upgrade PyInstaller version (bug GHSA-7fcj-pq9j-wh2r)
- upgrade PyInstaller version (bug GHSA-7fcj-pq9j-wh2r)

## 0.9.5

Expand Down
10 changes: 5 additions & 5 deletions package/PartSeg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
ANALYSIS_NAME = "ROI Analysis"

__all__ = (
"ANALYSIS_NAME",
"APP_LAB",
"APP_NAME",
"MASK_NAME",
"__author__",
"parsed_version",
"__version__",
"changelog",
"APP_NAME",
"MASK_NAME",
"APP_LAB",
"ANALYSIS_NAME",
"parsed_version",
)
2 changes: 1 addition & 1 deletion package/PartSeg/common_gui/algorithms_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def from_algorithm_property(cls, ob: typing.Union[str, AlgorithmProperty]):
mgi_options=ob.mgi_options,
)
if isinstance(ob, str):
if ob.lower() == "hline" or len(ob) > 5 and all(x == "-" for x in ob):
if ob.lower() == "hline" or (len(ob) > 5 and all(x == "-" for x in ob)):
return Hline()
return QLabel(ob)
raise ValueError(f"unknown parameter type {type(ob)} of {ob}")
Expand Down
10 changes: 5 additions & 5 deletions package/PartSeg/plugins/napari_widgets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
from PartSeg.plugins.napari_widgets.search_label_widget import SearchLabel

__all__ = (
"PartSegGUILauncher",
"BorderSmooth",
"ConnectedComponents",
"CopyLabelsWidget",
"DoubleThreshold",
"NoiseFilter",
"SplitCoreObjects",
"Threshold",
"Watershed",
"ImageColormap",
"LabelSelector",
"LayerMetadata",
"MaskCreate",
"NoiseFilter",
"PartSegGUILauncher",
"ROIAnalysisExtraction",
"ROIMaskExtraction",
"SearchLabel",
"SettingsEditor",
"SplitCoreObjects",
"Threshold",
"Watershed",
)
6 changes: 3 additions & 3 deletions package/PartSeg/state_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
sentry_url = os.environ.get("PARTSEG_SENTRY_URL", "https://d4118280b73d4ee3a0222d0b17637687@sentry.io/1309302")

__all__ = (
"auto_report",
"always_report",
"custom_plugin_load",
"auto_report",
"check_for_updates",
"custom_plugin_load",
"develop",
"report_errors",
"save_suffix",
"save_folder",
"save_suffix",
"sentry_url",
"show_error_dialog",
)
2 changes: 1 addition & 1 deletion package/PartSegCore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from PartSegCore.universal_const import UNIT_SCALE, Units

__all__ = ("Units", "UNIT_SCALE")
__all__ = ("UNIT_SCALE", "Units")
2 changes: 1 addition & 1 deletion package/PartSegCore/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from PartSegCore.analysis.measurement_calculation import MEASUREMENT_DICT

__all__ = (
"MEASUREMENT_DICT",
"AnalysisAlgorithmSelection",
"ProjectTuple",
"SegmentationPipeline",
"SegmentationPipelineElement",
"MEASUREMENT_DICT",
"load_metadata",
)

Expand Down
10 changes: 5 additions & 5 deletions package/PartSegCore/analysis/load_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
from PartSegImage import GenericImageReader

__all__ = [
"LoadStackImage",
"LoadImageForBatch",
"LoadImageMask",
"LoadProject",
"LoadMask",
"load_dict",
"load_metadata",
"LoadMaskSegmentation",
"LoadProfileFromJSON",
"LoadImageForBatch",
"LoadProject",
"LoadStackImage",
"load_dict",
"load_metadata",
]

from PartSegImage.image import Image
Expand Down
8 changes: 4 additions & 4 deletions package/PartSegCore/analysis/save_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
from PartSegImage import Channel, Image, ImageWriter

__all__ = [
"SaveProject",
"SaveCmap",
"SaveXYZ",
"SaveAsTiff",
"SaveAsNumpy",
"SaveAsTiff",
"SaveCmap",
"SaveProfilesToJSON",
"SaveProject",
"SaveXYZ",
"save_dict",
]

Expand Down
2 changes: 1 addition & 1 deletion package/PartSegCore/image_transforming/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
image_transform_dict = Register(CombineChannels, ImageProjection, InterpolateImage, SwapTimeStack)

__all__ = (
"image_transform_dict",
"CombineChannels",
"CombineMode",
"ImageProjection",
"InterpolateImage",
"SwapTimeStack",
"TransformBase",
"image_transform_dict",
)
6 changes: 3 additions & 3 deletions package/PartSegCore/segmentation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
from PartSegCore.segmentation.watershed import BaseWatershed

__all__ = [
"ROIExtractionAlgorithm",
"BaseThreshold",
"BaseWatershed",
"NoiseFilteringBase",
"BaseThreshold",
"RestartableAlgorithm",
"ROIExtractionAlgorithm",
"ROIExtractionResult",
"RestartableAlgorithm",
"StackAlgorithm",
]

Expand Down
12 changes: 6 additions & 6 deletions package/PartSegImage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"Channel",
"ChannelInfo",
"ChannelInfoFull",
"Image",
"TiffImageReader",
"CziImageReader",
"GenericImageReader",
"IMAGEJImageWriter",
"Image",
"ImageWriter",
"TiffFileException",
"CziImageReader",
"OifImagReader",
"ObsepImageReader",
"GenericImageReader",
"OifImagReader",
"TiffFileException",
"TiffImageReader",
)

if os.path.basename(sys.argv[0]) in ["sphinx-build", "sphinx-build.exe"]: # pragma: no cover
Expand Down
4 changes: 2 additions & 2 deletions package/PartSegImage/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,9 @@ def clip_array(self, array: np.ndarray, **kwargs: int | slice) -> np.ndarray:
array = self.fit_array_to_image(array)
slices: list[int | slice] = [slice(None) for _ in range(len(self.array_axis_order))]
axis_pos = self.get_array_axis_positions()
for name in kwargs:
for name, value in kwargs.items():
if (n := name.upper()) in axis_pos:
slices[axis_pos[n]] = kwargs[name]
slices[axis_pos[n]] = value
return array[tuple(slices)]

def get_channel(self, num: int | str | Channel) -> np.ndarray:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ select = [
]
ignore = ["A003", "SIM108", "ARG002", "ARG003", "ARG004", "PLR2004",
"PLR0913", # should be re-enabled in a future version
"ANN101", "ANN102",
]

[tool.ruff.lint.isort]
Expand Down
10 changes: 5 additions & 5 deletions tutorials/tutorial-batch-processing/tutorial-batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ To open window for batch processing use marked button or use *Batch processing*

1. Select how the mask file for segmentation will be recognized.

a. In section *Use mask from*, Select *File* tab.
a. In section *Use mask from*, Select *File* tab.

b. Select *Suffix*.

c. Input “\_mask” in *Use suffix* field. (All masks created by the *ROI Mask* component of Partseg have `_mask` suffix)
c. Input “\_mask” in *Use suffix* field. (All masks created by the *ROI Mask* component of Partseg have `_mask` suffix)

d. Confirm with the "Add mask" button

Expand All @@ -36,11 +36,11 @@ To open window for batch processing use marked button or use *Batch processing*

b. All measurements within the selected set are visible in the *information* section

c. Select channel (x) and units (um) that will be used in quantification.
c. Select channel (x) and units (um) that will be used in quantification.

d. Confirm with the "Add Set of measurements" button
d. Confirm with the "Add Set of measurements" button

e. The segmentation profile is now added to the workflow (3c).
e. The segmentation profile is now added to the workflow (3c).

4. Save created Workflow under the chosen name (e.g. *Chromosome1_batch*) with the "Save" button.

Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-chromosome-1/tutorial-chromosome1_16.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ In order to quantify features of chromosome 1 territory segmentation of FISH spe

8. Execute segmentation

9. Save segmentation profile with name "chromosome1_prof" (more details in [interface documentation](<>)) **TODO**
9. Save segmentation profile with name "chromosome1_prof" (more details in [interface documentation](<>)) **TODO**

Some background signal is always present in FISH, however specific signal is much brighter.
As an example nucleus with two separate chromosome 1 territories is shown,
Expand Down

0 comments on commit 287f452

Please sign in to comment.