# Configuration Guide


The nova_ec package uses a YAML configuration file to customize its behavior. This guide explains the available configuration options and their usage.

## Configuration File Structure

The configuration file has the following main sections:

``` yaml
# Base paths
paths:
  project_path: "/path/to/project"
  ec_path: "/path/to/energy/communities"
  output_dir: "/path/to/output"

# File patterns
file_patterns:
  geocoded_pattern: "TEP_All_Geocoded_*.csv"

# Default values
defaults:
  rough_install_percentage: 5

# Energy community data for 2023
ec_data_2023:
  ccec_shapefile: "path/to/shapefile"
  ccec_appendix: "path/to/appendix"
  ffsa_shapefile: "path/to/shapefile"
  ffsa_appendix: "path/to/appendix"

# Energy community data for 2024
ec_data_2024:
  ccec_shapefile: "path/to/shapefile"
  ccec_appendix: "path/to/appendix"
  ffsa_shapefile: "path/to/shapefile"
  ffsa_appendix: "path/to/appendix"
```

## Configuration Options

### Paths

- `project_path`: Root directory for the project
- `ec_path`: Path to the energy community data files
- `output_dir`: Directory where output files will be saved
- `geocoded_file_pattern`: Pattern to match geocoded files

### File Patterns

- `geocoded_pattern`: Glob pattern to find geocoded files

### Defaults

- `rough_install_percentage`: Default percentage to use for rough install payments

### Energy Community Data

Both `ec_data_2023` and `ec_data_2024` sections have the same structure:

- `ccec_shapefile`: Path to Coal Closure Energy Communities shapefile
- `ccec_appendix`: Path to Coal Closure Energy Communities appendix file
- `ffsa_shapefile`: Path to Fossil Fuel Statistical Areas shapefile
- `ffsa_appendix`: Path to Fossil Fuel Statistical Areas appendix file

## Example Configuration

``` yaml
# Base paths
paths:
  project_path: "C:/Users/username/Projects/energy_communities"
  ec_path: "Z:/Shared/Risk/Projects/ITC Adders/main"
  output_dir: "C:/Users/username/Projects/energy_communities/output"

# File patterns
file_patterns:
  geocoded_pattern: "TEP_All_Geocoded_*.csv"

# Default values
defaults:
  rough_install_percentage: 5

# EC data paths for 2023
ec_data_2023:
  ccec_shapefile: "map_data/2023/Coal Closure/coal_closure_shapefile"
  ccec_appendix: "map_data/2023/census_tracts-appendix.csv"
  ffsa_shapefile: "map_data/2023/Statistical Area/statistical_area_shapefile.shp"
  ffsa_appendix: "map_data/2023/msa_appendix_data.csv"

# EC data paths for 2024
ec_data_2024:
  ccec_shapefile: "map_data/2024/Coal Closure/coal_closure_shapefile"
  ccec_appendix: "map_data/2024/Coal Closure/appendix.csv"
  ffsa_shapefile: "map_data/2024/Statistical Area/statistical_area_shapefile.shp"
  ffsa_appendix: "map_data/2024/Statistical Area/appendix.csv"
```

## Variable Substitution

The configuration system supports variable substitution using curly braces. This allows you to define a value once and reuse it:

``` yaml
# Username definition
username: john.doe

# Base paths with variable substitution
base_paths:
  project_directory: "C:/Users/{username}/Projects"
  
# Paths using variable substitution  
paths:
  project_path: "{project_directory}/energy_communities"
  output_dir: "{project_directory}/energy_communities/output"
```

## Environment Variables

Some environment variables can also be automatically used in paths:

- `{username}`: Current username
- `{home}`: User’s home directory
