Skip to content

Commit

Permalink
Allow product_kind selection of messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexamici committed Nov 27, 2018
1 parent b6aa823 commit 88b5269
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cfgrib/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class Message(collections.MutableMapping):
errors = attr.attrib(default='ignore', validator=attr.validators.in_(['ignore', 'strict']))

@classmethod
def from_file(cls, file, offset=None, **kwargs):
# type: (T.IO[bytes], int, T.Any) -> Message
def from_file(cls, file, offset=None, product_kind=eccodes.CODES_PRODUCT_GRIB, **kwargs):
# type: (T.IO[bytes], int, int, T.Any) -> Message
if offset is not None:
file.seek(offset)
codes_id = eccodes.codes_handle_new_from_file(file)
codes_id = eccodes.codes_handle_new_from_file(file, product_kind=product_kind)
return cls(codes_id=codes_id, **kwargs)

@classmethod
Expand Down

0 comments on commit 88b5269

Please sign in to comment.