Skip to content

Commit a6506e8

Browse files
committed
Fix class attribute assignments in COPY and GENER objects
The way set up the COPY and GENER classes, attributes were initialized as class attributes and not instances attributes. This lead to the wrong timeseries being passed around and very much produces the wrong results. I think I've been writing too much C# lately....
1 parent 72d3665 commit a6506e8

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

HSP2/COPY.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ class Copy():
1010
This functionality is not currently implemented, presently only loading from EXT SOURCES
1111
"""
1212

13-
_ts = {}
14-
_ts['MEAN'] = {}
15-
_ts['POINT'] = {}
16-
1713
def __init__(self, store: pd.HDFStore, sim_info: Dict, ext_sources: List) -> None:
14+
self._ts = {}
15+
self._ts['MEAN'] = {}
16+
self._ts['POINT'] = {}
17+
1818
ts = get_timeseries(store, ext_sources, sim_info)
1919
for source in ext_sources:
2020
themn = source.TMEMN

HSP2/GENER.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ class Gener():
1111
Currently supports OPCODES 1-7, 9-23, & 25-26
1212
"""
1313

14-
ts_input_1 = pd.Series() # type: pd.Series
15-
ts_input_2 = pd.Series() # type: pd.Series
16-
ts_output = pd.Series() # type: pd.Series
17-
opcode = 0 # type: int
18-
k = -1.0E30 # type: float
19-
2014
def __init__(self, segment: str, copies: Dict, geners: Dict, ddlinks: Dict, ddgener: Dict) -> None:
15+
self.ts_input_1 = pd.Series() # type: pd.Series
16+
self. ts_input_2 = pd.Series() # type: pd.Series
17+
self.ts_output = pd.Series() # type: pd.Series
18+
self.opcode = 0 # type: int
19+
self.k = -1.0E30 # type: float
20+
2121
self.opcode = ddgener['OPCODE'][segment]
2222
if self.opcode in [9,10,11,24,25,26]:
2323
self.k = ddgener['PARM'][segment]

0 commit comments

Comments
 (0)