Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Working with GDM models

ERAD’s AssetSystem provides a class method for users working with a GDM DistributionSystem. Distribution system components are automatically mapped to the asset models and added to the AssetSystem. A hazard simulation can then be set up using the steps listed above. We start by loading a GDM model using the gdmloader package. This package can be installed using the command

pip install gdmloader
/opt/homebrew/Caskroom/miniconda/base/envs/erad/lib/python3.12/site-packages/kaleido/__init__.py:14: UserWarning:



Warning: You have Plotly version 6.0.1, which is not compatible with this version of Kaleido (1.0.0).

This means that static image generation (e.g. `fig.write_image()`) will not work.

Please upgrade Plotly to version 6.1.1 or greater, or downgrade Kaleido to version 0.2.1.


WARNING	Task(Task-2) google.auth.compute_engine._metadata:_metadata.py:ping()- Compute Engine Metadata server unavailable on attempt 1 of 3. Reason: timed out
WARNING	Task(Task-2) google.auth.compute_engine._metadata:_metadata.py:ping()- Compute Engine Metadata server unavailable on attempt 2 of 3. Reason: timed out
WARNING	Task(Task-2) google.auth.compute_engine._metadata:_metadata.py:ping()- Compute Engine Metadata server unavailable on attempt 3 of 3. Reason: [Errno 64] Host is down
WARNING	Task(Task-2) google.auth._default:_default.py:_get_gce_credentials()- Authentication failed using Compute Engine authentication due to unavailable metadata server.
WARNING	Task(Task-2) google.auth.compute_engine._metadata:_metadata.py:get()- Compute Engine Metadata server unavailable on attempt 1 of 5. Reason: HTTPConnectionPool(host='metadata.google.internal', port=80): Max retries exceeded with url: /computeMetadata/v1/instance/service-accounts/default/?recursive=true (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x11ee5e4b0>: Failed to resolve 'metadata.google.internal' ([Errno 8] nodename nor servname provided, or not known)"))
WARNING	Task(Task-2) google.auth.compute_engine._metadata:_metadata.py:get()- Compute Engine Metadata server unavailable on attempt 2 of 5. Reason: HTTPConnectionPool(host='metadata.google.internal', port=80): Max retries exceeded with url: /computeMetadata/v1/instance/service-accounts/default/?recursive=true (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x11eeec230>: Failed to resolve 'metadata.google.internal' ([Errno 8] nodename nor servname provided, or not known)"))
WARNING	Task(Task-2) google.auth.compute_engine._metadata:_metadata.py:get()- Compute Engine Metadata server unavailable on attempt 3 of 5. Reason: HTTPConnectionPool(host='metadata.google.internal', port=80): Max retries exceeded with url: /computeMetadata/v1/instance/service-accounts/default/?recursive=true (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x11eeec7d0>: Failed to resolve 'metadata.google.internal' ([Errno 8] nodename nor servname provided, or not known)"))
WARNING	Task(Task-2) google.auth.compute_engine._metadata:_metadata.py:get()- Compute Engine Metadata server unavailable on attempt 4 of 5. Reason: HTTPConnectionPool(host='metadata.google.internal', port=80): Max retries exceeded with url: /computeMetadata/v1/instance/service-accounts/default/?recursive=true (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x11eeec950>: Failed to resolve 'metadata.google.internal' ([Errno 8] nodename nor servname provided, or not known)"))
WARNING	Task(Task-2) google.auth.compute_engine._metadata:_metadata.py:get()- Compute Engine Metadata server unavailable on attempt 5 of 5. Reason: HTTPConnectionPool(host='metadata.google.internal', port=80): Max retries exceeded with url: /computeMetadata/v1/instance/service-accounts/default/?recursive=true (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x11eeec500>: Failed to resolve 'metadata.google.internal' ([Errno 8] nodename nor servname provided, or not known)"))
Loading...
Loading...

Next, we built the asset system from the gdm DistributionSystem using the from_gdm method.

Loading...
Loading...
Loading...

Plotting an AssetSystem

Loading...

Building a HazardModel

In this section, we built a hazard model and apply the model the asset system.

Overlaying the HazardModel

We can overlay the hazard model on the same plot using the add_trace method. The show method can be used to render the image again.

Loading...

Finally, we can run the actual simulation using the HazardSimulator class from erad.runner.

Loading...
Loading...
2026-03-06 08:50:08.997 | WARNING  | erad.runner:run:52 - No HazardFragilityCurves definitions found in the passed HazardSystem, using default curve definitions
2026-03-06 08:50:08.997 | INFO     | erad.runner:run:60 - Simulating hazard at 2026-03-06 08:50:08.879438

Once the simulation is complete, we can visualize the results by plotting the survival_prob from the updated gdf dataframe.

Loading...