Skip to content

Commit 2139ba3

Browse files
authored
Merge pull request #46 from MiraGeoscience/release/3.1.0
Release/3.1.0
2 parents b57e158 + 5e5b1f5 commit 2139ba3

12 files changed

Lines changed: 897 additions & 729 deletions

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ omf
1818
:alt: pytest
1919

2020

21-
Version: 3.0.1
21+
Version: 3.1.0
2222

2323
API library for Open Mining Format, a new standard for mining data backed by
2424
the `Global Mining Standards & Guidelines Group <https://gmggroup.org/>`_.

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
# built documents.
6363
#
6464
# The short X.Y version.
65-
version = u'3.0.0'
65+
version = u'3.1.0'
6666
# The full version, including alpha/beta/rc tags.
67-
release = u'3.0.0'
67+
release = u'3.1.0'
6868

6969
# The language for content autogenerated by Sphinx. Refer to documentation
7070
# for a list of supported languages.

omf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from .texture import ImageTexture
3030
from .volume import VolumeElement, VolumeGridGeometry
3131

32-
__version__ = "3.0.1"
32+
__version__ = "3.1.0"
3333
__author__ = "Global Mining Standards and Guidelines Group"
3434
__license__ = "MIT License"
3535
__copyright__ = "Copyright 2017 Global Mining Standards and Guidelines Group"

omf/fileio/fileio.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""fileio.py: OMF Writer and Reader for serializing to and from .omf files"""
22

3+
from __future__ import annotations
4+
35
import json
46
import struct
57
import uuid
68

7-
from six import string_types
8-
99
from omf.base import UidModel
1010
from omf.fileio.geoh5 import GeoH5Writer
1111

@@ -36,13 +36,14 @@ class OMFWriter:
3636
in the binary blob.
3737
"""
3838

39-
def __init__(self, project, fname):
39+
def __init__(self, project: UidModel, fname: str, compression: int = 5):
4040
"""Project serialization is performed on OMFWriter init
4141
4242
Binary data is written during project serialization
4343
"""
44+
4445
if fname.endswith("geoh5"):
45-
GeoH5Writer(project, fname)
46+
GeoH5Writer(project, fname, compression=compression)
4647
else:
4748
if not fname.endswith(".omf"):
4849
fname = fname + ".omf"
@@ -100,7 +101,7 @@ class OMFReader:
100101

101102
def __init__(self, fopen):
102103
if isinstance(fopen, str):
103-
fopen = open(fopen, "rb")
104+
fopen = open(fopen, "rb") # pylint: disable=R1732
104105
self._fopen = fopen
105106
fopen.seek(0, 0)
106107
self._uid, self._json_start = self.read_header()
@@ -157,8 +158,8 @@ def read_header(self):
157158
file_version = file_version[0 : len(__version__)]
158159
if file_version != __version__:
159160
raise ValueError(
160-
"Version mismatch: file version {fv!r}, "
161-
"reader version {rv!r}".format(fv=file_version, rv=__version__)
161+
f"Version mismatch: file version {file_version!r}, "
162+
f"reader version {__version__!r}"
162163
)
163164
uid = uuid.UUID(bytes=struct.unpack("<16s", self._fopen.read(16))[0])
164165
json_start = struct.unpack("<Q", self._fopen.read(8))[0]

0 commit comments

Comments
 (0)