Skip to content

Commit bac14a9

Browse files
committed
fix empty return of get_scope_data in case of long pre-simulation time
1 parent e4e1e0c commit bac14a9

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
## [0.0.4] - 2024-07-01
12+
### Fixed
13+
- empty data return in get_scope_data() in case of a pre-simulation time longer than the steady-state simulation time
14+
1115
## [0.0.3] - 2024-06-26
1216
### Added
1317
- 'set_nonlinear_file()' to set non-linear capacitance files
@@ -25,7 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2529

2630

2731

28-
[unreleased]: https://github.com/upb-lea/pygeckocircuits2/compare/0.0.3...HEAD
32+
[unreleased]: https://github.com/upb-lea/pygeckocircuits2/compare/0.0.4...HEAD
33+
[0.0.4]: https://github.com/upb-lea/pygeckocircuits2/compare/0.0.3...0.0.4
2934
[0.0.3]: https://github.com/upb-lea/pygeckocircuits2/compare/0.0.2...0.0.3
3035
[0.0.2]: https://github.com/upb-lea/pygeckocircuits2/compare/0.0.1...0.0.2
3136
[0.0.1]: https://github.com/upb-lea/pygeckocircuits2/releases/tag/0.0.1

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
project = 'PyGeckoCircuits2'
2121
copyright = '2024, UPB-LEA'
2222
author = 'UPB-LEA'
23-
release = '0.0.3'
23+
release = '0.0.4'
2424
# -- General configuration ---------------------------------------------------
2525
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2626

pygeckocircuits2/geckoCircuitsRemote.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ def get_scope_data(self, node_names: Union[List, str], file_name: str, start_tim
553553
554554
The data with respect to specified scope nodes are extracted and save to csv file locally.
555555
556-
:param node_names: the name provided to the scope nodes
556+
:param node_names: the name provided to the scope nodes, e.g. ["v1", "i_l_1"]
557557
:type node_names: List[str] or str
558558
:param file_name: name of the csv file under which the extracted data needed to be exported
559559
:type file_name: str
@@ -568,7 +568,9 @@ def get_scope_data(self, node_names: Union[List, str], file_name: str, start_tim
568568
:rtype: None
569569
"""
570570
stop_time = stop_time if stop_time and stop_time > 0 else self.ginst.get_Tend()
571+
stop_time = stop_time + self.ginst.get_Tend_pre() - 2 * self.ginst.get_dt()
571572
start_time = start_time if start_time and start_time < stop_time else 0
573+
start_time = start_time + self.ginst.get_Tend_pre()
572574
data = {}
573575
if isinstance(node_names, list):
574576
for node in node_names:
@@ -581,8 +583,11 @@ def get_scope_data(self, node_names: Union[List, str], file_name: str, start_tim
581583
df.insert(0, 'time', time)
582584
df.to_csv(path_or_buf=file_name+'.csv', encoding='utf-8', index=False, sep=' ', header=True)
583585
else:
586+
df = None
584587
print('Nothing to be saved')
585588

589+
return df
590+
586591
def get_values(self, nodes: Union[List, str], operations: Union[List, str],
587592
range_start_stop: List[Union[float, str]] = None) -> Dict:
588593
"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pygeckocircuits2"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
authors = [
55
{ name = "UPB-LEA" },
66
]

0 commit comments

Comments
 (0)