Skip to content

dump DynamicAreaDefinition to YAML #569

@gerritholl

Description

@gerritholl

I would like to be able to dump the YAML code for a DynamicAreaDefinition, just like how this is already possible for an AreaDefinition.

Code Sample, a minimal, complete, and verifiable piece of code

# Your code here
from pyresample.area_config import load_area_from_string

ardef_fixed = """nq0002km:
  description: nq0002km
  projection:
    EPSG: 4087
  shape:
    height: 10000
    width: 10000
  area_extent:
    lower_left_xy:
    - -10016827.23100899
    - -10016827.23100899
    upper_right_xy:
    - 10016828.344203897
    - 10016827.23100899
"""

ardef_dyn = """dyn_2km:
  description: dyn_2km
  projection:
    EPSG: 4087
  resolution: 2000
"""

ar1 = load_area_from_string(ardef_fixed)
ar2 = load_area_from_string(ardef_dyn)

print(ar1)
print(ar2)

print(ar1.dump())
print(ar2.dump())

Problem description

Currently, ar1.dump() works, but ar2.dump() does not work.

Expected Output

I expect to reproduce (more or less) the strings for ardef_fixed and ardef_dyn.

Actual Result, Traceback if applicable

Traceback (most recent call last):
  File "/data/gholl/checkouts/protocode/load-dynamic-area.py", line 33, in <module>
    print(ar2.dump())
          ^^^^^^^^
AttributeError: 'DynamicAreaDefinition' object has no attribute 'dump'

Versions of Python, package at hand and relevant dependencies

pyresample main

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions