Skip to content

Commit

Permalink
Spelling corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
szmazurek committed Jan 16, 2025
1 parent f0b9507 commit 42134be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
4 changes: 1 addition & 3 deletions .spelling/.spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,4 @@ cudagraph
kwonly
torchscript
Stdnet
allgather
skipif
progbar
angi
24 changes: 12 additions & 12 deletions GANDLF/models/lightning_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def on_train_start(self):
self._initialize_train_logger()
self._initialize_training_epoch_containers()

# TODO check out if the disbled by default medcam is indeed what we
# TODO check out if the disabled by default medcam is indeed what we
# meant - it was taken from original code
if "medcam" in self.params:
if self.params["medcam"]:
Expand Down Expand Up @@ -421,7 +421,7 @@ def training_step(self, subject, batch_idx):

images = self._prepare_images_batch_from_subject_data(subject)
labels = self._prepare_labels_batch_from_subject_data(subject)
# TODO this is going to block any parallelism, as the spacing is going to unpredicatably change across GPUs
# TODO this is going to block any parallelism, as the spacing is going to unpredictably change across GPUs
self._set_spacing_params_for_subject(subject)

images = self._ensure_proper_images_tensor_dimensions(images)
Expand Down Expand Up @@ -596,7 +596,7 @@ def _write_epoch_start_process_resource_usage(self, epoch):
)
memory_info_string += ",\n"

# TODO evaluate if this indded works properly in distributed setting
# TODO evaluate if this indeed works properly in distributed setting
self.MULTIPROCESSING_LOCK.acquire()
with open(full_filepath, file_write_mode) as file_mem:
file_mem.write(memory_info_string)
Expand Down Expand Up @@ -798,7 +798,7 @@ def validation_step(self, subject, batch_idx):
if self.params["verbose"]:
self._print_currently_processed_subject(subject)

# TODO this is going to block any parallelism, as the spacing is going to unpredicatably change across GPUs
# TODO this is going to block any parallelism, as the spacing is going to unpredictably change across GPUs
self._set_spacing_params_for_subject(subject)

subject_dict = self._initialize_subject_dict_nontraining_mode(subject)
Expand Down Expand Up @@ -1375,14 +1375,14 @@ def _determine_final_prediction_mask_shape(segmentation_mask: np.ndarray):
if image_save_format in [".jpg", ".jpeg", ".png"]:
decoded_segmentation_mask = decoded_segmentation_mask.astype(np.uint8)

subject_converted_to_sikt_format = _convert_subject_to_sitk_format(subject)
result_sikt_image = sitk.GetImageFromArray(decoded_segmentation_mask)
result_sikt_image.CopyInformation(subject_converted_to_sikt_format)
subject_converted_to_sitk_format = _convert_subject_to_sitk_format(subject)
result_sitk_image = sitk.GetImageFromArray(decoded_segmentation_mask)
result_sitk_image.CopyInformation(subject_converted_to_sitk_format)

if "resample" in self.params["data_preprocessing"]:
result_sikt_image = resample_image(
result_sikt_image,
subject_converted_to_sikt_format.GetSpacing(),
result_sitk_image = resample_image(
result_sitk_image,
subject_converted_to_sitk_format.GetSpacing(),
interpolator=sitk.sitkNearestNeighbor,
)
segmentation_mask_save_path = os.path.join(
Expand All @@ -1391,7 +1391,7 @@ def _determine_final_prediction_mask_shape(segmentation_mask: np.ndarray):
f"{subject['subject_id'][0]}_seg_process_rank_{self.global_rank}{image_save_format}",
)
self._ensure_path_exists(os.path.dirname(segmentation_mask_save_path))
sitk.WriteImage(result_sikt_image, segmentation_mask_save_path)
sitk.WriteImage(result_sitk_image, segmentation_mask_save_path)

@rank_zero_only
def _save_predictions_csv_for_regression_or_classification(
Expand Down Expand Up @@ -1703,7 +1703,7 @@ def _radiology_inference_step(self, subject: torchio.Subject):
subject["subject_id"][0]
] = model_output

# TODO this has to be somewhow handled in different way, we
# TODO this has to be somehow handled in different way, we
# are mixing too much logic in this single module
def _histopathology_inference_step(self, row_index_tuple):
"""
Expand Down

1 comment on commit 42134be

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (1)

progbar

These words are not needed and should be removed Stdnet

Some files were automatically ignored 🙈

These sample patterns would exclude them:

[^/]\.png$
^\Q.gitattributes\E$
^\Q.spelling/.spelling/expect.txt\E$
^\Q__init__.py\E$
^\QGANDLF/data/patch_miner/__init__.py\E$
^\QGANDLF/data/patch_miner/opm/__init__.py\E$
^\QGANDLF/grad_clipping/__init__.py\E$
^\QGANDLF/models/seg_modules/__init__.py\E$
^\QGANDLF/privacy/__init__.py\E$
^\Qtesting/__init__.py\E$
^\Qtutorials/classification_medmnist_notebook/tutorial.ipynb\E$
^samples/images_opm/
^tutorials/classification_medmnist_notebook/medmnist/dataset/

You should consider excluding directory paths (e.g. (?:^|/)vendor/), filenames (e.g. (?:^|/)yarn\.lock$), or file extensions (e.g. \.gz$)

You should consider adding them to:

.github/actions/spelling/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept these unrecognized words as correct, update file exclusions, and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the [email protected]:szmazurek/GaNDLF.git repository
on the inference_pass branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/szmazurek/GaNDLF/actions/runs/12816872410/attempts/1'
Available 📚 dictionaries could cover words not in the 📘 dictionary
Dictionary Entries Covers Uniquely
cspell:java/src/java-terms.txt 920 2 2

Consider adding them (in .github/workflows/spellchecker.yml) in jobs:/spelling: for uses: check-spelling/check-spelling@main in its with:

      with:
        extra_dictionaries: |
          cspell:java/src/java-terms.txt

To stop checking additional dictionaries, add (in .github/workflows/spellchecker.yml) for uses: check-spelling/check-spelling@main in its with:

check_extra_dictionaries: ''
Warnings (3)

See the 📜action log or 📝 job summary for details.

⚠️ Warnings Count
⚠️ binary-file 19
⚠️ large-file 2
⚠️ noisy-file 2

See ⚠️ Event descriptions for more information.

Please sign in to comment.