mirror of
https://github.com/wassname/segpy.git
synced 2026-08-18 12:30:27 +08:00
Achieves another 30% increase in trace header reading performance. (Forgotten file)
This commit is contained in:
+4
-1
@@ -9,7 +9,10 @@ from segpy.util import underscores_to_camelcase, first_sentence, super_class
|
||||
class Header:
|
||||
"""An abstract base class for header format definitions."""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
def __init__(self, *args, **kwargs):
|
||||
for keyword, arg in zip(self.ordered_field_names(), args):
|
||||
setattr(self, keyword, arg)
|
||||
|
||||
for keyword, arg in kwargs.items():
|
||||
try:
|
||||
getattr(self, keyword)
|
||||
|
||||
Reference in New Issue
Block a user