qrm2 icon indicating copy to clipboard operation
qrm2 copied to clipboard

make the band chart/map metadata format be a dictionary?

Open classabbyamp opened this issue 5 years ago • 3 comments

a dictionary would be more informative at first glance, would probably make it harder to make an error when adding more, and make the qrm-side code simpler.

Example

{
  "cn": {
    "path": "/resources/bandcharts/cn.png",
    "short_name": "China",
    "long_name": "Amateur radio bands in China",
    "description": "",
    "source": "Created by KN8U and NY7H",
    "emoji": "🇨🇳"
  }
}

classabbyamp avatar Nov 21 '20 03:11 classabbyamp

This will require me looking at the relevant code and checking what was the reason for using lists. I suspect it was to have a system where omitting a field would cause errors. But I am not exactly sure why that over something else, or is there was more to it.

0x5c avatar Nov 22 '20 18:11 0x5c

This would come after I'm done with the actual move (#246) in the existing code

0x5c avatar Nov 22 '20 18:11 0x5c

Investigation notes: IIRC the issue with this idea was dataclasses being trash at dealing with supplementary kwargs, which would cause issue at data unpacking if the resource file gains a new key. I think that this was the only issue, and it would be fixed by just using pydantic instead: it's already in the requirements.

0x5c avatar Apr 02 '21 06:04 0x5c