Skip to content
This repository was archived by the owner on Oct 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `controls` output header is now `reach_id,flow,control_stage,map_exists`. The new column is appended last, so readers of the first three columns (including `flows2fim domain`) are unaffected
- `validate` progress messages now read `Number of <what> records found` and `File for <what> created at`, since not every check reports something missing
- CHANGELOG.md - adhere to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) standard
- scripts/create-release-assets.sh - seperate release assets and binaries creation, mkdir release_assets/ directory as part of script, and add checksum generation
- scripts/create-release-assets.sh - separate release assets and binaries creation, mkdir release_assets/ directory as part of script, and add checksum generation

### Removed

Expand Down
8 changes: 4 additions & 4 deletions cmd/controls/controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
var usage string = `Usage of controls:
Given a flow file and a reach database. Create controls table of reach flows and downstream boundary conditions.

Flow file's first coloumn values must be reach ids, and second coloumn must be discharges in cfs. Invalid lines are skipped.
Flow file's first column values must be reach ids, and second column must be discharges in cfs. Invalid lines are skipped.

Database file must have a table 'scenarios' and contain following coloumns
Database file must have a table 'scenarios' and contain following columns
reach_id INTEGER
us_flow REAL
us_depth REAL
Expand All @@ -32,7 +32,7 @@ Database file must have a table 'scenarios' and contain following coloumns
map_exists BOOL CHECK(map_exists IN (0, 1))
UNIQUE(reach_id, us_flow, ds_wse, boundary_condition)

Database file must have a table 'network' and contain following coloumns
Database file must have a table 'network' and contain following columns
reach_id INTEGER
updated_to_id INTEGER

Expand Down Expand Up @@ -346,7 +346,7 @@ func Run(args []string) (err error) {
)
flags.StringVar(&dbPath, "db", "", "Path to the database file")
flags.StringVar(&flowsFilePath, "f", "", "Path to the input flows CSV file")
flags.StringVar(&startReachesCSV, "scsv", "", "Path to the CSV file containing starting reach IDs and control stages (Coloumn headers do not matter)")
flags.StringVar(&startReachesCSV, "scsv", "", "Path to the CSV file containing starting reach IDs and control stages (Column headers do not matter)")
flags.StringVar(&startReachIDsStr, "sids", "", "Comma-separated list of starting reach IDs (One of -sids or -scsv is required, if both are provided, -sids and -scs flags are ignored)")
flags.StringVar(&startControlStagesStr, "scs", "nd", "Comma-separated list of starting control stages (corresponding to the reach IDs)")
flags.StringVar(&outputFilePath, "o", "", "Path to the output controls CSV file")
Expand Down
4 changes: 2 additions & 2 deletions cmd/controls/controls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func TestReadFlows(t *testing.T) {
wantErr: true,
},
{
name: "reach_id and flow coloumn swapped",
filePath: "/app/testdata/unit_tests/flow_files/coloumns_swapped.csv",
name: "reach_id and flow column swapped",
filePath: "/app/testdata/unit_tests/flow_files/columns_swapped.csv",
wantFlows: map[int]float32{},
wantErr: false,
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Contains scripts for various build, install, test, and other operational tasks.
- **Automation**: Add scripts for automating common development, build, and deployment tasks.

## Usage
This folder provides hosuing for utility scripts to streamline development workflows.
This folder provides housing for utility scripts to streamline development workflows.
12 changes: 6 additions & 6 deletions scripts/test_suite_linux.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# This script provies a comprehensive test suite of the built flows2fim executable on
# This script provides a comprehensive test suite of the built flows2fim executable on
# linux systems, also including regression tests. This script, as well as testdata/reference_data
# will need to be manually updated as features change. See testdata/readme.md for more information
# on how to update the /testdata directory appropriately.
Expand Down Expand Up @@ -415,7 +415,7 @@ fim_test_cases() {
# Capture the output of the compare_directories function as a variable
diff_output=$(compare_directories "$fim_test_outputs" "$fim_benchmark_dir" "fim")

# If there is no differnce, test pass
# If there is no difference, test pass
if [ -z "$diff_output" ]; then
printf "\t \u2714 No significant difference in fim.tif files. \n\n"
else
Expand Down Expand Up @@ -559,23 +559,23 @@ fim_test_cases() {
rm "$tempfile"
rm "$temp_controls"

printf "(10/${num_test_cases_fim})\t>>>> Controls file without a map_exists coloumn warns and includes every record <<<<\n\n"
printf "(10/${num_test_cases_fim})\t>>>> Controls file without a map_exists column warns and includes every record <<<<\n\n"
# Create and assign temp files
tempfile=$(mktemp)
temp_controls=$(mktemp)
# Controls files written before 0.5.0 have no map_exists coloumn. They must
# Controls files written before 0.5.0 have no map_exists column. They must
# keep working, with a warning that map existence is unknown.
printf "reach_id,flow,control_stage\n24274741,17668,nd\n" > "$temp_controls"
# Test case
$cmd fim \
-c "$temp_controls" \
-fmt $format \
-lib $library_benchmark \
-o $fim_test_outputs/fim_no_coloumn.tif &> "$tempfile"
-o $fim_test_outputs/fim_no_column.tif &> "$tempfile"
# Assign warning string
expected_warning_substring="controls file has no map_exists column"
# Warning must be raised and the composite must still be produced
if grep -q "$expected_warning_substring" "$tempfile" && [ -f "$fim_test_outputs/fim_no_coloumn.tif" ]; then
if grep -q "$expected_warning_substring" "$tempfile" && [ -f "$fim_test_outputs/fim_no_column.tif" ]; then
printf "\t ✔ Passed: warning raised and composite created. \n\n"
else
printf "\t ❌ Failed: expected warning and a composite file \n\n"
Expand Down
12 changes: 6 additions & 6 deletions scripts/test_suite_mac.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# This script provies a comprehensive test suite of the built flows2fim executable on
# This script provides a comprehensive test suite of the built flows2fim executable on
# linux systems, also including regression tests. This script, as well as testdata/reference_data
# will need to be manually updated as features change. See testdata/readme.md for more information
# on how to update the /testdata directory appropriately.
Expand Down Expand Up @@ -415,7 +415,7 @@ fim_test_cases() {
# Capture the output of the compare_directories function as a variable
diff_output=$(compare_directories "$fim_test_outputs" "$fim_benchmark_dir" "fim")

# If there is no differnce, test pass
# If there is no difference, test pass
if [ -z "$diff_output" ]; then
printf "\t \u2714 No significant difference in fim.tif files. \n\n"
else
Expand Down Expand Up @@ -559,23 +559,23 @@ fim_test_cases() {
rm "$tempfile"
rm "$temp_controls"

printf "(10/${num_test_cases_fim})\t>>>> Controls file without a map_exists coloumn warns and includes every record <<<<\n\n"
printf "(10/${num_test_cases_fim})\t>>>> Controls file without a map_exists column warns and includes every record <<<<\n\n"
# Create and assign temp files
tempfile=$(mktemp)
temp_controls=$(mktemp)
# Controls files written before 0.5.0 have no map_exists coloumn. They must
# Controls files written before 0.5.0 have no map_exists column. They must
# keep working, with a warning that map existence is unknown.
printf "reach_id,flow,control_stage\n24274741,17668,nd\n" > "$temp_controls"
# Test case
$cmd fim \
-c "$temp_controls" \
-fmt $format \
-lib $library_benchmark \
-o $fim_test_outputs/fim_no_coloumn.tif &> "$tempfile"
-o $fim_test_outputs/fim_no_column.tif &> "$tempfile"
# Assign warning string
expected_warning_substring="controls file has no map_exists column"
# Warning must be raised and the composite must still be produced
if grep -q "$expected_warning_substring" "$tempfile" && [ -f "$fim_test_outputs/fim_no_coloumn.tif" ]; then
if grep -q "$expected_warning_substring" "$tempfile" && [ -f "$fim_test_outputs/fim_no_column.tif" ]; then
printf "\t ✔ Passed: warning raised and composite created. \n\n"
else
printf "\t ❌ Failed: expected warning and a composite file \n\n"
Expand Down
Loading