Map refactoring¶
- Table of contents
- Map refactoring
Add back automapped mappings to map.csv¶
- Join map.csv onto src.csv:
for map in inputs/*/*/src.csv; do (set -x; bin/in_place "$map" env quiet=1 bin/join "${map/%src.csv/map.csv}"); done
- Rename src.csv to map.csv:
for map in inputs/*/*/src.csv; do (set -x; mv -f "$map" "${map/%src.csv/map.csv}"); done
- Restore original src.csvs:
svn up
- Check that no rows have been removed:
svn di|grep '^-'|grep -v '^---'
make test
- Check diffs
- Commit
Change empty mappings to self mappings¶
- Join map.csv onto src.csv:
for map in inputs/*/*/src.csv; do (set -x; bin/in_place "$map" env passthru=1 bin/join "${map/%src.csv/map.csv}"); done
- Rename src.csv to map.csv:
for map in inputs/*/*/src.csv; do (set -x; mv -f "$map" "${map/%src.csv/map.csv}"); done
- Restore original src.csvs:
svn up
- Check that no rows have been removed using
svn di
make test
- Check diffs
- Commit
Add filter column¶
- Insert filter column:
for map in inputs/*/*/map.csv; do (set -x; bin/in_place "$map" bin/ins_col 2 Filter); done
- Change input.Makefile to combine the filter column with the output column before joining to create VegBIEN.csv
make inputs/
- Check that no VegBIEN.csv have changed using
svn st
- Check diffs
- Commit
Move filter suffixes to separate filter column¶
- Find mappings containing a filter expression:
grep -lF /_ inputs/*/*/map.csv
- In each of these maps, move the /... suffix to the new Filter column:
- Replace regexp
(/_.*?"),
with","$1
- Replace regexp
(?<!["\d])(/_.*?),
with,$1
- Replace regexp
make test
- Check diffs
- Commit
Add *
to every term that's not in Veg+¶
*
to every term that's not in Veg+- Change
bin/src_map
to prefix a*
to every output column term - Insert
*
column:for map in inputs/*/*/map.csv; do (set -x; bin/in_place "$map" bin/ins_col 1 VegCore "*"); done
- Combine prefix column with VegCore column:
for map in inputs/*/*/map.csv; do (set -x; bin/in_place "$map" bin/cat_cols 1 2); done
make test
- Check diffs
- Commit