Skip to content

Bug: augmentations.jl contains two conflicting implementations merged into one file #39

@Esraa-Hassan0

Description

@Esraa-Hassan0

Description

The file augmentations.jl is currently in a broken state following a recent PR #30 merge. The PR introduced a second, incompatible implementation of apply_augmentations and apply_augmentation directly into the same file without removing the original code. The result is syntactically invalid Julia — both functions have duplicate bodies interleaved, with unreachable code after error(...) statements and mismatched end blocks.

What is broken

  • apply_augmentations contains two loops with conflicting config key paths:
    • Old version reads from config["augmentations"] and config["order"] at the root level
    • New version reads from config["augmentation"]["augmentations"] — the correct schema
  • apply_augmentation contains duplicate elseif branches for "Mirror transform", "Scale transform", "Gaussian blur transform", and "Elastic deformation transform" with different (incompatible) argument signatures
  • The file does not parse or compile in its current state

Root cause

The repo currently has no CI pipeline, so parse errors and broken code can slip through during merge without any automated safety net. This is a good opportunity to add one.

Fix

A clean version of augmentations.jl has been prepared that:

  • Uses the correct config schema (config["augmentation"][...])
  • Unifies probability handling (per-augmentation p_rand with global fallback)
  • Fixes argument signatures for Scale transform, Mirror transform, and Gaussian blur transform
  • Adds a proper else error clause for unknown augmentation names

Steps to reproduce

include("augmentations.jl")  # ParseError or MethodError at runtime

Expected behaviour

File parses cleanly and augmentations apply correctly according to the config schema.

Suggested action

  1. Revert PR Fix Augmentation Integration issue #2  #30 or apply the fix from the linked branch.
  2. Add a basic CI pipeline (e.g. GitHub Actions) with at minimum:
    • A syntax check that runs include() on all source files
    • The existing test suite via julia --project -e 'using Pkg; Pkg.test()'

Happy to open a separate PR for the CI setup if that would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions