Skip to content

Commit 85a4382

Browse files
committed
RprofsInstant is a frozen dataclass
1 parent d2f7bff commit 85a4382

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/stagpy/step.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import typing
1212
from abc import ABC, abstractmethod
1313
from collections import abc
14+
from dataclasses import dataclass
1415
from functools import cached_property
1516
from itertools import chain
1617

@@ -485,14 +486,14 @@ def bounds(self) -> tuple[float, float]:
485486
"""
486487

487488

489+
@dataclass(frozen=True)
488490
class RprofsInstant(Rprofs):
489491
"""Radial profiles at a given step.
490492
491493
The `Step.rprofs` attribute is an instance of this class.
492494
"""
493495

494-
def __init__(self, step: Step):
495-
self.step = step
496+
step: Step
496497

497498
@cached_property
498499
def _cached_extra(self) -> dict[str, Rprof]:

0 commit comments

Comments
 (0)