Skip to content

Conversation

@SimoneAriens
Copy link
Collaborator

I added a new object: MarkImage which is an ImageContainer like ScanImage, but with two additional features: the MarkType and CropType (which are also implemented). Then the resample function had to be refactored a little to allow for resampling of MarkImages.

@SimoneAriens SimoneAriens self-assigned this Dec 10, 2025
@SimoneAriens SimoneAriens changed the base branch from feature/resampling to main December 23, 2025 11:42
@SimoneAriens SimoneAriens marked this pull request as ready for review December 23, 2025 12:36
@github-actions
Copy link

Diff Coverage

Diff: origin/main..HEAD, staged and unstaged changes

  • packages/scratch-core/src/conversion/data_formats.py (97.1%): Missing lines 36
  • packages/scratch-core/src/conversion/mark.py (0.0%): Missing lines 1-2,5-6
  • packages/scratch-core/src/conversion/resample.py (100%)
  • packages/scratch-core/src/image_generation/data_formats.py (100%)

Summary

  • Total: 44 lines
  • Missing: 5 lines
  • Coverage: 88%

packages/scratch-core/src/conversion/data_formats.py

Lines 32-40

  32     @property
  33     def sampling_rate(self) -> float:
  34         if self == MarkType.BREECH_FACE_IMPRESSION:
  35             return 3.5e-6
! 36         return 1.5e-6
  37 
  38 
  39 class CropType(Enum):
  40     RECTANGLE = auto()

packages/scratch-core/src/conversion/mark.py

Lines 1-10

!  1 from image_generation.data_formats import ScanImage
!  2 from conversion.data_formats import MarkType, CropType, MarkImage
   3 
   4 
!  5 def scan_image_to_mark(scan_image: ScanImage, mark_type: MarkType, crop_type: CropType):
!  6     return MarkImage(
   7         scan_image=scan_image,
   8         mark_type=mark_type,
   9         crop_type=crop_type,
  10     )

1 similar comment
@github-actions
Copy link

Diff Coverage

Diff: origin/main..HEAD, staged and unstaged changes

  • packages/scratch-core/src/conversion/data_formats.py (97.1%): Missing lines 36
  • packages/scratch-core/src/conversion/mark.py (0.0%): Missing lines 1-2,5-6
  • packages/scratch-core/src/conversion/resample.py (100%)
  • packages/scratch-core/src/image_generation/data_formats.py (100%)

Summary

  • Total: 44 lines
  • Missing: 5 lines
  • Coverage: 88%

packages/scratch-core/src/conversion/data_formats.py

Lines 32-40

  32     @property
  33     def sampling_rate(self) -> float:
  34         if self == MarkType.BREECH_FACE_IMPRESSION:
  35             return 3.5e-6
! 36         return 1.5e-6
  37 
  38 
  39 class CropType(Enum):
  40     RECTANGLE = auto()

packages/scratch-core/src/conversion/mark.py

Lines 1-10

!  1 from image_generation.data_formats import ScanImage
!  2 from conversion.data_formats import MarkType, CropType, MarkImage
   3 
   4 
!  5 def scan_image_to_mark(scan_image: ScanImage, mark_type: MarkType, crop_type: CropType):
!  6     return MarkImage(
   7         scan_image=scan_image,
   8         mark_type=mark_type,
   9         crop_type=crop_type,
  10     )

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
. 100% 100%
comparators 100% 100%
conversion 97% 91%
conversion.leveling 100% 100%
conversion.leveling.solver 100% 75%
image_generation 95% 75%
parsers 91% 50%
parsers.patches 91% 62%
preprocessors 100% 100%
processors 100% 100%
utils 80% 100%
Summary 96% (598 / 621) 82% (51 / 62)

Minimum allowed line rate is 50%

1 similar comment
@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
. 100% 100%
comparators 100% 100%
conversion 97% 91%
conversion.leveling 100% 100%
conversion.leveling.solver 100% 75%
image_generation 95% 75%
parsers 91% 50%
parsers.patches 91% 62%
preprocessors 100% 100%
processors 100% 100%
utils 80% 100%
Summary 96% (598 / 621) 82% (51 / 62)

Minimum allowed line rate is 50%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants