Focal Point Non-Precipitation Weather Jobsheets

Impact and CTA changes with MetaDataDictionary

Purpose:

This jobsheet guides the focal point through adding impactDefaults and ctaDefaults as well as modifying available impactChoices and ctaChoices

Tasks:

Making incremental override of MetaDataDictionary for:

  1. Adding impactDefaults

  2. Adding ctaDefaults

  3. Modifying available impactChoices 

  4. Modifying available ctaChoices

 

Adding impactDefaults

NOTE: Most NPW and WSW hazards do not have defaults explicitly set for impact statements which results in the first option in the choices list becoming the default. The instructions in this section are only needed if multiple defaults are desired. Otherwise, the order of impactChoices can be changed to result in a different default from the baseline.

  1. Setup Localization with your files
  2. In the USER MetaDataDictionary, copy in the hazard and impactChoices from the BASE MetaDataDictionary, change Choices to Defaults and remove the choices that will not be checked by default
    MetaDataDictionary = {
    
        "BZ.W": {
            "impactDefaults": [
                ctaImpact.impactPowerOutagesSnow(),
                ctaImpact.impactWhiteoutTravelExpected(),
                ],
            },
     
    1. The newly-defined defaults must already exist in the impactChoices list

      1. If the option(s) desired to be the default are not already in the list for the specific hazard, add it according to these directions
    2. If multiple hazard type metadata are being overridden, they all go between the { } that was initially added after MetaDataDictionary.
  3.     Save the changes
  4. Open the GFE perspective and load Hazard Services and then select the appropriate settings (Hydro/Non-Precip/Winter)
  5. Create the hazard you just created the defaults for and verify in the HID that those choices are correctly checked
  6. Task Complete!

 

Adding ctaDefaults

NOTE: Most NPW and WSW hazards do not have defaults explicitly set for CTA statements which results in the first option in the choices list becoming the default. The instructions in this section are only needed if multiple defaults are desired. Otherwise, the order of ctaChoices can be changed to result in a different default from the baseline.

  1. Setup Localization with your files
  2. In the USER MetaDataDictionary, copy in the hazard and ctaChoices from the BASE MetaDataDictionary, change Choices to Defaults and remove the choices that will not be checked by default
    MetaDataDictionary = {
    
        "EH.A": {
            "ctaDefaults": [
                ctaImpact.ctaHeatDrinkFluids(),
                ctaImpact.ctaHeatKidsPetsVehicles(),
                ],
            },
    1. The newly-defined defaults must already exist in the ctaChoices list
      1. If the option(s) desired to be the default are not already in the list for the specific hazard, add it according to these directions 
    2. If multiple hazard type metadata are being overridden, they all go between the { } that was initially added after MetaDataDictionary.
  3. Save the file
  4. Open the GFE perspective and load Hazard Services and then select the appropriate settings (Non-Precip/Winter)
  5. Create the hazard you just created the defaults for and verify in the HID that those choices are correctly checked
  6. Task Complete!

 

Modifying impactChoices

  1. Setup Localization with your files
  2. Depending on what changes to the impact statements need to be made, different changes are needed in the override 
    1. To reorder the existing list of impactChoices to make a new impact statement the default (listed first), use _override_replace_
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "FA.A": {
              "impactChoices": ["_override_replace_",
                  ctaImpact.impactStreetCreekRiverFloodingPossible(),
                  ctaImpact.impactFloodingPoorDrainageUrbanAreas(),
                  ctaImpact.impactDrainsDitchesClogWithDebris(),
                  ctaImpact.impactLowWaterCrossingsMayFlood(),
                  ctaImpact.impactExcessRunoff(),
                  ctaImpact.impactCreeksStreamsRiseOutOfBanks(),
                  ctaImpact.impactAreaCreeksStreamsRunningHigh(),
                  ],
               },
           }

       

    2. To add a new option at the end of impactChoices, simply include the new option on its own:
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "HW.W": {
              # Post-processed in MetaData_NonPrecip.py --> updateImpactsFromHazardAttributes()
               "impactChoices": [ctaImpact.impactWindMakesDust(),
                  ],
              },
      
          }
       
      1. The new impact statement must first be added to the CallsToActionAndImpacts Utility via these directions
         
    3. To add a new option to the beginning of the list, thus making it the default selection, use _override_prepend_:
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "HW.W": {
              # Post-processed in MetaData_NonPrecip.py --> updateImpactsFromHazardAttributes()
               "impactChoices": ["_override_prepend_", ctaImpact.impactWindMakesDust(),
                  ],
              },
      
          }
       
      1.  The new impact statement must first be added to the CallsToActionAndImpacts Utility via these directions
         
    4. To insert a new option into the list other than the beginning or end, use _override_replace_:
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "FA.A": {
              "impactChoices": ["_override_replace_",
                  ctaImpact.impactExcessRunoff(),
                  ctaImpact.impactCreeksStreamsRiseOutOfBanks(),
                  ctaImpact.impactFloodingPoorDrainageUrbanAreas(),
                  ctaImpact.impactPondingWaterUrbanWatch(), ### New option added
                  ctaImpact.impactLowWaterCrossingsMayFlood(),
                  ctaImpact.impactDrainsDitchesClogWithDebris(),
                  ctaImpact.impactStreetCreekRiverFloodingPossible(),
                  ctaImpact.impactAreaCreeksStreamsRunningHigh(),
                  ],
               },
      
         }
       
      1. The new impact statement must first be added to the CallsToActionAndImpacts Utility via these directions
         
    5. To remove an existing option from the list of options, use _override_remove_:
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "FA.A": {
              "impactChoices": ["_override_remove_",
                  ctaImpact.impactDrainsDitchesClogWithDebris(),
                  ],
               },
      
          }

       

    6. Detailed information on incremental override behavior can be found here
  3. Save the file
  4. Open the GFE perspective and load Hazard Services and then select the appropriate settings (Non-Precip/Winter/Hydro)
  5. Create the hazard you just created the defaults for and verify in the HID that those choices are correctly checked
  6. Task Complete!

 

Modifying ctaChoices

  1. Setup Localization with your files
  2. Depending on what changes to the CTA statements need to be made, different changes are needed in the override 
    1. To reorder the existing list of ctaChoices to make a new CTA the default (listed first), use _override_replace_
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "EH.W": {
              "ctaChoices": ["_override_replace_",
                  ctaImpact.ctaHeatOutsidePrecautions(), #moved to the default
                  ctaImpact.ctaHeatDrinkFluids(),
                  ctaImpact.ctaHeatKidsPetsVehicles(),
                  ctaImpact.ctaHeatOutdoorWorkOSHA(),
                  ctaImpact.ctaHeatGeneral(),
                  ctaImpact.ctaMonitorLatestForecasts(),
                  ],
              },
           }

       

    2. To add a new option at the end of ctaChoices, simply include the new option on its own:
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "HW.W": {
               "ctaChoices": [ctaImpact.ctaDustFromWindVisibilityTravel()],
              },
      
          }
       
      1. The new CTA statement must first be added to the CallsToActionAndImpacts Utility via these directions
         
    3. To add a new option to the beginning of the list, thus making it the default selection, use _override_prepend_:
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "HW.W": {
              "ctaChoices": ["_override_prepend_", ctaImpact.ctaDustFromWindVisibilityTravel()],
              },
      
          }
       
      1.  The new CTA statement must first be added to the CallsToActionAndImpacts Utility via these directions
         
    4. Toinsert a new option into the list other than the beginning or end, use _override_replace_:
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "WS.W": {
              "ctaChoices": ["_override_replace_",
                  ctaImpact.ctaDerived(),
                  ctaImpact.ctaWinterDressCode(),
                  ctaImpact.ctaDriveSafely(),
                  ctaImpact.ctaBadSnow(), # added this CTA to available options
                  ctaImpact.ctaMotoristSafety(),
                  ctaImpact.ctaWinterStormKit(),
                  ctaImpact.ctaDownPowerlineAndTrees(),
                  ],
              },
      
         }
       
      1. The new CTA statement must first be added to the CallsToActionAndImpacts Utility via these directions
         
    5. To remove an existing option from the list of options, use _override_remove_:
      from CallsToActionAndImpacts import CallsToActionAndImpacts
      ctaImpact = CallsToActionAndImpacts()
      
      MetaDataDictionary = {
      
          "BZ.W": {
              "ctaChoices": ["_override_remove_", ctaImpact.ctaDriveSafely(),
                  ],
               },
      
          }

       

    6. Detailed information on incremental override behavior can be found here
  3. Save the file
  4. Open the GFE perspective and load Hazard Services and then select the appropriate settings (Non-Precip/Winter/Hydro)
  5. Create the hazard you just created the defaults for and verify in the HID that those choices are correctly checked
  6. Task Complete!

 

Setup steps

  1. Open the Localization Perspective by clicking on the "Open Perspective" icon at the top-right of your CAVE window, and choosing "Localization"
  2. Navigate to the Hazard Meta Data sub-directory under the Hazard Services folder
  3. Double click on MetaDataDictionary.py to show the available versions
  4. COPY to create a user override version if none exists (user override is best practice for testing changes):
    1. If there is only a BASE version: right click on BASE and select Create Override File, then select User
    2. If there is another version (e.g. SITE) you wish to use: right click on that file and select Copy To, then select User (this lets you work on an updated SITE version to replace the original when you're finished)
  5. Double click on the USER version of MetaDataDictionary.py to open it for editing
    1. If a new override, it will have no content
  6. Also double click on the BASE version to enable copying desired content to override
    1. The CTA and Impact statements are sourced from the CallsToActionAndImpacts Utility so it may be helpful to open the BASE version and any SITE version that exist
    2. Follow the instructions here to add any new calls-to-action or impact statements that you wish to now reference in MetaDataDictionary
  7. If this is a new override file, add the following to the top of the file:
    from CallsToActionAndImpacts import CallsToActionAndImpacts
    ctaImpact = CallsToActionAndImpacts()
    
    MetaDataDictionary = {
    
    
    }

Save steps

  1. When finished, save the file by hitting Ctrl+S, or selecting Save from the File menu
    1. If a "File Version Conflict" is encountered, click OK to accept merge
    2. In the two-panel "Merge" tab that opens, make no changes, once again save the file by hitting Ctrl+sthen close the "Merge" tab
    3. When a "File Changed" message appears, click Yes.
      1. This behavior will only be encountered when a first-time override file is created and saved