|
45 | 45 | import subprocess
|
46 | 46 | import tempfile
|
47 | 47 | import textwrap
|
48 |
| -from typing import Optional |
| 48 | +from typing import Optional, Any |
49 | 49 | import warnings
|
50 | 50 | import xml.etree.ElementTree as ET
|
51 | 51 |
|
@@ -369,20 +369,23 @@ def __init__(
|
369 | 369 | if modelName is None:
|
370 | 370 | raise ModelicaSystemError("A modelname must be provided (argument modelName)!")
|
371 | 371 |
|
372 |
| - self.quantitiesList = [] |
373 |
| - self.paramlist = {} |
374 |
| - self.inputlist = {} |
375 |
| - self.outputlist = {} |
376 |
| - self.continuouslist = {} |
377 |
| - self.simulateOptions = {} |
378 |
| - self.overridevariables = {} |
379 |
| - self.simoptionsoverride = {} |
| 372 | + self.quantitiesList: list[dict[str, Any]] = [] |
| 373 | + self.paramlist: dict[str, str] = {} # even numerical values are stored as str |
| 374 | + self.inputlist: dict[str, list | None] = {} |
| 375 | + # outputlist values are str before simulate(), but they can be |
| 376 | + # np.float64 after simulate(). |
| 377 | + self.outputlist: dict[str, Any] = {} |
| 378 | + # same for continuouslist |
| 379 | + self.continuouslist: dict[str, Any] = {} |
| 380 | + self.simulateOptions: dict[str, str] = {} |
| 381 | + self.overridevariables: dict[str, str] = {} |
| 382 | + self.simoptionsoverride: dict[str, str] = {} |
380 | 383 | self.linearOptions = {'startTime': 0.0, 'stopTime': 1.0, 'stepSize': 0.002, 'tolerance': 1e-8}
|
381 | 384 | self.optimizeOptions = {'startTime': 0.0, 'stopTime': 1.0, 'numberOfIntervals': 500, 'stepSize': 0.002,
|
382 | 385 | 'tolerance': 1e-8}
|
383 |
| - self.linearinputs = [] # linearization input list |
384 |
| - self.linearoutputs = [] # linearization output list |
385 |
| - self.linearstates = [] # linearization states list |
| 386 | + self.linearinputs: list[str] = [] # linearization input list |
| 387 | + self.linearoutputs: list[str] = [] # linearization output list |
| 388 | + self.linearstates: list[str] = [] # linearization states list |
386 | 389 |
|
387 | 390 | if session is not None:
|
388 | 391 | if not isinstance(session, OMCSessionZMQ):
|
|
0 commit comments