Skip to content

Feature/non standard csv filename#265

Open
danhamill wants to merge 1 commit intomasterfrom
Feature/non-standard-csv-filename
Open

Feature/non standard csv filename#265
danhamill wants to merge 1 commit intomasterfrom
Feature/non-standard-csv-filename

Conversation

@danhamill
Copy link
Contributor

Add Support for Non-Standard CSV Filename Patterns

This PR enhances the CSV ensemble reader to handle files with non-standard naming conventions, improving flexibility for different watershed data sources.

🚀 Key Features

  • Configurable filename patterns: Added suffix parameter to CsvEnsembleReader constructor to support different CSV file naming conventions
  • Enhanced test coverage: Restructured test resources and expanded testing for multiple watershed filename patterns
  • Backward compatibility: Existing functionality remains unchanged while adding new flexibility

📁 Changes Made

Core Implementation:

  • Modified CsvEnsembleReader.java to accept suffix parameter for flexible filename patterns

Test Infrastructure Updates:

  • Restructured test resources into watershed-specific directories (FeatherYuba/, Kanektok/)
  • Updated TestingPaths.java to dynamically build paths for reorganized structure
  • Enhanced Testing.java bulk testing to validate multiple watershed patterns
  • Updated various test classes to work with new directory structure

Test Data:

  • Added FeatherYuba hindcast CSV files with different naming structure for comprehensive testing
  • Organized existing Kanektok test files into subdirectory

Testing

  • All existing tests pass with backward compatibility maintained
  • New test cases validate different CSV filename patterns
  • Bulk testing covers multiple watershed scenarios

- Modified CsvEnsembleReader.java to accept suffix parameter for flexible filename patterns
- Restructured test resources into watershed-specific directories (FeatherYuba/, Kanektok/)
- Updated TestingPaths.java to dynamically build paths for reorganized structure
- Enhanced Testing.java bulk testing to validate multiple watershed patterns
- Updated various test classes to work with new directory structure
- Organized existing Kanektok test files into subdirectory
@danhamill danhamill force-pushed the Feature/non-standard-csv-filename branch from ffbc01c to 6f093ed Compare February 13, 2026 22:31
@danhamill danhamill requested a review from dvdhoz February 13, 2026 22:34
@dvdhoz dvdhoz requested a review from ktarbet February 18, 2026 23:21
Copy link
Collaborator

@ktarbet ktarbet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I've added a couple suggestions.


/**
*
* @param path path to csv file cache (example C:\Temp\hefs_cache)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider updating java doc.

Suggested change
* @param path path to csv file cache (example C:\Temp\hefs_cache)
* @param path path to csv file cache (example C:\Temp\hefs_cache)
*
* @param suffix for csv file (not including .csv)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an overloaded constructor for users that are using this the old way.

public CsvEnsembleReader(String path) {
this.suffix="";
this.pathToCSV = path;
}

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.

2 participants