pytroll / pytroll/pyresample

dump DynamicAreaDefinition to YAML

Open
#569 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
385
Forks
102
Avg merge
4d 2h
Merged PRs (30d)
9

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with DynamicAreaDefinition and the existing AreaDefinition.dump behavior, using the provided load_area_from_string example to reproduce the difference. Done means ar2.dump() produces YAML equivalent to the dynamic definition while existing fixed-area dumping continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.