Repository navigation
Translate CS source aliases with any slot number - #3
Merged
Merged
Conversation
normalizeSourceName translated CS<n>_<ISO3> to the file name <ISO3>_<n>
only when the name had 7 characters, so two-digit slots such as CS10_ITA
requested CS10_ITA.dta, which does not exist. It now matches
^CS(\d+)_([A-Za-z]{3})$ case-insensitively and also returns the CS<n>
column prefix, which loadSourceData uses to select and list variables.
Other source names are unchanged.
Adds a trimmed ITA_10 fixture and offline tests for CS10_ITA, cs10_ita,
ITA_10 and the variable error message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The help line read as if CS10_ITA mapped to ARG_1; it now gives both examples with their own file names. Adds offline tests that " CS10_ITA " is trimmed and translated, and that CS1_ARGX is not a CS alias and does not resolve to ARG_1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
CS fixed ready to be merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Country sources are listed as
CS<n>_<ISO3>(CS1_ARG,CS10_ITA) but stored as<ISO3>_<n>.dta(ARG_1.dta,ITA_10.dta), and their columns keep theCS<n>_prefix. The package translated the name only when it was exactly 7 characters, soCS10_ITAfailed.normalizeSourceNamenow matches^CS(\d+)_([A-Za-z]{3})$case-insensitively and also returns theCS<n>column prefix;loadSourceDatauses both. Other names are unchanged.Tests: new offline tests in
tests/tGmdOffline.mwith anITA_10.dtafixture, covering a two-digit slot, lower case, surrounding spaces and a near-miss name. MATLAB is not installed where this was written, so CI on this PR is the first run.🤖 Generated with Claude Code