Skip to content

Reference for SWMManywhere/defs

Demo configuration file

base_dir: /path/to/base/directory
project: demo
bbox: [0.04020, 51.55759, 0.09826, 51.62050]
run_settings: 
  reporting_iters: 100
  duration: 86400
  storevars: [flooding, flow]
real:
  inp: /path/to/real/model.inp
  graph: /path/to/real/graph.json
  subcatchments: /path/to/real/subcatchments.geojson
  results: null
starting_graph: null
graphfcn_list:
  - assign_id # Initial pass to ensure consistent 'id' and remove duplicates
  - fix_geometries # Ensure consistent geometry directions
  - remove_non_pipe_allowable_links # Filter out things like bridges/motorways
  - calculate_streetcover # Create shapefile of impervious street cover
  - remove_parallel_edges # Remove parallel edges retaining the shorter one
  - to_undirected # Convert graph to undirected to facilitate cleanup
  - split_long_edges # Set a maximum edge length
  - merge_street_nodes # Merge street nodes that are too close together
  - assign_id # Remove duplicates arising from merge_street_nodes
  - clip_to_catchments # Clip graph to catchment subbasins
  - calculate_contributing_area # Calculate runoff coefficient
  - set_elevation # Set node elevation from DEM
  - double_directed # Format as directed graph enabling travel in both directions
  - fix_geometries # Ensure consistent geometries due to undirected->directed
  - set_surface_slope # Calculate surface slope of edges
  - set_chahinian_slope # Transform surface slope to more sensible slope for weights
  - set_chahinian_angle # Transform edge angles to more sensible angle for weights
  - calculate_weights # Calculate weights for each edge
  - identify_outfalls # Identify potential street->river outfalls
  - derive_topology # Shortest path to give network topology
  - pipe_by_pipe # Design pipe diameters and depths
  - fix_geometries # Ensure geometries present before printing
  - assign_id # Final pass to ensure consistent 'id' and remove duplicates
metric_list:
  - outfall_nse_flow
  - outfall_kge_flow
  - outfall_relerror_flow
  - outfall_relerror_length
  - outfall_relerror_npipes
  - outfall_relerror_nmanholes
  - outfall_relerror_diameter
  - outfall_nse_flooding
  - outfall_kge_flooding
  - outfall_relerror_flooding
  - grid_nse_flooding
  - grid_kge_flooding
  - grid_relerror_flooding
  - subcatchment_nse_flooding
  - subcatchment_kge_flooding
  - subcatchment_relerror_flooding
  - bias_flood_depth
  - kstest_edge_betweenness
  - kstest_betweenness
  - outfall_kstest_diameters
  - nc_deltacon0
  - nc_laplacian_dist
  - nc_vertex_edge_distance

Schema for configuration file

type: object
properties:
  base_dir: {type: string}
  project: {type: string}
  bbox: {type: array, items: {type: number}, minItems: 4, maxItems: 4}
  model_number: {type: integer}
  run_settings:
    type: object
    properties:
      reporting_iters: {type: integer, minimum: 1}
      duration: {type: number}
      storevars:
        type: array
        items: 
          type: string
          enum: [flooding, flow, depth, runoff]
  real:
    type: ['object', 'null']
    properties:
      inp: {type: ['string', 'null']}
      graph: {type: string}
      subcatchments: {type: string}
      results: {type: ['string', 'null']}
    required: [graph, subcatchments]
    anyOf:
      - required: [inp]
      - required: [results]
  starting_graph: {type: ['string', 'null']}
  graphfcn_list: {type: array, items: {type: string}}
  metric_list: {type: array, items: {type: string}}
  address_overrides: {type: ['object', 'null']}
  parameter_overrides: {type: ['object', 'null']}
  custom_metric_modules: {type: array, items: {type: string}}
  custom_graphfcn_modules: {type: array, items: {type: string}}
required: [base_dir, project, bbox]