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

bufr2geojson crash in get_time() when year is a list #30

Open
maaikelimper opened this issue May 6, 2024 · 0 comments
Open

bufr2geojson crash in get_time() when year is a list #30

maaikelimper opened this issue May 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@maaikelimper
Copy link
Collaborator

For this file:

https://www.wis-jma.go.jp/d/o/WSSS/BUFR/Climate/CLIMAT/20240506/000000/A_ISCG01WSSS060000_C_RJTD_20240506001917_47.bufr

In this part of the bufr2geojson-code:

def get_time(self) -> str:
        """
        Function to get time from qualifiers and to apply any displacements or
        increments.

        :returns: ISO 8601 formatted date/time string
        """

        # class is always 04
        xx = "04"
        # get year
        year = self.get_qualifier(xx, "year")

The value of year is [1991, 2020]

which causes the error: unsupported format string passed to list.__format__ when creating the string:

time_ = f"{year:04d}-{month:02d}-{day:02d} {hour:02d}:{minute:02d}:{second:02d}"

@maaikelimper maaikelimper added the bug Something isn't working label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants