Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dump DynamicAreaDefinition to YAML #569

Open
gerritholl opened this issue Dec 11, 2023 · 0 comments
Open

dump DynamicAreaDefinition to YAML #569

gerritholl opened this issue Dec 11, 2023 · 0 comments

Comments

@gerritholl
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant