Skip to content

Fix: _frac calculation using wrong prefix denominator (#2) - #3

Open
Maartje-Cox wants to merge 1 commit into
phenological:mainfrom
Maartje-Cox:fix-frac-loop-issue-2
Open

Fix: _frac calculation using wrong prefix denominator (#2)#3
Maartje-Cox wants to merge 1 commit into
phenological:mainfrom
Maartje-Cox:fix-frac-loop-issue-2

Conversation

@Maartje-Cox

Copy link
Copy Markdown

Fixes #2

The inner prefix loop in the _frac calculation overwrote col2 on each pass, so frac[[col]] only ever used the last prefix (LD), regardless of the actual letter. E.g. V1TG_frac was being calculated as V1TG / LDTG instead of V1TG / VLTG.

Replaced the loop with a direct letter-to-prefix mapping (H→HD, V→VL, L→LD) as suggested in the issue.

The inner prefix loop overwrote col2 on each iteration, so every
_frac column was calculated against LD regardless of its actual
letter (H/V/L). Replaced this with a line where letters are directly mapped to the correct prefix.
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.

Bug in calculating fractions

1 participant