Skip to content

Commit

Permalink
Merge pull request #113 from nunobrum/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
nunobrum committed Aug 20, 2023
2 parents 8773d6a + 6e4d771 commit 9e71a48
Show file tree
Hide file tree
Showing 15 changed files with 578 additions and 285 deletions.
2 changes: 1 addition & 1 deletion PyLTSpice/Histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def main():

if options.range is None:
# Automatic calculation of the range
axisXmin = mu - (options.sigma+1)*sd
axisXmin = mu - (options.sigma + 1) * sd
axisXmax = mu + (options.sigma + 1) * sd

if mn < axisXmin:
Expand Down
9 changes: 7 additions & 2 deletions PyLTSpice/editor/asc_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

_logger = logging.getLogger("PyLTSpice.AscEditor")

TEXT_REGEX = re.compile(r"TEXT (\d+)\s+(\d+)\s+(Left|Right|Top|Bottom)\s\d+\s*(?P<type>[!;])(?P<text>.*)",
TEXT_REGEX = re.compile(r"TEXT (-?\d+)\s+(-?\d+)\s+(Left|Right|Top|Bottom)\s\d+\s*(?P<type>[!;])(?P<text>.*)",
re.IGNORECASE)
TEXT_REGEX_X = 1
TEXT_REGEX_Y = 2
Expand Down Expand Up @@ -158,7 +158,12 @@ def set_component_value(self, device: str, value: Union[str, int, float]) -> Non
raise ComponentNotFoundError(f"Component {device} does not have a Value attribute")

def set_element_model(self, element: str, model: str) -> None:
self.set_component_value(element, model)
comp_info = self.get_component_info(element)
line_no = comp_info['line']
tokens = self._asc_file_lines[line_no].split(' ')
tokens[1] = model
self._asc_file_lines[line_no] = ' '.join(tokens)
_logger.info(f"Component {element} updated to {model}")

def get_component_value(self, element: str) -> str:
comp_info = self.get_component_info(element)
Expand Down
Loading

0 comments on commit 9e71a48

Please sign in to comment.