Skip to content

Bug: Normalization and factor conversion issues #147

@dshkol

Description

@dshkol

Summary

Correctness issues in data processing:

H2: Missing parenthesis in conditional

  • File: R/cansim_vectors.R:522 (approximate line)
  • Issue: nrow(failed_coordinates > 0) should be nrow(failed_coordinates) > 0
  • Impact: Incorrect logic evaluation

M1: Percent normalization UOM label inconsistency

  • File: R/cansim.R:82 (approximate line)
  • Issue: Values are scaled but UOM label stays as "Percent"
  • Impact: Data/label mismatch can confuse users

M2: normalize_cansim_values assumes attrs exist

  • Files: R/cansim.R:132, R/cansim_vectors.R:236
  • Issue: Assumes cansimTableNumber attr exists, but vector flows don't set attrs
  • Impact: Can break metadata paths

Proposed Fix

  • H2: Fix parenthesis placement
  • M1: Update UOM label when scaling values
  • M2: Check attr existence before use

From code audit - correctness issues in data processing

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions