Coverage for pyrc\core\components\input.py: 82%

11 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-06-29 15:57 +0200

1# ------------------------------------------------------------------------------- 

2# Copyright (C) 2026 Joel Kimmich, Tim Jourdan 

3# ------------------------------------------------------------------------------ 

4# License 

5# This file is part of PyRC, distributed under GPL-3.0-or-later. 

6# ------------------------------------------------------------------------------ 

7 

8from __future__ import annotations 

9 

10from abc import ABC, abstractmethod 

11 

12 

13class Input(ABC): 

14 """ 

15 Each Input can be called as function to get its value during solving depending on the time step/ temperature 

16 or last input value. 

17 """ 

18 

19 @property 

20 @abstractmethod 

21 def index(self) -> int: 

22 """ 

23 Returns the index of self in the input vector/matrix. 

24 

25 Returns 

26 ------- 

27 int : 

28 The index of self in the input vector/matrix. 

29 """ 

30 pass 

31 

32 @property 

33 @abstractmethod 

34 def initial_value(self): 

35 pass