The Gene Named September 2nd — Python Bug Hunt

Inspired by the genomics community literally renaming 27 human genes (SEPT2 → SEPTIN2, MARCH1 → MARCHF1…) because Excel kept auto-converting them to dates,…

  • Language: Python
  • Layer: Backend
  • Difficulty: Medium
  • Concepts: Coercion, Data Import
  • Modelled on: Excel × genomics
  • Visible tests: plain integers convert; scientific-notation lookalikes stay strings; leading zeros mean identifier
  • Reward: 50 XP for a complete fix

Briefing

Inspired by the genomics community literally renaming 27 human genes (SEPT2 → SEPTIN2, MARCH1 → MARCHF1…) because Excel kept auto-converting them to dates, and scientific-notation lookalikes like "1E5" to numbers. Roughly a fifth of published gene lists carried the corruption.

cells.py imports spreadssheet cells. Convert only what is unambiguously a number.

Bug report

BUG-SEPT2 · Priority: High (data integrity) · Reported by: research tools

parse_cell(value) rules:

  • pure integers ("42", "-7") -> int … EXCEPT leading zeros ("007" is an ID!)
  • pure decimals ("3.14") -> float
  • EVERYTHING else stays a string: "SEPT2", "1E5", "007", "3/4"

Observed: "1E5" imports as 100000.0 and "007" as 7 — identifiers destroyed.

Logs

[import] "1E5" -> 100000.0
[import] "007" -> 7

The code as shipped

src/import/cells.py (editable)

# Parses a raw spreadsheet cell into int / float / str.

def parse_cell(value):
    try:
        number = float(value)
        if number == int(number):
            return int(number)
        return number
    except ValueError:
        return value

Open the hunt to edit the files, run the visible tests and submit against the hidden ones. More Python bug hunts.