Skip to content

Commit

Permalink
replace use of pytools.Record with dataclass
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Apr 27, 2024
1 parent 219c817 commit b1dd192
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions meshpy/ply.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
from dataclasses import dataclass
from typing import List


@dataclass(frozen=True)
class DataBlock:
properties: List[str]
data: List[str]


def parse_int(it):
return int(next(it))

Expand Down Expand Up @@ -69,11 +79,6 @@ def parse_line(parsers, line):
result.append(p(it))
return result

from pytools import Record

class DataBlock(Record):
pass

for name, line_count, props in data_queue:
prop_names, parsers = list(zip(*props))
result[name] = DataBlock(
Expand Down

0 comments on commit b1dd192

Please sign in to comment.