project_name string | class_name string | class_modifiers string | class_implements int64 | class_extends int64 | function_name string | function_body string | cyclomatic_complexity int64 | NLOC int64 | num_parameter int64 | num_token int64 | num_variable int64 | start_line int64 | end_line int64 | function_index int64 | function_params string | function_variable string | function_return_type string | function_body_line_type string | function_num_functions int64 | function_num_lines int64 | outgoing_function_count int64 | outgoing_function_names string | incoming_function_count int64 | incoming_function_names string | lexical_representation string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CAREamics_careamics | public | public | 0 | 0 | create_czi_extractor | def create_czi_extractor(source: Sequence[Path],axes: str,) -> PatchExtractor[CziImageStack]:"""Create a patch extractor from a sequence of CZI files.If the CZI files contain multiple scenes, one patch extractor will be created foreach scene.Parameters----------source: sequence of PathThe source files for the data.axes... | 5 | 17 | 2 | 107 | 2 | 100 | 137 | 100 | source,axes | ['scene_rectangles', 'depth_axis'] | PatchExtractor[CziImageStack] | {"AnnAssign": 2, "Assign": 3, "Expr": 2, "For": 1, "If": 2, "Return": 1} | 7 | 38 | 7 | ["axes.endswith", "axes.endswith", "CziImageStack.get_bounding_rectangles", "image_stacks.extend", "CziImageStack", "scene_rectangles.keys", "PatchExtractor"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.factory_py.create_czi_dataset"] | The function (create_czi_extractor) defined within the public class called public.The function start at line 100 and ends at 137. It contains 17 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [100.0] and does not return any value. It declares 7.0 functions, It has 7.0 funct... |
CAREamics_careamics | public | public | 0 | 0 | create_custom_file_extractor | def create_custom_file_extractor(source: Sequence[Path],axes: str,*,read_func: ReadFunc,read_kwargs: dict[str, Any],) -> PatchExtractor[InMemoryImageStack]:"""Create a patch extractor from a sequence of files of a custom type.Parameters----------source: sequence of PathThe source files for the data.axes: strThe origina... | 2 | 17 | 4 | 69 | 1 | 141 | 177 | 141 | source,axes,read_func,read_kwargs | ['image_stacks'] | PatchExtractor[InMemoryImageStack] | {"Assign": 1, "Expr": 1, "Return": 1} | 2 | 37 | 2 | ["InMemoryImageStack.from_custom_file_type", "PatchExtractor"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.factory_py.create_custom_file_dataset"] | The function (create_custom_file_extractor) defined within the public class called public.The function start at line 141 and ends at 177. It contains 17 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [141.0] and does not return any value. It declares 2.0 functions, It has 2... |
CAREamics_careamics | public | public | 0 | 0 | create_custom_image_stack_extractor | def create_custom_image_stack_extractor(source: Any,axes: str,image_stack_loader: ImageStackLoader[P, GenericImageStack],*args: P.args,**kwargs: P.kwargs,) -> PatchExtractor[GenericImageStack]:"""Create a patch extractor using a custom `ImageStackLoader`.The custom image stack loader must follow the `ImageStackLoader` ... | 1 | 9 | 5 | 60 | 1 | 181 | 217 | 181 | source,axes,image_stack_loader,*args,**kwargs | ['image_stacks'] | PatchExtractor[GenericImageStack] | {"Assign": 1, "Expr": 1, "Return": 1} | 2 | 37 | 2 | ["image_stack_loader", "PatchExtractor"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.factory_py.create_custom_image_stack_dataset"] | The function (create_custom_image_stack_extractor) defined within the public class called public.The function start at line 181 and ends at 217. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [181.0] and does not return any value. It declares 2.0 functions, It... |
CAREamics_careamics | CziImageStack | public | 0 | 0 | __init__ | def __init__(self,data_path: str | Path,scene: int | None = None,depth_axis: Literal["none", "Z", "T"] = "none",) -> None:if not pyczi_available:raise ImportError("The CZI image stack requires the `pylibCZIrw` package to be installed."" Please install it with `pip install careamics[czi]`.")_data_path = Path(data_path)#... | 4 | 29 | 4 | 162 | 0 | 108 | 148 | 108 | self,data_path,scene,depth_axis | [] | None | {"Assign": 10, "If": 3} | 10 | 41 | 10 | ["ImportError", "Path", "re.match", "ValueError", "scene_matches.group", "int", "scene_matches.group", "CziReader", "str", "self._get_shape"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called CziImageStack.The function start at line 108 and ends at 148. It contains 29 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [108.0] and does not return any value. It declares 10.0 functions, It has 10.0 function... |
CAREamics_careamics | CziImageStack | public | 0 | 0 | __del__ | def __del__(self):if hasattr(self, "_czi"):# Close CZI fileself._czi.close() | 2 | 3 | 1 | 20 | 0 | 150 | 153 | 150 | self | [] | None | {"Expr": 1, "If": 1} | 2 | 4 | 2 | ["hasattr", "self._czi.close"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95307672_dbfixtures_pytest_postgresql.pytest_postgresql.executor_py.PostgreSQLExecutor.__del__"] | The function (__del__) defined within the public class called CziImageStack.The function start at line 150 and ends at 153. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions called... |
CAREamics_careamics | CziImageStack | public | 0 | 0 | __getstate__ | def __getstate__(self) -> dict[str, Any]:# Remove CziReader object from state to avoid pickling issuesstate = self.__dict__.copy()del state["_czi"]return state | 1 | 4 | 1 | 28 | 0 | 155 | 159 | 155 | self | [] | dict[str, Any] | {"Assign": 1, "Return": 1} | 1 | 5 | 1 | ["self.__dict__.copy"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3629712_opensistemas_hub_osbrain.osbrain.proxy_py.Proxy.__getstate__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.78400723_sagemath_sagetrac_mirror.src.sage.coding.abstract_code_py.AbstractCode.__getstate__", "_.... | The function (__getstate__) defined within the public class called CziImageStack.The function start at line 155 and ends at 159. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function call... |
CAREamics_careamics | CziImageStack | public | 0 | 0 | __setstate__ | def __setstate__(self, state: dict[str, Any]) -> None:# Reopen CZI file after unpicklingself.__dict__.update(state)self._czi = CziReader(str(self.data_path)) | 1 | 3 | 2 | 37 | 0 | 161 | 164 | 161 | self,state | [] | None | {"Assign": 1, "Expr": 1} | 3 | 4 | 3 | ["self.__dict__.update", "CziReader", "str"] | 14 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3629712_opensistemas_hub_osbrain.osbrain.proxy_py.Proxy.__setstate__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.69485146_mgaido91_fbk_fairseq_st.fairseq.legacy_distributed_data_parallel_py.LegacyDistributedData... | The function (__setstate__) defined within the public class called CziImageStack.The function start at line 161 and ends at 164. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [161.0] and does not return any value. It declares 3.0 functions, It has 3.0 functio... |
CAREamics_careamics | CziImageStack | public | 0 | 0 | source | def source(self) -> Path:filename = self.data_path.nameif self.scene is not None:filename = f"{filename}@{self.scene}"return self.data_path.parent / filename | 2 | 5 | 1 | 34 | 0 | 169 | 173 | 169 | self | [] | Path | {"Assign": 2, "If": 1, "Return": 1} | 0 | 5 | 0 | [] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3964638_python_restx_flask_restx.flask_restx.reqparse_py.RequestParser.parse_args", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.78400723_sagemath_sagetrac_mirror.src.sage.combinat.sf.sfa_py.SymmetricFunctionAlgebr... | The function (source) defined within the public class called CziImageStack.The function start at line 169 and ends at 173. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It has 8.0 functions calling this function which are ["... |
CAREamics_careamics | CziImageStack | public | 0 | 0 | extract_patch | def extract_patch(self, sample_idx: int, coords: Sequence[int], patch_size: Sequence[int]) -> NDArray:# Determine 3rd dimension (T, Z or none)if len(coords) == 3:if len(self.axes) != 5:raise ValueError(f"Requested a 3D patch from a 2D image stack with axes {self.axes}.")third_dim = self.axes[2]third_dim_offset, third_d... | 11 | 50 | 4 | 340 | 0 | 175 | 236 | 175 | self,sample_idx,coords,patch_size | [] | NDArray | {"Assign": 15, "For": 2, "If": 7, "Return": 1} | 18 | 62 | 18 | ["len", "len", "ValueError", "len", "ValueError", "np.empty", "list", "self._sample_axes.values", "np.unravel_index", "int", "zip", "self._sample_axes.keys", "range", "range", "self._czi.read", "ValueError", "extracted_roi.squeeze", "patch.squeeze"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.patch_extractor_py.PatchExtractor.extract_patch"] | The function (extract_patch) defined within the public class called CziImageStack.The function start at line 175 and ends at 236. It contains 50 lines of code and it has a cyclomatic complexity of 11. It takes 4 parameters, represented as [175.0] and does not return any value. It declares 18.0 functions, It has 18.0 fu... |
CAREamics_careamics | CziImageStack | public | 0 | 0 | _get_shape | def _get_shape(self) -> tuple[str, list[int], Rectangle, dict[str, int]]:"""Determines the shape of the selected scene.Returns-------axes : strString specifying the axis order. Examples:- "SCZYX" for 3-D volumes if `depth_axis` is `"Z"`.- "SCTYX" for time-series if `depth_axis` is `"T"`.- "SCYX" if `depth_axis` is `"no... | 15 | 47 | 1 | 288 | 0 | 238 | 329 | 238 | self | [] | tuple[str, list[int], Rectangle, dict[str, int]] | {"Assign": 12, "AugAssign": 1, "Expr": 6, "For": 2, "If": 10, "Return": 1} | 8 | 92 | 8 | ["RuntimeError", "RuntimeError", "total_bbox.items", "shape.append", "shape.append", "shape.append", "shape.append", "shape.append"] | 0 | [] | The function (_get_shape) defined within the public class called CziImageStack.The function start at line 238 and ends at 329. It contains 47 lines of code and it has a cyclomatic complexity of 15. The function does not take any parameters and does not return any value. It declares 8.0 functions, and It has 8.0 functi... |
CAREamics_careamics | CziImageStack | public | 0 | 0 | get_bounding_rectangles | def get_bounding_rectangles(cls, czi: Path | str | CziReader) -> dict[int | None, Rectangle]:"""Gets the bounding rectangles of all scenes in a CZI file.Parameters----------czi : Path or str or pyczi.CziReaderPath to the CZI file or an already opened file as CziReader object.Returns-------dict[int | None, Rectangle]A d... | 4 | 11 | 2 | 92 | 0 | 332 | 360 | 332 | cls,czi | [] | dict[int | None, Rectangle] | {"Assign": 1, "Expr": 1, "If": 2, "Return": 3, "With": 1} | 7 | 29 | 7 | ["isinstance", "open_czi", "str", "cls.get_bounding_rectangles", "len", "int", "scenes_bounding_rectangle.items"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.patch_extractor_factory_py.create_czi_extractor", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.dataset_ng.pat... | The function (get_bounding_rectangles) defined within the public class called CziImageStack.The function start at line 332 and ends at 360. It contains 11 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [332.0] and does not return any value. It declares 7.0 functions, It has... |
CAREamics_careamics | ImageStack | public | 1 | 1 | extract_patch | def extract_patch(self, sample_idx: int, coords: Sequence[int], patch_size: Sequence[int]) -> NDArray:"""Extracts a patch for a given sample within the image stack.Parameters----------sample_idx: intSample index. The first dimension of the image data will be indexed at thisvalue.coords: Sequence of intThe coordinates t... | 1 | 4 | 4 | 27 | 0 | 32 | 54 | 32 | self,sample_idx,coords,patch_size | [] | NDArray | {"Expr": 2} | 0 | 23 | 0 | [] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.patch_extractor_py.PatchExtractor.extract_patch"] | The function (extract_patch) defined within the public class called ImageStack, implement an interface, and it inherit another class.The function start at line 32 and ends at 54. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [32.0] and does not return any val... |
CAREamics_careamics | InMemoryImageStack | public | 0 | 0 | __init__ | def __init__(self, source: Union[Path, Literal["array"]], data: NDArray):self.source: Union[Path, Literal["array"]] = source# data expected to be in SC(Z)YX shape, reason to use from_array constructorself._data: NDArray = dataself.data_shape: Sequence[int] = self._data.shapeself.data_dtype: DTypeLike = self._data.dtype | 1 | 5 | 3 | 68 | 0 | 16 | 21 | 16 | self,source,data | [] | None | {"AnnAssign": 4} | 0 | 6 | 0 | [] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called InMemoryImageStack.The function start at line 16 and ends at 21. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [16.0] and does not return any value. It has 8182.0 functions calling this function w... |
CAREamics_careamics | InMemoryImageStack | public | 0 | 0 | extract_patch | def extract_patch(self, sample_idx: int, coords: Sequence[int], patch_size: Sequence[int]) -> NDArray:if len(coords) != len(patch_size):raise ValueError("Length of coords and extent must match.")# TODO: test for 2D or 3D?return self._data[(sample_idx,# type: ignore...,# type: ignore*[slice(c, c + e) for c, e in zip(coo... | 3 | 12 | 4 | 80 | 0 | 23 | 35 | 23 | self,sample_idx,coords,patch_size | [] | NDArray | {"If": 1, "Return": 1} | 5 | 13 | 5 | ["len", "len", "ValueError", "slice", "zip"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.patch_extractor_py.PatchExtractor.extract_patch"] | The function (extract_patch) defined within the public class called InMemoryImageStack.The function start at line 23 and ends at 35. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [23.0] and does not return any value. It declares 5.0 functions, It has 5.0 fun... |
CAREamics_careamics | InMemoryImageStack | public | 0 | 0 | from_array | def from_array(cls, data: NDArray, axes: str) -> Self:data = reshape_array(data, axes)return cls(source="array", data=data) | 1 | 3 | 3 | 34 | 0 | 38 | 40 | 38 | cls,data,axes | [] | Self | {"Assign": 1, "Return": 1} | 2 | 3 | 2 | ["reshape_array", "cls"] | 5 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70150997_xarray_contrib_flox.flox.core_py._unify_chunks", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.70150997_xarray_contrib_flox.tests.strategies_py.chunked_arrays", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_... | The function (from_array) defined within the public class called InMemoryImageStack.The function start at line 38 and ends at 40. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [38.0] and does not return any value. It declares 2.0 functions, It has 2.0 functio... |
CAREamics_careamics | InMemoryImageStack | public | 0 | 0 | from_tiff | def from_tiff(cls, path: Path, axes: str) -> Self:data = read_tiff(path)data = reshape_array(data, axes)return cls(source=path, data=data) | 1 | 4 | 3 | 40 | 0 | 43 | 46 | 43 | cls,path,axes | [] | Self | {"Assign": 2, "Return": 1} | 3 | 4 | 3 | ["read_tiff", "reshape_array", "cls"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.patch_extractor_factory_py.create_tiff_extractor"] | The function (from_tiff) defined within the public class called InMemoryImageStack.The function start at line 43 and ends at 46. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [43.0] and does not return any value. It declares 3.0 functions, It has 3.0 function... |
CAREamics_careamics | InMemoryImageStack | public | 0 | 0 | from_custom_file_type | def from_custom_file_type(cls, path: Path, axes: str, read_func: ReadFunc, **read_kwargs: Any) -> Self:data = read_func(path, **read_kwargs)data = reshape_array(data, axes)return cls(source=path, data=data) | 1 | 6 | 5 | 52 | 0 | 49 | 54 | 49 | cls,path,axes,read_func,**read_kwargs | [] | Self | {"Assign": 2, "Return": 1} | 3 | 6 | 3 | ["read_func", "reshape_array", "cls"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.patch_extractor_factory_py.create_custom_file_extractor"] | The function (from_custom_file_type) defined within the public class called InMemoryImageStack.The function start at line 49 and ends at 54. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [49.0] and does not return any value. It declares 3.0 functions, It has ... |
CAREamics_careamics | ZarrImageStack | public | 0 | 0 | __init__ | def __init__(self, store: LocalStore | FsspecStore, data_path: str, axes: str):self._store = storeself._array = zarr.open_array(store=self._store, path=data_path, mode="r")# TODO: validate axes# - must contain XY# - must be subset of STCZYXself._original_axes = axesself._original_data_shape: tuple[int, ...] = self._arr... | 1 | 7 | 4 | 88 | 0 | 21 | 30 | 21 | self,store,data_path,axes | [] | None | {"AnnAssign": 1, "Assign": 5} | 2 | 10 | 2 | ["zarr.open_array", "_reshaped_array_shape"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called ZarrImageStack.The function start at line 21 and ends at 30. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [21.0] and does not return any value. It declares 2.0 functions, It has 2.0 functions cal... |
CAREamics_careamics | ZarrImageStack | public | 0 | 0 | source | def source(self) -> Path:return Path(self._store.path) / self._array.path | 1 | 2 | 1 | 22 | 0 | 36 | 37 | 36 | self | [] | Path | {"Return": 1} | 1 | 2 | 1 | ["Path"] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3964638_python_restx_flask_restx.flask_restx.reqparse_py.RequestParser.parse_args", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.78400723_sagemath_sagetrac_mirror.src.sage.combinat.sf.sfa_py.SymmetricFunctionAlgebr... | The function (source) defined within the public class called ZarrImageStack.The function start at line 36 and ends at 37. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, It has 1.0 function called insi... |
CAREamics_careamics | ZarrImageStack | public | 0 | 0 | from_ome_zarr | def from_ome_zarr(cls, path: Union[Path, str]) -> Self:"""Will only use the first resolution in the hierarchy.Assumes the path only contains 1 image.Path can be to a local file, or it can be a URL to a zarr stored in the cloud.Parameters----------path : Union[Path, str]Path to the root of the OME-Zarr, local file or ur... | 5 | 20 | 2 | 170 | 0 | 43 | 93 | 43 | cls,path | [] | Self | {"Assign": 7, "Expr": 1, "If": 3, "Return": 1} | 13 | 51 | 13 | ["is_file", "Path", "zarr.storage.LocalStore", "resolve", "Path", "validators.url", "zarr.storage.FsspecStore.from_url", "ValueError", "zarr.open_group", "ValueError", "upper", "join", "cls"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.patch_extractor_factory_py.create_ome_zarr_extractor", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.dataset_n... | The function (from_ome_zarr) defined within the public class called ZarrImageStack.The function start at line 43 and ends at 93. It contains 20 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [43.0] and does not return any value. It declares 13.0 functions, It has 13.0 funct... |
CAREamics_careamics | ZarrImageStack | public | 0 | 0 | extract_patch | def extract_patch(self, sample_idx: int, coords: Sequence[int], patch_size: Sequence[int]) -> NDArray:# original axes assumed to be any subset of STCZYX (containing YX), in any order# arguments must be transformed to index data in original axes order# to do this: loop through original axes and append correct index/slic... | 13 | 34 | 4 | 285 | 0 | 95 | 137 | 95 | self,sample_idx,coords,patch_size | [] | NDArray | {"AnnAssign": 1, "Assign": 4, "Expr": 6, "For": 1, "If": 8, "Return": 1} | 18 | 43 | 18 | ["IndexError", "patch_slice.append", "self._get_S_index", "patch_slice.append", "self._get_T_index", "patch_slice.append", "slice", "patch_slice.append", "slice", "patch_slice.append", "slice", "patch_slice.append", "slice", "ValueError", "tuple", "replace", "self._original_axes.replace", "reshape_array"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.patch_extractor_py.PatchExtractor.extract_patch"] | The function (extract_patch) defined within the public class called ZarrImageStack.The function start at line 95 and ends at 137. It contains 34 lines of code and it has a cyclomatic complexity of 13. It takes 4 parameters, represented as [95.0] and does not return any value. It declares 18.0 functions, It has 18.0 fun... |
CAREamics_careamics | ZarrImageStack | public | 0 | 0 | _get_T_index | def _get_T_index(self, sample_idx: int) -> int:"""Get T index given `sample_idx`."""if "T" not in self._original_axes:raise ValueError("No 'T' axis specified in original data axes.")axis_idx = self._original_axes.index("T")dim = self._original_data_shape[axis_idx]# new S' = S*T# T_idx = S_idx' // T_size# S_idx = S_idx'... | 2 | 6 | 2 | 47 | 0 | 139 | 151 | 139 | self,sample_idx | [] | int | {"Assign": 2, "Expr": 1, "If": 1, "Return": 1} | 2 | 13 | 2 | ["ValueError", "self._original_axes.index"] | 0 | [] | The function (_get_T_index) defined within the public class called ZarrImageStack.The function start at line 139 and ends at 151. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [139.0] and does not return any value. It declares 2.0 functions, and It has 2.0 f... |
CAREamics_careamics | ZarrImageStack | public | 0 | 0 | _get_S_index | def _get_S_index(self, sample_idx: int) -> int:"""Get S index given `sample_idx`."""if "S" not in self._original_axes:raise ValueError("No 'S' axis specified in original data axes.")if "T" in self._original_axes:T_axis_idx = self._original_axes.index("T")T_dim = self._original_data_shape[T_axis_idx]# new S' = S*T# T_id... | 3 | 9 | 2 | 57 | 0 | 153 | 168 | 153 | self,sample_idx | [] | int | {"Assign": 2, "Expr": 1, "If": 2, "Return": 2} | 2 | 16 | 2 | ["ValueError", "self._original_axes.index"] | 0 | [] | The function (_get_S_index) defined within the public class called ZarrImageStack.The function start at line 153 and ends at 168. It contains 9 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [153.0] and does not return any value. It declares 2.0 functions, and It has 2.0 f... |
CAREamics_careamics | public | public | 0 | 0 | _reshaped_array_shape | def _reshaped_array_shape(axes: str, shape: Sequence[int]) -> tuple[int, ...]:"""Find resulting shape if reshaping array with given `axes` and `shape`."""target_axes = "SCZYX"target_shape = []for d in target_axes:if d in axes:idx = axes.index(d)target_shape.append(shape[idx])elif (d != axes) and (d != "Z"):target_shape... | 6 | 15 | 2 | 110 | 3 | 172 | 189 | 172 | axes,shape | ['idx', 'target_axes', 'target_shape'] | tuple[int, ...] | {"Assign": 5, "Expr": 3, "For": 1, "If": 3, "Return": 1} | 5 | 18 | 5 | ["axes.index", "target_shape.append", "target_shape.append", "axes.index", "tuple"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.image_stack.zarr_image_stack_py.ZarrImageStack.__init__"] | The function (_reshaped_array_shape) defined within the public class called public.The function start at line 172 and ends at 189. It contains 15 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [172.0] and does not return any value. It declares 5.0 functions, It has 5.0 func... |
CAREamics_careamics | PatchingStrategy | public | 1 | 1 | n_patches | def n_patches(self) -> int:"""The number of patches that the patching strategy will return.It also determines the maximum index that can be given to `get_patch_spec`,and the length of the `CAREamicsDataset`.Returns-------intNumber of patches."""... | 1 | 2 | 1 | 9 | 0 | 81 | 93 | 81 | self | [] | int | {"Expr": 2} | 0 | 13 | 0 | [] | 0 | [] | The function (n_patches) defined within the public class called PatchingStrategy, implement an interface, and it inherit another class.The function start at line 81 and ends at 93. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any valu... |
CAREamics_careamics | PatchingStrategy | public | 1 | 1 | get_patch_spec | def get_patch_spec(self, index: int) -> PatchSpecs:"""Get a patch specification for a given patch index.This method is intended to be called from within the`CAREamicsDataset.__getitem__`. The index will be passed through from thismethod.Parameters----------index : intA patch index.Returns-------PatchSpecsA dictionary t... | 1 | 2 | 2 | 13 | 0 | 95 | 113 | 95 | self,index | [] | PatchSpecs | {"Expr": 2} | 0 | 19 | 0 | [] | 0 | [] | The function (get_patch_spec) defined within the public class called PatchingStrategy, implement an interface, and it inherit another class.The function start at line 95 and ends at 113. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [95.0] and does not return... |
CAREamics_careamics | RandomPatchingStrategy | public | 0 | 0 | __init__ | def __init__(self,data_shapes: Sequence[Sequence[int]],patch_size: Sequence[int],seed: int | None = None,):"""A patching strategy for sampling random patches.Parameters----------data_shapes : sequence of (sequence of int)The shapes of the underlying data. Each element is the dimension of theaxes SC(Z)YX.patch_size : se... | 1 | 14 | 4 | 83 | 0 | 29 | 61 | 29 | self,data_shapes,patch_size,seed | [] | None | {"Assign": 4, "Expr": 1} | 2 | 33 | 2 | ["np.random.default_rng", "self._calc_bins"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called RandomPatchingStrategy.The function start at line 29 and ends at 61. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [29.0] and does not return any value. It declares 2.0 functions, It has 2.0 func... |
CAREamics_careamics | RandomPatchingStrategy | public | 0 | 0 | n_patches | def n_patches(self) -> int:"""The number of patches that this patching strategy will return.It also determines the maximum index that can be given to `get_patch_spec`."""# last bin boundary will be total patchesreturn self.image_stack_cumulative_patches[-1] | 1 | 2 | 1 | 16 | 0 | 64 | 71 | 64 | self | [] | int | {"Expr": 1, "Return": 1} | 0 | 8 | 0 | [] | 0 | [] | The function (n_patches) defined within the public class called RandomPatchingStrategy.The function start at line 64 and ends at 71. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
CAREamics_careamics | RandomPatchingStrategy | public | 0 | 0 | get_patch_spec | def get_patch_spec(self, index: int) -> PatchSpecs:"""Return the patch specs for a given index.Parameters----------index : intA patch index.Returns-------PatchSpecsA dictionary that specifies a single patch in a series of `ImageStacks`."""# TODO: break into smaller testable functions?if index >= self.n_patches:raise In... | 3 | 24 | 2 | 138 | 0 | 73 | 116 | 73 | self,index | [] | PatchSpecs | {"Assign": 8, "Expr": 1, "If": 2, "Return": 1} | 6 | 44 | 6 | ["IndexError", "item", "np.digitize", "item", "np.digitize", "_generate_random_coords"] | 0 | [] | The function (get_patch_spec) defined within the public class called RandomPatchingStrategy.The function start at line 73 and ends at 116. It contains 24 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [73.0] and does not return any value. It declares 6.0 functions, and It ... |
CAREamics_careamics | RandomPatchingStrategy | public | 0 | 0 | _calc_bins | def _calc_bins(data_shapes: Sequence[Sequence[int]], patch_size: Sequence[int]) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...]]:"""Calculate bins used to map an index to an image_stack and a sample.The number of patches in each sample is based on the number of patches thatwould fit if they were sampled sequ... | 2 | 20 | 2 | 167 | 0 | 119 | 175 | 119 | data_shapes,patch_size | [] | tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...]] | {"AnnAssign": 3, "Assign": 5, "Expr": 4, "For": 1, "Return": 1} | 10 | 57 | 10 | ["_calc_n_patches", "patches_per_image_stack.append", "patches_per_sample.extend", "samples_per_image_stack.append", "np.cumsum", "np.cumsum", "np.cumsum", "tuple", "tuple", "tuple"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.dataset_ng.patching_strategies.test_random_patching_ng_py.test_calc_patch_bins"] | The function (_calc_bins) defined within the public class called RandomPatchingStrategy.The function start at line 119 and ends at 175. It contains 20 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [119.0] and does not return any value. It declares 10.0 functions, It has 10... |
CAREamics_careamics | RandomPatchingStrategy | public | 0 | 0 | __init__ | def __init__(self,data_shapes: Sequence[Sequence[int]],patch_size: Sequence[int],seed: int | None = None,):"""A patching strategy for sampling random patches.Parameters----------data_shapes : sequence of (sequence of int)The shapes of the underlying data. Each element is the dimension of theaxes SC(Z)YX.patch_size : se... | 4 | 25 | 4 | 161 | 0 | 191 | 230 | 191 | self,data_shapes,patch_size,seed | [] | None | {"Assign": 4, "Expr": 1} | 2 | 33 | 2 | ["np.random.default_rng", "self._calc_bins"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called RandomPatchingStrategy.The function start at line 191 and ends at 230. It contains 25 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [191.0] and does not return any value. It declares 2.0 functions, It has 2.0 f... |
CAREamics_careamics | RandomPatchingStrategy | public | 0 | 0 | n_patches | def n_patches(self):"""The number of patches that this patching strategy will return.It also determines the maximum index that can be given to `get_patch_spec`."""return len(self.fixed_patch_specs) | 1 | 2 | 1 | 13 | 0 | 233 | 239 | 233 | self | [] | int | {"Expr": 1, "Return": 1} | 0 | 8 | 0 | [] | 0 | [] | The function (n_patches) defined within the public class called RandomPatchingStrategy.The function start at line 233 and ends at 239. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
CAREamics_careamics | RandomPatchingStrategy | public | 0 | 0 | get_patch_spec | def get_patch_spec(self, index: int) -> PatchSpecs:"""Return the patch specs for a given index.Parameters----------index : intA patch index.Returns-------PatchSpecsA dictionary that specifies a single patch in a series of `ImageStacks`."""if index >= self.n_patches:raise IndexError(f"Index {index} out of bounds for Fix... | 2 | 7 | 2 | 34 | 0 | 241 | 260 | 241 | self,index | [] | PatchSpecs | {"Assign": 8, "Expr": 1, "If": 2, "Return": 1} | 6 | 44 | 6 | ["IndexError", "item", "np.digitize", "item", "np.digitize", "_generate_random_coords"] | 0 | [] | The function (get_patch_spec) defined within the public class called RandomPatchingStrategy.The function start at line 241 and ends at 260. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [241.0] and does not return any value. It declares 6.0 functions, and It... |
CAREamics_careamics | public | public | 0 | 0 | _generate_random_coords | def _generate_random_coords(spatial_shape: Sequence[int], patch_size: Sequence[int], rng: np.random.Generator) -> tuple[int, ...]:"""Generate random patch coordinates for a given `spatial_shape` and `patch_size`.The coords are the top-left (and first z-slice for 3D data) of a patch. Thesequence will have length 2 or 3,... | 2 | 17 | 3 | 103 | 0 | 263 | 307 | 263 | spatial_shape,patch_size,rng | [] | tuple[int, ...] | {"Expr": 1, "If": 1, "Return": 1} | 12 | 45 | 12 | ["len", "len", "ValueError", "len", "len", "tuple", "tolist", "rng.integers", "np.zeros", "len", "np.array", "np.array"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patching_strategies.random_patching_py.FixedRandomPatchingStrategy.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.care... | The function (_generate_random_coords) defined within the public class called public.The function start at line 263 and ends at 307. It contains 17 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [263.0] and does not return any value. It declares 12.0 functions, It has 12.0 ... |
CAREamics_careamics | public | public | 0 | 0 | _calc_n_patches | def _calc_n_patches(spatial_shape: Sequence[int], patch_size: Sequence[int]) -> int:"""Calculates the number of patches for a given `spatial_shape` and `patch_size`.This is based on the number of patches that would fit if they were sampledsequentially.Parameters----------spatial_shape : sequence of intThe dimension of ... | 3 | 12 | 2 | 81 | 2 | 310 | 341 | 310 | spatial_shape,patch_size | ['patches_per_dim', 'total_patches'] | int | {"Assign": 2, "Expr": 1, "If": 1, "Return": 1} | 9 | 32 | 9 | ["len", "len", "ValueError", "len", "len", "np.ceil", "zip", "int", "np.prod"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patching_strategies.random_patching_py.FixedRandomPatchingStrategy.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.care... | The function (_calc_n_patches) defined within the public class called public.The function start at line 310 and ends at 341. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [310.0] and does not return any value. It declares 9.0 functions, It has 9.0 functions ... |
CAREamics_careamics | SequentialPatchingStrategy | public | 0 | 0 | __init__ | def __init__(self,data_shapes: Sequence[Sequence[int]],patch_size: Sequence[int],overlaps: Sequence[int] | None = None,):self.data_shapes = data_shapesself.patch_size = patch_sizeif overlaps is None:overlaps = [0] * len(patch_size)self.overlaps = np.asarray(overlaps)self.patch_specs: list[PatchSpecs] = self._initialize... | 2 | 12 | 4 | 83 | 0 | 16 | 28 | 16 | self,data_shapes,patch_size,overlaps | [] | None | {"AnnAssign": 1, "Assign": 4, "If": 1} | 3 | 13 | 3 | ["len", "np.asarray", "self._initialize_patch_specs"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called SequentialPatchingStrategy.The function start at line 16 and ends at 28. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [16.0] and does not return any value. It declares 3.0 functions, It has 3.0 ... |
CAREamics_careamics | SequentialPatchingStrategy | public | 0 | 0 | n_patches | def n_patches(self) -> int:return len(self.patch_specs) | 1 | 2 | 1 | 14 | 0 | 31 | 32 | 31 | self | [] | int | {"Return": 1} | 1 | 2 | 1 | ["len"] | 0 | [] | The function (n_patches) defined within the public class called SequentialPatchingStrategy.The function start at line 31 and ends at 32. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 ... |
CAREamics_careamics | SequentialPatchingStrategy | public | 0 | 0 | get_patch_spec | def get_patch_spec(self, index: int) -> PatchSpecs:return self.patch_specs[index] | 1 | 2 | 2 | 18 | 0 | 34 | 35 | 34 | self,index | [] | PatchSpecs | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (get_patch_spec) defined within the public class called SequentialPatchingStrategy.The function start at line 34 and ends at 35. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [34.0] and does not return any value.. |
CAREamics_careamics | SequentialPatchingStrategy | public | 0 | 0 | _compute_coords_1d | def _compute_coords_1d(self, patch_size: int, spatial_shape: int, overlap: int) -> list[tuple[int, int]]:step = patch_size - overlapcrop_coords = []current_pos = 0while current_pos <= spatial_shape - patch_size:crop_coords.append((current_pos, current_pos + patch_size))current_pos += stepif crop_coords[-1][1] < spatial... | 3 | 12 | 4 | 87 | 0 | 37 | 51 | 37 | self,patch_size,spatial_shape,overlap | [] | list[tuple[int, int]] | {"Assign": 3, "AugAssign": 1, "Expr": 2, "If": 1, "Return": 1, "While": 1} | 2 | 15 | 2 | ["crop_coords.append", "crop_coords.append"] | 0 | [] | The function (_compute_coords_1d) defined within the public class called SequentialPatchingStrategy.The function start at line 37 and ends at 51. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [37.0] and does not return any value. It declares 2.0 functions, a... |
CAREamics_careamics | SequentialPatchingStrategy | public | 0 | 0 | _initialize_patch_specs | def _initialize_patch_specs(self) -> list[PatchSpecs]:patch_specs: list[PatchSpecs] = []for data_idx, data_shape in enumerate(self.data_shapes):data_spatial_shape = data_shape[-len(self.patch_size) :]coords_list = [self._compute_coords_1d(self.patch_size[i], data_spatial_shape[i], self.overlaps[i])for i in range(len(se... | 6 | 21 | 1 | 143 | 0 | 53 | 74 | 53 | self | [] | list[PatchSpecs] | {"AnnAssign": 1, "Assign": 2, "Expr": 1, "For": 3, "Return": 1} | 10 | 22 | 10 | ["enumerate", "len", "self._compute_coords_1d", "range", "len", "range", "itertools.product", "patch_specs.append", "PatchSpecs", "tuple"] | 0 | [] | The function (_initialize_patch_specs) defined within the public class called SequentialPatchingStrategy.The function start at line 53 and ends at 74. It contains 21 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value. It declares 10.0 functions... |
CAREamics_careamics | TilingStrategy | public | 0 | 0 | __init__ | def __init__(self,data_shapes: Sequence[Sequence[int]],tile_size: Sequence[int],overlaps: Sequence[int],):"""The tiling strategy should be used for prediction. The `get_patch_specs`method returns `TileSpec` dictionaries that contains information on how tostitch the tiles back together to create the full image.Parameter... | 1 | 10 | 4 | 60 | 0 | 16 | 42 | 16 | self,data_shapes,tile_size,overlaps | [] | None | {"AnnAssign": 1, "Assign": 3, "Expr": 1} | 1 | 27 | 1 | ["self._generate_specs"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called TilingStrategy.The function start at line 16 and ends at 42. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [16.0] and does not return any value. It declare 1.0 function, It has 1.0 function calle... |
CAREamics_careamics | TilingStrategy | public | 0 | 0 | n_patches | def n_patches(self) -> int:"""The number of patches that this patching strategy will return.It also determines the maximum index that can be given to `get_patch_spec`."""return len(self.tile_specs) | 1 | 2 | 1 | 15 | 0 | 45 | 51 | 45 | self | [] | int | {"Expr": 1, "Return": 1} | 1 | 7 | 1 | ["len"] | 0 | [] | The function (n_patches) defined within the public class called TilingStrategy.The function start at line 45 and ends at 51. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 function cal... |
CAREamics_careamics | TilingStrategy | public | 0 | 0 | get_patch_spec | def get_patch_spec(self, index: int) -> TileSpecs:"""Return the tile specs for a given index.Parameters----------index : intA patch index.Returns-------TileSpecsA dictionary that specifies a single patch in a series of `ImageStacks`."""return self.tile_specs[index] | 1 | 2 | 2 | 19 | 0 | 53 | 66 | 53 | self,index | [] | TileSpecs | {"Expr": 1, "Return": 1} | 0 | 14 | 0 | [] | 0 | [] | The function (get_patch_spec) defined within the public class called TilingStrategy.The function start at line 53 and ends at 66. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [53.0] and does not return any value.. |
CAREamics_careamics | TilingStrategy | public | 0 | 0 | _generate_specs | def _generate_specs(self) -> list[TileSpecs]:tile_specs: list[TileSpecs] = []for data_idx, data_shape in enumerate(self.data_shapes):spatial_shape = data_shape[2:]# spec info for each axisaxis_specs: list[tuple[list[int], list[int], list[int], list[int]]] = [self._compute_1d_coords(axis_size, self.tile_size[axis_idx], ... | 5 | 33 | 1 | 213 | 0 | 68 | 108 | 68 | self | [] | list[TileSpecs] | {"AnnAssign": 2, "Assign": 2, "Expr": 1, "For": 3, "Return": 1} | 11 | 41 | 11 | ["enumerate", "self._compute_1d_coords", "enumerate", "zip", "range", "zip", "itertools.product", "itertools.product", "itertools.product", "itertools.product", "tile_specs.append"] | 0 | [] | The function (_generate_specs) defined within the public class called TilingStrategy.The function start at line 68 and ends at 108. It contains 33 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value. It declares 11.0 functions, and It has 11.0 ... |
CAREamics_careamics | TilingStrategy | public | 0 | 0 | _compute_1d_coords | def _compute_1d_coords(axis_size: int, tile_size: int, overlap: int) -> tuple[list[int], list[int], list[int], list[int]]:"""Computes the TileSpec information for a single axis.Parameters----------axis_size : intThe size of the axis.tile_size : intThe tile size.overlap : intThe tile overlap.Returns-------coords: list o... | 7 | 33 | 3 | 268 | 0 | 111 | 172 | 111 | axis_size,tile_size,overlap | [] | tuple[list[int], list[int], list[int], list[int]] | {"AnnAssign": 4, "Assign": 4, "Expr": 13, "For": 1, "If": 2, "Return": 1} | 15 | 62 | 15 | ["range", "max", "coords.append", "crop_coords.append", "stitch_coords.append", "crop_size.append", "coords.append", "crop_coords.append", "stitch_coords.append", "crop_size.append", "coords.append", "max", "stitch_coords.append", "crop_coords.append", "crop_size.append"] | 0 | [] | The function (_compute_1d_coords) defined within the public class called TilingStrategy.The function start at line 111 and ends at 172. It contains 33 lines of code and it has a cyclomatic complexity of 7. It takes 3 parameters, represented as [111.0] and does not return any value. It declares 15.0 functions, and It h... |
CAREamics_careamics | WholeSamplePatchingStrategy | public | 0 | 0 | __init__ | def __init__(self, data_shapes: Sequence[Sequence[int]]):self.data_shapes = data_shapesself.patch_specs: list[PatchSpecs] = self._initialize_patch_specs() | 1 | 3 | 2 | 34 | 0 | 11 | 14 | 11 | self,data_shapes | [] | None | {"AnnAssign": 1, "Assign": 1} | 1 | 4 | 1 | ["self._initialize_patch_specs"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called WholeSamplePatchingStrategy.The function start at line 11 and ends at 14. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [11.0] and does not return any value. It declare 1.0 function, It has 1.0 fu... |
CAREamics_careamics | WholeSamplePatchingStrategy | public | 0 | 0 | n_patches | def n_patches(self) -> int:return len(self.patch_specs) | 1 | 2 | 1 | 14 | 0 | 17 | 18 | 17 | self | [] | int | {"Return": 1} | 1 | 2 | 1 | ["len"] | 0 | [] | The function (n_patches) defined within the public class called WholeSamplePatchingStrategy.The function start at line 17 and ends at 18. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0... |
CAREamics_careamics | WholeSamplePatchingStrategy | public | 0 | 0 | get_patch_spec | def get_patch_spec(self, index: int) -> PatchSpecs:return self.patch_specs[index] | 1 | 2 | 2 | 18 | 0 | 20 | 21 | 20 | self,index | [] | PatchSpecs | {"Return": 1} | 0 | 2 | 0 | [] | 0 | [] | The function (get_patch_spec) defined within the public class called WholeSamplePatchingStrategy.The function start at line 20 and ends at 21. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [20.0] and does not return any value.. |
CAREamics_careamics | WholeSamplePatchingStrategy | public | 0 | 0 | _initialize_patch_specs | def _initialize_patch_specs(self) -> list[PatchSpecs]:patch_specs: list[PatchSpecs] = []for data_idx, data_shape in enumerate(self.data_shapes):spatial_shape = data_shape[2:]for sample_idx in range(data_shape[0]):patch_specs.append({"data_idx": data_idx,"sample_idx": sample_idx,"coords": tuple(0 for _ in spatial_shape)... | 4 | 14 | 1 | 81 | 0 | 23 | 36 | 23 | self | [] | list[PatchSpecs] | {"AnnAssign": 1, "Assign": 1, "Expr": 1, "For": 2, "Return": 1} | 4 | 14 | 4 | ["enumerate", "range", "patch_specs.append", "tuple"] | 0 | [] | The function (_initialize_patch_specs) defined within the public class called WholeSamplePatchingStrategy.The function start at line 23 and ends at 36. It contains 14 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 4.0 functions... |
CAREamics_careamics | ReadFunc | public | 1 | 1 | __call__ | def __call__(self, file_path: Path, *args, **kwargs) -> NDArray:"""Type hinted callables must match this function signature (not including self).Parameters----------file_path : pathlib.PathPath to file.*argsOther positional arguments.**kwargsOther keyword arguments.""" | 1 | 1 | 4 | 18 | 0 | 19 | 31 | 19 | self,file_path,*args,**kwargs | [] | NDArray | {"Expr": 1} | 0 | 13 | 0 | [] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called ReadFunc, implement an interface, and it inherit another class.The function start at line 19 and ends at 31. It contains 1 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [19.0] and does not return any value. It ... |
CAREamics_careamics | public | public | 0 | 0 | get_read_func | def get_read_func(data_type: Union[str, SupportedData]) -> Callable:"""Get the read function for the data type.Parameters----------data_type : SupportedDataData type.Returns-------callableRead function."""if data_type in READ_FUNCS:data_type = SupportedData(data_type)# mypy complaining about dict key typereturn READ_FU... | 2 | 6 | 1 | 39 | 1 | 39 | 57 | 39 | data_type | ['data_type'] | Callable | {"Assign": 1, "Expr": 1, "If": 1, "Return": 1} | 2 | 19 | 2 | ["SupportedData", "NotImplementedError"] | 4 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.predict_data_module_py.PredictDataModule.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.train_data_... | The function (get_read_func) defined within the public class called public.The function start at line 39 and ends at 57. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions called in... |
CAREamics_careamics | public | public | 0 | 0 | read_tiff | def read_tiff(file_path: Path, *args: list, **kwargs: dict) -> np.ndarray:"""Read a tiff file and return a numpy array.Parameters----------file_path : PathPath to a file.*args : listAdditional arguments.**kwargs : dictAdditional keyword arguments.Returns-------np.ndarrayResulting array.Raises------ValueErrorIf the file... | 3 | 12 | 3 | 77 | 1 | 16 | 58 | 16 | file_path,*args,**kwargs | ['array'] | np.ndarray | {"Assign": 1, "Expr": 2, "If": 1, "Return": 1, "Try": 1} | 5 | 43 | 5 | ["fnmatch", "SupportedData.get_extension_pattern", "tifffile.imread", "logging.exception", "ValueError"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.dataset_ng.patch_extractor.image_stack.in_memory_image_stack_py.InMemoryImageStack.from_tiff", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.te... | The function (read_tiff) defined within the public class called public.The function start at line 16 and ends at 58. It contains 12 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [16.0] and does not return any value. It declares 5.0 functions, It has 5.0 functions called in... |
CAREamics_careamics | WriteFunc | public | 1 | 1 | __call__ | def __call__(self, file_path: Path, img: NDArray, *args, **kwargs) -> None:"""Type hinted callables must match this function signature (not including self).Parameters----------file_path : pathlib.PathPath to file.img : numpy.ndarrayImage data to save.*argsOther positional arguments.**kwargsOther keyword arguments.""" | 1 | 1 | 5 | 22 | 0 | 21 | 35 | 21 | self,file_path,img,*args,**kwargs | [] | None | {"Expr": 1} | 0 | 15 | 0 | [] | 59 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3468756_plone_plone_app_cmsui.src.plone.app.cmsui.historypanel_py.HistoryPanel.__call__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3508200_spiral_project_daybed.daybed.renderers_py.GeoJSON.__call__", "_.content... | The function (__call__) defined within the public class called WriteFunc, implement an interface, and it inherit another class.The function start at line 21 and ends at 35. It contains 1 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [21.0] and does not return any value. It... |
CAREamics_careamics | public | public | 0 | 0 | get_write_func | def get_write_func(data_type: SupportedWriteType) -> WriteFunc:"""Get the write function for the data type.Parameters----------data_type : {"tiff", "custom"}Data type.Returns-------callableWrite function."""# error raised here if not supporteddata_type_ = SupportedData(data_type)# new variable for mypy# error if no wri... | 2 | 5 | 1 | 33 | 1 | 43 | 63 | 43 | data_type | ['data_type_'] | WriteFunc | {"Assign": 1, "Expr": 1, "If": 1, "Return": 1} | 2 | 21 | 2 | ["SupportedData", "NotImplementedError"] | 3 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.careamist_py.CAREamist.predict_to_disk", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.callbacks.prediction_writer_call... | The function (get_write_func) defined within the public class called public.The function start at line 43 and ends at 63. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 functions, It has 2.0 functions called i... |
CAREamics_careamics | public | public | 0 | 0 | write_tiff | def write_tiff(file_path: Path, img: NDArray, *args, **kwargs) -> None:# TODO: add link to tiffile docs for args kwrgs?"""Write tiff files.Parameters----------file_path : pathlib.PathPath to file.img : numpy.ndarrayImage data to save.*argsPositional arguments passed to `tifffile.imwrite`.**kwargsKeyword arguments passe... | 2 | 8 | 4 | 58 | 0 | 12 | 40 | 12 | file_path,img,*args,**kwargs | [] | None | {"Expr": 2, "If": 1} | 4 | 29 | 4 | ["fnmatch", "SupportedData.get_extension_pattern", "ValueError", "tifffile.imwrite"] | 2 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.file_io.write.test_write_tiff_py.test_invalid_extension_error", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.file_io.write.test_write_tiff_py.te... | The function (write_tiff) defined within the public class called public.The function start at line 12 and ends at 40. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [12.0] and does not return any value. It declares 4.0 functions, It has 4.0 functions called in... |
CAREamics_careamics | FCNModule | public | 0 | 1 | __init__ | def __init__(self, algorithm_config: Union[UNetBasedAlgorithm, VAEBasedAlgorithm, dict]) -> None:"""Lightning module for CAREamics.This class encapsulates the a PyTorch model along with the training, validation,and testing logic. It is configured using an `AlgorithmModel` Pydantic class.Parameters----------algorithm_co... | 3 | 21 | 2 | 150 | 0 | 74 | 110 | 74 | self,algorithm_config | [] | None | {"AnnAssign": 2, "Assign": 10, "Expr": 2, "If": 2} | 8 | 37 | 8 | ["__init__", "super", "isinstance", "algorithm_factory", "isinstance", "N2VManipulateTorch", "model_factory", "loss_factory"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called FCNModule, that inherit another class.The function start at line 74 and ends at 110. It contains 21 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [74.0] and does not return any value. It declares 8.0 functions,... |
CAREamics_careamics | FCNModule | public | 0 | 1 | forward | def forward(self, x: Any) -> Any:"""Forward pass.Parameters----------x : AnyInput tensor.Returns-------AnyOutput tensor."""return self.model(x) | 1 | 2 | 2 | 19 | 0 | 112 | 125 | 112 | self,x | [] | Any | {"Expr": 1, "Return": 1} | 1 | 14 | 1 | ["self.model"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called FCNModule, that inherit another class.The function start at line 112 and ends at 125. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [112.0] and does not return any value. It declare 1.0 function, I... |
CAREamics_careamics | FCNModule | public | 0 | 1 | training_step | def training_step(self, batch: torch.Tensor, batch_idx: Any) -> Any:"""Training step.Parameters----------batch : torch.torch.TensorInput batch.batch_idx : AnyBatch index.Returns-------AnyLoss value."""x, *targets = batchif self.use_n2v and self.n2v_preprocess is not None:x_preprocessed, *aux = self.n2v_preprocess(x)els... | 3 | 16 | 3 | 142 | 0 | 127 | 157 | 127 | self,batch,batch_idx | [] | Any | {"Assign": 8, "Expr": 3, "If": 1, "Return": 1} | 6 | 31 | 6 | ["self.n2v_preprocess", "self.model", "self.loss_func", "self.log", "self.optimizers", "self.log"] | 0 | [] | The function (training_step) defined within the public class called FCNModule, that inherit another class.The function start at line 127 and ends at 157. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [127.0] and does not return any value. It declares 6.0 fun... |
CAREamics_careamics | FCNModule | public | 0 | 1 | validation_step | def validation_step(self, batch: torch.Tensor, batch_idx: Any) -> None:"""Validation step.Parameters----------batch : torch.torch.TensorInput batch.batch_idx : AnyBatch index."""x, *targets = batchif self.use_n2v and self.n2v_preprocess is not None:x_preprocessed, *aux = self.n2v_preprocess(x)else:x_preprocessed = xaux... | 3 | 17 | 3 | 103 | 0 | 159 | 187 | 159 | self,batch,batch_idx | [] | None | {"Assign": 6, "Expr": 2, "If": 1} | 4 | 29 | 4 | ["self.n2v_preprocess", "self.model", "self.loss_func", "self.log"] | 0 | [] | The function (validation_step) defined within the public class called FCNModule, that inherit another class.The function start at line 159 and ends at 187. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [159.0] and does not return any value. It declares 4.0 f... |
CAREamics_careamics | FCNModule | public | 0 | 1 | predict_step | def predict_step(self, batch: torch.Tensor, batch_idx: Any) -> Any:"""Prediction step.Parameters----------batch : torch.torch.torch.TensorInput batch.batch_idx : AnyBatch index.Returns-------AnyModel output."""# TODO refactor when redoing datasets# hacky way to determine if it is PredictDataModule, otherwise there is a... | 12 | 47 | 3 | 282 | 0 | 189 | 261 | 189 | self,batch,batch_idx | [] | Any | {"Assign": 15, "Expr": 2, "For": 1, "If": 5, "Return": 2} | 17 | 73 | 17 | ["hasattr", "len", "isinstance", "isinstance", "type", "type", "ImageRestorationTTA", "tta.forward", "self.model", "augmented_output.append", "tta.backward", "self.model", "Denormalize", "denorm", "numpy", "output.cpu", "len"] | 0 | [] | The function (predict_step) defined within the public class called FCNModule, that inherit another class.The function start at line 189 and ends at 261. It contains 47 lines of code and it has a cyclomatic complexity of 12. It takes 3 parameters, represented as [189.0] and does not return any value. It declares 17.0 fu... |
CAREamics_careamics | FCNModule | public | 0 | 1 | configure_optimizers | def configure_optimizers(self) -> Any:"""Configure optimizers and learning rate schedulers.Returns-------AnyOptimizer and learning rate scheduler."""# instantiate optimizeroptimizer_func = get_optimizer(self.optimizer_name)optimizer = optimizer_func(self.model.parameters(), **self.optimizer_params)# and schedulerschedu... | 1 | 10 | 1 | 67 | 0 | 263 | 283 | 263 | self | [] | Any | {"Assign": 4, "Expr": 1, "Return": 1} | 5 | 21 | 5 | ["get_optimizer", "optimizer_func", "self.model.parameters", "get_scheduler", "scheduler_func"] | 0 | [] | The function (configure_optimizers) defined within the public class called FCNModule, that inherit another class.The function start at line 263 and ends at 283. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 ... |
CAREamics_careamics | FCNModule | public | 0 | 1 | __init__ | def __init__(self, algorithm_config: Union[VAEBasedAlgorithm, dict]) -> None:"""Lightning module for CAREamics.This class encapsulates the a PyTorch model along with the training, validation,and testing logic. It is configured using an `AlgorithmModel` Pydantic class.Parameters----------algorithm_config : Union[Algorit... | 4 | 30 | 2 | 232 | 0 | 312 | 367 | 312 | self,algorithm_config | [] | None | {"AnnAssign": 2, "Assign": 10, "Expr": 2, "If": 2} | 8 | 37 | 8 | ["__init__", "super", "isinstance", "algorithm_factory", "isinstance", "N2VManipulateTorch", "model_factory", "loss_factory"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called FCNModule, that inherit another class.The function start at line 312 and ends at 367. It contains 30 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [312.0] and does not return any value. It declares 8.0 function... |
CAREamics_careamics | FCNModule | public | 0 | 1 | forward | def forward(self, x: torch.Tensor) -> tuple[torch.Tensor, dict[str, Any]]:"""Forward pass.Parameters----------x : torch.TensorInput tensor of shape (B, (1 + n_LC), [Z], Y, X), where n_LC is thenumber of lateral inputs.Returns-------tuple[torch.Tensor, dict[str, Any]]A tuple with the output tensor and additional data fr... | 1 | 2 | 2 | 33 | 0 | 369 | 383 | 369 | self,x | [] | Any | {"Expr": 1, "Return": 1} | 1 | 14 | 1 | ["self.model"] | 54 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3646986_mapbox_mapbox_sdk_py.tests.test_geocoder_py.test_geocoder_forward_bbox", "_.content.g... | The function (forward) defined within the public class called FCNModule, that inherit another class.The function start at line 369 and ends at 383. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [369.0] and does not return any value. It declare 1.0 function, I... |
CAREamics_careamics | VAEModule | public | 0 | 1 | set_data_stats | def set_data_stats(self, data_mean, data_std):"""Set data mean and std for the noise model likelihood.Parameters----------data_mean : floatMean of the data.data_std : floatStandard deviation of the data."""if self.noise_model_likelihood is not None:self.noise_model_likelihood.set_data_stats(data_mean, data_std) | 2 | 3 | 3 | 28 | 0 | 385 | 396 | 385 | self,data_mean,data_std | [] | None | {"Expr": 2, "If": 1} | 1 | 12 | 1 | ["self.noise_model_likelihood.set_data_stats"] | 0 | [] | The function (set_data_stats) defined within the public class called VAEModule, that inherit another class.The function start at line 385 and ends at 396. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [385.0] and does not return any value. It declare 1.0 func... |
CAREamics_careamics | FCNModule | public | 0 | 1 | training_step | def training_step(self, batch: tuple[torch.Tensor, torch.Tensor], batch_idx: Any) -> dict[str, torch.Tensor] | None:"""Training step.Parameters----------batch : tuple[torch.Tensor, torch.Tensor]Input batch. It is a tuple with the input tensor and the target tensor.The input tensor has shape (B, (1 + n_LC), [Z], Y, X), ... | 6 | 37 | 3 | 201 | 0 | 398 | 463 | 398 | self,batch,batch_idx | [] | Any | {"Assign": 8, "Expr": 3, "If": 1, "Return": 1} | 6 | 31 | 6 | ["self.n2v_preprocess", "self.model", "self.loss_func", "self.log", "self.optimizers", "self.log"] | 0 | [] | The function (training_step) defined within the public class called FCNModule, that inherit another class.The function start at line 398 and ends at 463. It contains 37 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [398.0] and does not return any value. It declares 6.0 fun... |
CAREamics_careamics | FCNModule | public | 0 | 1 | validation_step | def validation_step(self, batch: tuple[torch.Tensor, torch.Tensor], batch_idx: Any) -> None:"""Validation step.Parameters----------batch : tuple[torch.Tensor, torch.Tensor]Input batch. It is a tuple with the input tensor and the target tensor.The input tensor has shape (B, (1 + n_LC), [Z], Y, X), where n_LC is thenumbe... | 4 | 23 | 3 | 162 | 0 | 465 | 506 | 465 | self,batch,batch_idx | [] | None | {"Assign": 6, "Expr": 2, "If": 1} | 4 | 29 | 4 | ["self.n2v_preprocess", "self.model", "self.loss_func", "self.log"] | 0 | [] | The function (validation_step) defined within the public class called FCNModule, that inherit another class.The function start at line 465 and ends at 506. It contains 23 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [465.0] and does not return any value. It declares 4.0 f... |
CAREamics_careamics | VAEModule | public | 0 | 1 | on_validation_epoch_end | def on_validation_epoch_end(self) -> None:"""Validation epoch end."""psnr_ = self.reduce_running_psnr()if psnr_ is not None:self.log("val_psnr", psnr_, on_epoch=True, prog_bar=True)else:self.log("val_psnr", 0.0, on_epoch=True, prog_bar=True) | 2 | 6 | 1 | 57 | 0 | 508 | 514 | 508 | self | [] | None | {"Assign": 1, "Expr": 3, "If": 1} | 3 | 7 | 3 | ["self.reduce_running_psnr", "self.log", "self.log"] | 0 | [] | The function (on_validation_epoch_end) defined within the public class called VAEModule, that inherit another class.The function start at line 508 and ends at 514. It contains 6 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.... |
CAREamics_careamics | FCNModule | public | 0 | 1 | predict_step | def predict_step(self, batch: torch.Tensor, batch_idx: Any) -> Any:"""Prediction step.Parameters----------batch : torch.TensorInput batch.batch_idx : AnyBatch index.Returns-------AnyModel output."""if self.algorithm_config.algorithm == "microsplit":x, *aux = batch# Reset model for inference with spatial dimensions only... | 12 | 59 | 3 | 482 | 0 | 516 | 610 | 516 | self,batch,batch_idx | [] | Any | {"Assign": 15, "Expr": 2, "For": 1, "If": 5, "Return": 2} | 17 | 73 | 17 | ["hasattr", "len", "isinstance", "isinstance", "type", "type", "ImageRestorationTTA", "tta.forward", "self.model", "augmented_output.append", "tta.backward", "self.model", "Denormalize", "denorm", "numpy", "output.cpu", "len"] | 0 | [] | The function (predict_step) defined within the public class called FCNModule, that inherit another class.The function start at line 516 and ends at 610. It contains 59 lines of code and it has a cyclomatic complexity of 12. It takes 3 parameters, represented as [516.0] and does not return any value. It declares 17.0 fu... |
CAREamics_careamics | FCNModule | public | 0 | 1 | configure_optimizers | def configure_optimizers(self) -> Any:"""Configure optimizers and learning rate schedulers.Returns-------AnyOptimizer and learning rate scheduler."""# instantiate optimizeroptimizer_func = get_optimizer(self.optimizer_name)optimizer = optimizer_func(self.model.parameters(), **self.optimizer_params)# and schedulerschedu... | 1 | 10 | 1 | 67 | 0 | 612 | 632 | 263 | self | [] | Any | {"Assign": 4, "Expr": 1, "Return": 1} | 5 | 21 | 5 | ["get_optimizer", "optimizer_func", "self.model.parameters", "get_scheduler", "scheduler_func"] | 0 | [] | The function (configure_optimizers) defined within the public class called FCNModule, that inherit another class.The function start at line 612 and ends at 632. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 ... |
CAREamics_careamics | VAEModule | public | 0 | 1 | get_reconstructed_tensor | def get_reconstructed_tensor(self, model_outputs: tuple[torch.Tensor, dict[str, Any]]) -> torch.Tensor:"""Get the reconstructed tensor from the LVAE model outputs.Parameters----------model_outputs : tuple[torch.Tensor, dict[str, Any]]Model outputs. It is a tuple with a tensor representing the predicted meanand (optiona... | 3 | 8 | 2 | 65 | 0 | 638 | 658 | 638 | self,model_outputs | [] | torch.Tensor | {"Assign": 1, "Expr": 1, "If": 2, "Return": 2} | 1 | 21 | 1 | ["predictions.chunk"] | 0 | [] | The function (get_reconstructed_tensor) defined within the public class called VAEModule, that inherit another class.The function start at line 638 and ends at 658. It contains 8 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [638.0] and does not return any value. It declar... |
CAREamics_careamics | VAEModule | public | 0 | 1 | compute_val_psnr | def compute_val_psnr(self,model_output: tuple[torch.Tensor, dict[str, Any]],target: torch.Tensor,psnr_func: Callable = scale_invariant_psnr,) -> list[float]:"""Compute the PSNR for the current validation batch.Parameters----------model_output : tuple[torch.Tensor, dict[str, Any]]Model output, a tuple with the predicted... | 3 | 17 | 4 | 154 | 0 | 660 | 702 | 660 | self,model_output,target,psnr_func | [] | list[float] | {"Assign": 2, "Expr": 2, "For": 1, "Return": 1} | 13 | 43 | 13 | ["self.get_reconstructed_tensor", "range", "update", "psnr_func", "numpy", "cpu", "detach", "clone", "numpy", "cpu", "detach", "clone", "range"] | 0 | [] | The function (compute_val_psnr) defined within the public class called VAEModule, that inherit another class.The function start at line 660 and ends at 702. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [660.0] and does not return any value. It declares 13.0... |
CAREamics_careamics | VAEModule | public | 0 | 1 | reduce_running_psnr | def reduce_running_psnr(self) -> float | None:"""Reduce the running PSNR statistics and reset the running PSNR.Returns-------Optional[float]Running PSNR averaged over the different output channels."""psnr_arr = []# type: ignorefor i in range(len(self.running_psnr)):psnr = self.running_psnr[i].get()if psnr is None:psnr_... | 4 | 12 | 1 | 88 | 0 | 704 | 724 | 704 | self | [] | float | None | {"Assign": 4, "Expr": 3, "For": 1, "If": 2, "Return": 1} | 8 | 21 | 8 | ["range", "len", "get", "psnr_arr.append", "numpy", "psnr.cpu", "reset", "np.mean"] | 0 | [] | The function (reduce_running_psnr) defined within the public class called VAEModule, that inherit another class.The function start at line 704 and ends at 724. It contains 12 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value. It declares 8.0 f... |
CAREamics_careamics | public | public | 0 | 0 | create_careamics_module | def create_careamics_module(algorithm: Union[SupportedAlgorithm, str],loss: Union[SupportedLoss, str],architecture: Union[SupportedArchitecture, str],use_n2v2: bool = False,struct_n2v_axis: Literal["horizontal", "vertical", "none"] = "none",struct_n2v_span: int = 5,model_parameters: dict | None = None,optimizer: Union[... | 6 | 46 | 11 | 263 | 6 | 728 | 822 | 728 | algorithm,loss,architecture,use_n2v2,struct_n2v_axis,struct_n2v_span,model_parameters,optimizer,optimizer_parameters,lr_scheduler,lr_scheduler_parameters | ['algorithm_cfg', 'which_algo', 'lr_scheduler_parameters', 'model_parameters', 'model_dict', 'optimizer_parameters'] | Union[FCNModule, VAEModule] | {"AnnAssign": 1, "Assign": 9, "Expr": 3, "If": 5, "Return": 1} | 7 | 95 | 7 | ["model_dict.update", "UNetBasedAlgorithm.get_compatible_algorithms", "algorithm_factory", "isinstance", "algorithm_cfg.set_n2v2", "FCNModule", "NotImplementedError"] | 5 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.lightning.callbacks.prediction_writer_callback.test_prediction_writer_callback_py.test_smoke_n2v_tiled_tiff", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_carea... | The function (create_careamics_module) defined within the public class called public.The function start at line 728 and ends at 822. It contains 46 lines of code and it has a cyclomatic complexity of 6. It takes 11 parameters, represented as [728.0] and does not return any value. It declares 7.0 functions, It has 7.0 f... |
CAREamics_careamics | public | public | 0 | 0 | load_one_file | def load_one_file(fpath):"""Load a single 2D image file.Parameters----------fpath : str or PathPath to the image file.Returns-------numpy.ndarrayReshaped image data."""data = tifffile.imread(fpath)if len(data.shape) == 2:axes = "YX"elif len(data.shape) == 3:axes = "SYX"elif len(data.shape) == 4:axes = "STYX"else:raise ... | 4 | 13 | 1 | 96 | 2 | 24 | 48 | 24 | fpath | ['data', 'axes'] | Returns | {"Assign": 6, "Expr": 1, "If": 3, "Return": 1} | 7 | 25 | 7 | ["tifffile.imread", "len", "len", "len", "ValueError", "reshape_array", "data.reshape"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.microsplit_data_module_py.load_data"] | The function (load_one_file) defined within the public class called public.The function start at line 24 and ends at 48. It contains 13 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters, and this function return a value. It declares 7.0 functions, It has 7.0 functions call... |
CAREamics_careamics | public | public | 0 | 0 | load_data | def load_data(datadir):"""Load data from a directory containing channel subdirectories with image files.Parameters----------datadir : str or PathPath to the data directory containing channel subdirectories.Returns-------numpy.ndarrayStacked array of all channels' data."""data_path = Path(datadir)channel_dirs = sorted(p... | 7 | 13 | 1 | 106 | 7 | 52 | 81 | 52 | datadir | ['image_files', 'data_path', 'channel_stack', 'channels_data', 'final_data', 'channel_images', 'channel_dirs'] | Returns | {"Assign": 7, "Expr": 2, "For": 1, "Return": 1} | 11 | 30 | 11 | ["Path", "sorted", "data_path.iterdir", "p.is_dir", "sorted", "channel_dir.iterdir", "f.is_file", "load_one_file", "np.concatenate", "channels_data.append", "np.stack"] | 12 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3919742_opendatacube_datacube_stats.datacube_stats.main_py.load_process_save_chunk", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3959435_kscsdk_ksc_sdk_python.kscore.session_py.Session.get_data", "_.content.gdrive... | The function (load_data) defined within the public class called public.The function start at line 52 and ends at 81. It contains 13 lines of code and it has a cyclomatic complexity of 7. The function does not take any parameters, and this function return a value. It declares 11.0 functions, It has 11.0 functions called... |
CAREamics_careamics | public | public | 0 | 0 | get_datasplit_tuples | def get_datasplit_tuples(val_fraction, test_fraction, data_length):"""Get train/val/test indices for data splitting.Parameters----------val_fraction : float or NoneFraction of data to use for validation.test_fraction : float or NoneFraction of data to use for testing.data_length : intTotal length of the dataset.Returns... | 3 | 14 | 3 | 101 | 9 | 85 | 118 | 85 | val_fraction,test_fraction,data_length | ['test_size', 'val_size', 'test_idx', 'val_fraction', 'train_idx', 'indices', 'train_size', 'test_fraction', 'val_idx'] | Returns | {"Assign": 9, "Expr": 2, "If": 2, "Return": 1} | 4 | 34 | 4 | ["np.arange", "np.random.shuffle", "int", "int"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.lightning.microsplit_data_module_py.get_train_val_data"] | The function (get_datasplit_tuples) defined within the public class called public.The function start at line 85 and ends at 118. It contains 14 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [85.0], and this function return a value. It declares 4.0 functions, It has 4.0 fun... |
CAREamics_careamics | public | public | 0 | 0 | get_train_val_data | def get_train_val_data(data_config,datadir,datasplit_type: DataSplitType,val_fraction=None,test_fraction=None,allow_generation=None,**kwargs,):"""Load and split data according to configuration.Parameters----------data_config : MicroSplitDataConfigData configuration object.datadir : str or PathPath to the data directory... | 5 | 24 | 7 | 137 | 1 | 122 | 172 | 122 | data_config,datadir,datasplit_type,val_fraction,test_fraction,allow_generation,**kwargs | ['data'] | Returns | {"Assign": 6, "Expr": 1, "If": 4, "Return": 1} | 8 | 51 | 8 | ["load_data", "get_datasplit_tuples", "len", "data.astype", "astype", "astype", "astype", "Exception"] | 0 | [] | The function (get_train_val_data) defined within the public class called public.The function start at line 122 and ends at 172. It contains 24 lines of code and it has a cyclomatic complexity of 5. It takes 7 parameters, represented as [122.0], and this function return a value. It declares 8.0 functions, and It has 8.... |
CAREamics_careamics | MicroSplitDataModule | public | 0 | 1 | __init__ | def __init__(self,data_config: MicroSplitDataConfig,# Should be compatible with microSplit DatasetConfigtrain_data: str,val_data: str | None = None,train_data_target: str | None = None,val_data_target: str | None = None,read_source_func: Callable | None = None,extension_filter: str = "",val_percentage: float = 0.1,val_... | 2 | 56 | 11 | 303 | 0 | 205 | 292 | 205 | self,data_config,train_data,val_data,train_data_target,val_data_target,read_source_func,extension_filter,val_percentage,val_minimum_split,use_in_memory | [] | None | {"Assign": 17, "Expr": 5, "If": 1} | 11 | 88 | 11 | ["__init__", "super", "dataset_class", "self.train_dataset.get_max_val", "dataset_class", "dataset_class", "self.train_dataset.compute_mean_std", "self.train_dataset.set_mean_std", "self.val_dataset.set_mean_std", "self.test_dataset.set_mean_std", "self.train_dataset.get_mean_std"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called MicroSplitDataModule, that inherit another class.The function start at line 205 and ends at 292. It contains 56 lines of code and it has a cyclomatic complexity of 2. It takes 11 parameters, represented as [205.0] and does not return any value. It declares ... |
CAREamics_careamics | MicroSplitDataModule | public | 0 | 1 | train_dataloader | def train_dataloader(self):"""Create a dataloader for training.Returns-------DataLoaderTraining dataloader."""return DataLoader(self.train_dataset,batch_size=self.train_config.batch_size,# TODO should be inside dataloader params?**self.train_config.train_dataloader_params,) | 1 | 6 | 1 | 29 | 0 | 294 | 306 | 294 | self | [] | Returns | {"Expr": 1, "Return": 1} | 1 | 13 | 1 | ["DataLoader"] | 0 | [] | The function (train_dataloader) defined within the public class called MicroSplitDataModule, that inherit another class.The function start at line 294 and ends at 306. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It dec... |
CAREamics_careamics | MicroSplitDataModule | public | 0 | 1 | val_dataloader | def val_dataloader(self):"""Create a dataloader for validation.Returns-------DataLoaderValidation dataloader."""return DataLoader(self.val_dataset,batch_size=self.train_config.batch_size,**self.val_config.val_dataloader_params,# TODO duplicated) | 1 | 6 | 1 | 29 | 0 | 308 | 320 | 308 | self | [] | Returns | {"Expr": 1, "Return": 1} | 1 | 13 | 1 | ["DataLoader"] | 0 | [] | The function (val_dataloader) defined within the public class called MicroSplitDataModule, that inherit another class.The function start at line 308 and ends at 320. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It decla... |
CAREamics_careamics | MicroSplitDataModule | public | 0 | 1 | get_data_stats | def get_data_stats(self):"""Get data statistics.Returns-------tuple[dict, dict]A tuple containing two dictionaries:- data_mean: mean values for input and target- data_std: standard deviation values for input and target"""return self.data_stats, self.val_config.max_val# TODO should be in the config? | 1 | 2 | 1 | 16 | 0 | 322 | 332 | 322 | self | [] | Returns | {"Expr": 1, "Return": 1} | 0 | 11 | 0 | [] | 0 | [] | The function (get_data_stats) defined within the public class called MicroSplitDataModule, that inherit another class.The function start at line 322 and ends at 332. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value.. |
CAREamics_careamics | public | public | 0 | 0 | create_microsplit_train_datamodule | def create_microsplit_train_datamodule(train_data: str,patch_size: tuple,data_type: DataType,axes: str,# TODO should be there after refactoringbatch_size: int,val_data: str | None = None,num_channels: int = 2,depth3D: int = 1,grid_size: tuple | None = None,multiscale_count: int | None = None,tiling_mode: TilingMode = T... | 2 | 55 | 20 | 253 | 3 | 335 | 444 | 335 | train_data,patch_size,data_type,axes,batch_size,val_data,num_channels,depth3D,grid_size,multiscale_count,tiling_mode,read_source_func,extension_filter,val_percentage,val_minimum_split,use_in_memory,transforms,train_dataloader_params,val_dataloader_params,**dataset_kwargs | ['val_config', 'dataset_config_params', 'train_config'] | MicroSplitDataModule | {"Assign": 3, "Expr": 1, "Return": 1} | 3 | 110 | 3 | ["MicroSplitDataConfig", "MicroSplitDataConfig", "MicroSplitDataModule"] | 0 | [] | The function (create_microsplit_train_datamodule) defined within the public class called public.The function start at line 335 and ends at 444. It contains 55 lines of code and it has a cyclomatic complexity of 2. It takes 20 parameters, represented as [335.0] and does not return any value. It declares 3.0 functions, a... |
CAREamics_careamics | MicroSplitDataModule | public | 0 | 1 | __init__ | def __init__(self,pred_config: MicroSplitDataConfig,pred_data: Union[str, Path, NDArray],read_source_func: Callable | None = None,extension_filter: str = "",dataloader_params: dict | None = None,) -> None:"""Constructor for MicroSplit prediction data module.Parameters----------pred_config : MicroSplitDataConfigConfigur... | 3 | 16 | 6 | 89 | 0 | 467 | 499 | 467 | self,data_config,train_data,val_data,train_data_target,val_data_target,read_source_func,extension_filter,val_percentage,val_minimum_split,use_in_memory | [] | None | {"Assign": 17, "Expr": 5, "If": 1} | 11 | 88 | 11 | ["__init__", "super", "dataset_class", "self.train_dataset.get_max_val", "dataset_class", "dataset_class", "self.train_dataset.compute_mean_std", "self.train_dataset.set_mean_std", "self.val_dataset.set_mean_std", "self.test_dataset.set_mean_std", "self.train_dataset.get_mean_std"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called MicroSplitDataModule, that inherit another class.The function start at line 467 and ends at 499. It contains 16 lines of code and it has a cyclomatic complexity of 3. It takes 6 parameters, represented as [467.0] and does not return any value. It declares 1... |
CAREamics_careamics | MicroSplitPredictDataModule | public | 0 | 1 | prepare_data | def prepare_data(self) -> None:"""Hook used to prepare the data before calling `setup`."""# # TODO currently data preparation is handled in dataset creation, revisit!pass | 1 | 2 | 1 | 9 | 0 | 501 | 504 | 501 | self | [] | None | {"Expr": 1} | 0 | 4 | 0 | [] | 0 | [] | The function (prepare_data) defined within the public class called MicroSplitPredictDataModule, that inherit another class.The function start at line 501 and ends at 504. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
CAREamics_careamics | MicroSplitPredictDataModule | public | 0 | 1 | setup | def setup(self, stage: str | None = None) -> None:"""Hook called at the beginning of predict.Parameters----------stage : Optional[str], optionalStage, by default None."""# Create prediction dataset using LCMultiChDloaderself.predict_dataset = LCMultiChDloader(self.pred_config,self.pred_data,load_data_fn=self.read_sourc... | 1 | 9 | 2 | 62 | 0 | 506 | 523 | 506 | self,stage | [] | None | {"Assign": 1, "Expr": 2} | 2 | 18 | 2 | ["LCMultiChDloader", "self.predict_dataset.set_mean_std"] | 23 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16418165_szabgab_pydigger_com.PyDigger.fetch_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3584344_influxgraph_influxgraph.setup_py.run_setup", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.... | The function (setup) defined within the public class called MicroSplitPredictDataModule, that inherit another class.The function start at line 506 and ends at 523. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [506.0] and does not return any value. It declare... |
CAREamics_careamics | MicroSplitPredictDataModule | public | 0 | 1 | predict_dataloader | def predict_dataloader(self) -> DataLoader:"""Create a dataloader for prediction.Returns-------DataLoaderPrediction dataloader."""return DataLoader(self.predict_dataset,batch_size=self.pred_config.batch_size,**self.dataloader_params,) | 1 | 6 | 1 | 29 | 0 | 525 | 538 | 525 | self | [] | DataLoader | {"Expr": 1, "Return": 1} | 1 | 14 | 1 | ["DataLoader"] | 0 | [] | The function (predict_dataloader) defined within the public class called MicroSplitPredictDataModule, that inherit another class.The function start at line 525 and ends at 538. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. I... |
CAREamics_careamics | public | public | 0 | 0 | create_microsplit_predict_datamodule | def create_microsplit_predict_datamodule(pred_data: Union[str, Path, NDArray],tile_size: tuple,data_type: DataType,axes: str,batch_size: int = 1,num_channels: int = 2,depth3D: int = 1,grid_size: int | None = None,multiscale_count: int | None = None,data_stats: tuple | None = None,tiling_mode: TilingMode = TilingMode.Sh... | 4 | 44 | 15 | 213 | 3 | 541 | 631 | 541 | pred_data,tile_size,data_type,axes,batch_size,num_channels,depth3D,grid_size,multiscale_count,data_stats,tiling_mode,read_source_func,extension_filter,dataloader_params,**dataset_kwargs | ['prediction_config_params', 'dataloader_params', 'pred_config'] | MicroSplitPredictDataModule | {"Assign": 3, "Expr": 1, "If": 2, "Return": 1} | 2 | 91 | 2 | ["MicroSplitDataConfig", "MicroSplitPredictDataModule"] | 0 | [] | The function (create_microsplit_predict_datamodule) defined within the public class called public.The function start at line 541 and ends at 631. It contains 44 lines of code and it has a cyclomatic complexity of 4. It takes 15 parameters, represented as [541.0] and does not return any value. It declares 2.0 functions,... |
CAREamics_careamics | PredictDataModule | public | 0 | 1 | __init__ | def __init__(self,pred_config: InferenceConfig,pred_data: Union[Path, str, NDArray],read_source_func: Callable | None = None,extension_filter: str = "",dataloader_params: dict | None = None,) -> None:"""Constructor.The data module can be used with Path, str or numpy arrays. The data can beeither a folder containing ima... | 14 | 51 | 6 | 274 | 0 | 64 | 166 | 64 | self,pred_config,pred_data,read_source_func,extension_filter,dataloader_params | [] | None | {"AnnAssign": 1, "Assign": 12, "Expr": 2, "If": 7} | 9 | 103 | 9 | ["__init__", "super", "ValueError", "isinstance", "ValueError", "isinstance", "isinstance", "ValueError", "get_read_func"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called PredictDataModule, that inherit another class.The function start at line 64 and ends at 166. It contains 51 lines of code and it has a cyclomatic complexity of 14. It takes 6 parameters, represented as [64.0] and does not return any value. It declares 9.0 f... |
CAREamics_careamics | PredictDataModule | public | 0 | 1 | prepare_data | def prepare_data(self) -> None:"""Hook used to prepare the data before calling `setup`."""# if the data is a Path or a strif not isinstance(self.pred_data, np.ndarray):self.pred_files = list_files(self.pred_data, self.data_type, self.extension_filter) | 2 | 5 | 1 | 39 | 0 | 168 | 174 | 168 | self | [] | None | {"Assign": 1, "Expr": 1, "If": 1} | 2 | 7 | 2 | ["isinstance", "list_files"] | 0 | [] | The function (prepare_data) defined within the public class called PredictDataModule, that inherit another class.The function start at line 168 and ends at 174. It contains 5 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 2.0 f... |
CAREamics_careamics | PredictDataModule | public | 0 | 1 | setup | def setup(self, stage: str | None = None) -> None:"""Hook called at the beginning of predict.Parameters----------stage : Optional[str], optionalStage, by default None."""# if numpy arrayif self.data_type == SupportedData.ARRAY:if self.tiled:self.predict_dataset: PredictDatasetType = InMemoryTiledPredDataset(prediction_... | 4 | 25 | 2 | 131 | 0 | 176 | 209 | 176 | self,stage | [] | None | {"AnnAssign": 1, "Assign": 3, "Expr": 1, "If": 3} | 4 | 34 | 4 | ["InMemoryTiledPredDataset", "InMemoryPredDataset", "IterableTiledPredDataset", "IterablePredDataset"] | 23 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16418165_szabgab_pydigger_com.PyDigger.fetch_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3584344_influxgraph_influxgraph.setup_py.run_setup", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.... | The function (setup) defined within the public class called PredictDataModule, that inherit another class.The function start at line 176 and ends at 209. It contains 25 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [176.0] and does not return any value. It declares 4.0 fun... |
CAREamics_careamics | PredictDataModule | public | 0 | 1 | predict_dataloader | def predict_dataloader(self) -> DataLoader:"""Create a dataloader for prediction.Returns-------DataLoaderPrediction dataloader."""# For tiled predictions, we need to ensure tiles are processed in order# to avoid stitching artifacts. Multi-worker processing can return batches# out of order, so we disable it for tiled pr... | 3 | 10 | 1 | 55 | 0 | 211 | 232 | 211 | self | [] | DataLoader | {"Assign": 2, "Expr": 1, "If": 1, "Return": 1} | 2 | 22 | 2 | ["self.dataloader_params.copy", "DataLoader"] | 0 | [] | The function (predict_dataloader) defined within the public class called PredictDataModule, that inherit another class.The function start at line 211 and ends at 232. It contains 10 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declare... |
CAREamics_careamics | public | public | 0 | 0 | create_predict_datamodule | def create_predict_datamodule(pred_data: Union[str, Path, NDArray],data_type: Union[Literal["array", "tiff", "custom"], SupportedData],axes: str,image_means: list[float],image_stds: list[float],tile_size: tuple[int, ...] | None = None,tile_overlap: tuple[int, ...] | None = None,batch_size: int = 1,tta_transforms: bool ... | 3 | 36 | 12 | 205 | 2 | 235 | 341 | 235 | pred_data,data_type,axes,image_means,image_stds,tile_size,tile_overlap,batch_size,tta_transforms,read_source_func,extension_filter,dataloader_params | ['prediction_config', 'dataloader_params'] | PredictDataModule | {"AnnAssign": 1, "Assign": 2, "Expr": 1, "If": 2, "Return": 1} | 2 | 107 | 2 | ["InferenceConfig", "PredictDataModule"] | 10 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.src.careamics.careamist_py.CAREamist.predict", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.lightning.callbacks.prediction_writer_callback.test_predic... | The function (create_predict_datamodule) defined within the public class called public.The function start at line 235 and ends at 341. It contains 36 lines of code and it has a cyclomatic complexity of 3. It takes 12 parameters, represented as [235.0] and does not return any value. It declares 2.0 functions, It has 2.0... |
CAREamics_careamics | TrainDataModule | public | 0 | 1 | __init__ | def __init__(self,data_config: DataConfig,train_data: Union[Path, str, NDArray],val_data: Union[Path, str, NDArray] | None = None,train_data_target: Union[Path, str, NDArray] | None = None,val_data_target: Union[Path, str, NDArray] | None = None,read_source_func: Callable | None = None,extension_filter: str = "",val_pe... | 17 | 74 | 11 | 444 | 0 | 120 | 262 | 120 | self,data_config,train_data,val_data,train_data_target,val_data_target,read_source_func,extension_filter,val_percentage,val_minimum_split,use_in_memory | [] | None | {"AnnAssign": 10, "Assign": 5, "Expr": 2, "If": 6} | 20 | 143 | 20 | ["__init__", "super", "type", "len", "ValueError", "ValueError", "isinstance", "ValueError", "isinstance", "isinstance", "ValueError", "isinstance", "Path", "isinstance", "Path", "isinstance", "Path", "isinstance", "Path", "get_read_func"] | 8,182 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.15197461_googleapis_python_cloud_core.google.cloud._helpers.__init___py._LocalStack.__init__", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16798231_kapji_capital_gains_calculator.cgt_calc.exceptions_py.AmountMissi... | The function (__init__) defined within the public class called TrainDataModule, that inherit another class.The function start at line 120 and ends at 262. It contains 74 lines of code and it has a cyclomatic complexity of 17. It takes 11 parameters, represented as [120.0] and does not return any value. It declares 20.0... |
CAREamics_careamics | TrainDataModule | public | 0 | 1 | prepare_data | def prepare_data(self) -> None:"""Hook used to prepare the data before calling `setup`.Here, we only need to examine the data if it was provided as a str or a Path.TODO: from lightning doc:prepare_data is called from the main process. It is not recommended to assignstate here (e.g. self.x = y) since it is called on a s... | 8 | 25 | 1 | 190 | 0 | 264 | 311 | 264 | self | [] | None | {"AnnAssign": 1, "Assign": 4, "Expr": 3, "If": 4} | 11 | 48 | 11 | ["isinstance", "isinstance", "isinstance", "isinstance", "list_files", "get_files_size", "list_files", "list_files", "validate_source_target_files", "list_files", "validate_source_target_files"] | 0 | [] | The function (prepare_data) defined within the public class called TrainDataModule, that inherit another class.The function start at line 264 and ends at 311. It contains 25 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value. It declares 11.0 f... |
CAREamics_careamics | TrainDataModule | public | 0 | 1 | setup | def setup(self, *args: Any, **kwargs: Any) -> None:"""Hook called at the beginning of fit, validate, or predict.Parameters----------*args : AnyUnused.**kwargs : AnyUnused."""# if numpy arrayif self.data_type == SupportedData.ARRAY:# mypy checksassert isinstance(self.train_data, np.ndarray)if self.train_data_target is n... | 14 | 77 | 3 | 439 | 0 | 313 | 424 | 313 | self,*args,**kwargs | [] | None | {"AnnAssign": 2, "Assign": 7, "Expr": 1, "If": 8} | 17 | 112 | 17 | ["isinstance", "isinstance", "InMemoryDataset", "isinstance", "isinstance", "InMemoryDataset", "self.train_dataset.split_dataset", "get_ram_size", "InMemoryDataset", "InMemoryDataset", "self.train_dataset.split_dataset", "PathIterableDataset", "PathIterableDataset", "len", "ValueError", "len", "self.train_dataset.split... | 23 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16418165_szabgab_pydigger_com.PyDigger.fetch_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3584344_influxgraph_influxgraph.setup_py.run_setup", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.... | The function (setup) defined within the public class called TrainDataModule, that inherit another class.The function start at line 313 and ends at 424. It contains 77 lines of code and it has a cyclomatic complexity of 14. It takes 3 parameters, represented as [313.0] and does not return any value. It declares 17.0 fun... |
CAREamics_careamics | TrainDataModule | public | 0 | 1 | get_data_statistics | def get_data_statistics(self) -> tuple[list[float], list[float]]:"""Return training data statistics.Returns-------tuple of listMeans and standard deviations across channels of the training data."""return self.train_dataset.get_data_statistics() | 1 | 2 | 1 | 27 | 0 | 426 | 434 | 426 | self | [] | tuple[list[float], list[float]] | {"Expr": 1, "Return": 1} | 1 | 9 | 1 | ["self.train_dataset.get_data_statistics"] | 0 | [] | The function (get_data_statistics) defined within the public class called TrainDataModule, that inherit another class.The function start at line 426 and ends at 434. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1... |
CAREamics_careamics | TrainDataModule | public | 0 | 1 | train_dataloader | def train_dataloader(self) -> Any:"""Create a dataloader for training.Returns-------AnyTraining dataloader."""train_dataloader_params = self.data_config.train_dataloader_params.copy()# NOTE: When next-gen datasets are completed this can be removed# iterable dataset cannot be shuffledif isinstance(self.train_dataset, It... | 2 | 9 | 1 | 51 | 0 | 436 | 456 | 436 | self | [] | Any | {"Assign": 1, "Expr": 1, "If": 1, "Return": 1} | 3 | 21 | 3 | ["self.data_config.train_dataloader_params.copy", "isinstance", "DataLoader"] | 0 | [] | The function (train_dataloader) defined within the public class called TrainDataModule, that inherit another class.The function start at line 436 and ends at 456. It contains 9 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 3.0... |
CAREamics_careamics | TrainDataModule | public | 0 | 1 | val_dataloader | def val_dataloader(self) -> Any:"""Create a dataloader for validation.Returns-------AnyValidation dataloader."""return DataLoader(self.val_dataset,batch_size=self.batch_size,**self.data_config.val_dataloader_params,) | 1 | 6 | 1 | 29 | 0 | 458 | 471 | 458 | self | [] | Any | {"Expr": 1, "Return": 1} | 1 | 14 | 1 | ["DataLoader"] | 0 | [] | The function (val_dataloader) defined within the public class called TrainDataModule, that inherit another class.The function start at line 458 and ends at 471. It contains 6 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 fu... |
CAREamics_careamics | public | public | 0 | 0 | create_train_datamodule | def create_train_datamodule(train_data: Union[str, Path, NDArray],data_type: Union[Literal["array", "tiff", "custom"], SupportedData],patch_size: list[int],axes: str,batch_size: int,val_data: Union[str, Path, NDArray] | None = None,transforms: list[TransformModel] | None = None,train_target_data: Union[str, Path, NDArr... | 6 | 50 | 16 | 301 | 3 | 474 | 666 | 474 | train_data,data_type,patch_size,axes,batch_size,val_data,transforms,train_target_data,val_target_data,read_source_func,extension_filter,val_percentage,val_minimum_patches,train_dataloader_params,val_dataloader_params,use_in_memory | ['data_config', 'val_dataloader_params', 'train_dataloader_params'] | TrainDataModule | {"AnnAssign": 1, "Assign": 4, "Expr": 1, "If": 5, "Return": 1} | 2 | 193 | 2 | ["DataConfig", "TrainDataModule"] | 8 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_careamics.tests.lightning.callbacks.prediction_writer_callback.test_prediction_writer_callback_py.test_smoke_n2v_tiled_tiff", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.95053985_CAREamics_carea... | The function (create_train_datamodule) defined within the public class called public.The function start at line 474 and ends at 666. It contains 50 lines of code and it has a cyclomatic complexity of 6. It takes 16 parameters, represented as [474.0] and does not return any value. It declares 2.0 functions, It has 2.0 f... |
CAREamics_careamics | DataStatsCallback | public | 0 | 1 | setup | def setup(self, trainer: L.Trainer, module: L.LightningModule, stage: str) -> None:"""Called when trainer is setting up."""if stage == "fit":# Get data statistics from datamodule(data_mean, data_std), _ = trainer.datamodule.get_data_stats()# Set data statistics in the model's likelihood modulemodule.noise_model_likelih... | 2 | 6 | 4 | 64 | 0 | 14 | 23 | 14 | self,trainer,module,stage | [] | None | {"Assign": 1, "Expr": 2, "If": 1} | 2 | 10 | 2 | ["trainer.datamodule.get_data_stats", "module.noise_model_likelihood.set_data_stats"] | 23 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.16418165_szabgab_pydigger_com.PyDigger.fetch_py.main", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.3584344_influxgraph_influxgraph.setup_py.run_setup", "_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.... | The function (setup) defined within the public class called DataStatsCallback, that inherit another class.The function start at line 14 and ends at 23. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [14.0] and does not return any value. It declares 2.0 functio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.