From 1e428a879c38220cbe6f1c20b488735b6d895c82 Mon Sep 17 00:00:00 2001 From: Nuno Brum Date: Fri, 3 Nov 2023 11:04:24 +0100 Subject: [PATCH] Removing dependencies. These are now solely on the spicelib dependency. Alignment with spicelib 0.8 --- README.md | 6 ++++++ doc/modules/read_netlist.rst | 6 +++--- examples/spice_editor_example.py | 2 +- pyproject.toml | 10 ++-------- unittests/test_asc_editor.py | 10 +++++----- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b2aec9d..dc34267 100644 --- a/README.md +++ b/README.md @@ -432,6 +432,12 @@ _Make sure to initialize the root logger before importing the library to be able * Alternative contact : [nuno.brum@gmail.com](mailto:nuno.brum@gmail.com) ## History ## + +* Version 5.1 + * Important Bugfix on the LTComplex class. + * Fixes and enhancing the analysis toolkit. + * Deprecating SpiceEditor.write_netlist in favour of save_netlist() + * Version 5.0 * Making this library dependent on spicelib while trying to maintain backward compatibility as much as possible. PyLTspice will be kept alive and its update will be linked to the spicelib. The main difference is that using diff --git a/doc/modules/read_netlist.rst b/doc/modules/read_netlist.rst index 933e5c0..1d57eb5 100644 --- a/doc/modules/read_netlist.rst +++ b/doc/modules/read_netlist.rst @@ -14,7 +14,7 @@ The rationale for this division is to allow to manipulate not only elements that manipulate elements that exit inside of sub-circuits. In Example 2 there is small example where the value of a component inside a subcircuit is changed. -When all the changes are made, the write_netlist() needs to be called in order for the updates to be registered. +When all the changes are made, the save_netlist() needs to be called in order for the updates to be registered. Do not update the original file. It is always safer to keep the original file unchanged. This helps when debuging problems, and also allows the script to revert to the initial condition by using the reset_netlist() method. @@ -39,7 +39,7 @@ Example 1: Setting parameters inside a flat netlist. ".param run = 0" ) - net.write_netlist("Batch_Test_Modified.net") # writes the modified netlist to the indicated file + net.save_netlist("Batch_Test_Modified.net") # writes the modified netlist to the indicated file Example 2: Updating components inside a subcircuit @@ -52,7 +52,7 @@ Example 2: Updating components inside a subcircuit net.set_component_value('R1', 1000) # Sets the value of R1 to 1k net.set_component_value('XU1:Ra', '1k') # Sets the value of Ra inside of XU1 to 1k - net.write_netlist("Batch_Test_Modified.net") + net.save_netlist("Batch_Test_Modified.net") See the class documentation for more details : diff --git a/examples/spice_editor_example.py b/examples/spice_editor_example.py index 942ec79..43ebf37 100644 --- a/examples/spice_editor_example.py +++ b/examples/spice_editor_example.py @@ -6,5 +6,5 @@ se.set_component_value('C1', 1.1E-6) se.set_component_value('V1', 11) -se.write_netlist("./testfiles/Noise_updated.net") +se.save_netlist("./testfiles/Noise_updated.net") se.run() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 85d40ab..9c915be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ build-backend = "setuptools.build_meta" [project] name = "PyLTSpice" -version = "5.0" +version = "5.1" authors = [ { name="Nuno Brum", email="me@nunobrum.com" }, ] @@ -15,13 +15,7 @@ readme = "README.md" license = { file="LICENSE" } requires-python = ">=3.8" dependencies = [ - "numpy", - "scipy", - "psutil", - "clipboard", - "matplotlib", - "keyboard", - "spicelib>=0.6", + "spicelib>=0.8", ] classifiers=[ "Programming Language :: Python :: 3", diff --git a/unittests/test_asc_editor.py b/unittests/test_asc_editor.py index 5ff5c60..a2b58b0 100644 --- a/unittests/test_asc_editor.py +++ b/unittests/test_asc_editor.py @@ -19,18 +19,18 @@ def test_component_editing(self): self.assertEqual(self.edt.get_component_value('R1'), '10k', "Tested R1 Value") # add assertion here self.assertListEqual(self.edt.get_components(), ['Vin', 'R1', 'R2', 'D1'], "Tested get_components") # add assertion here self.edt.set_component_value('R1', '33k') - self.edt.write_netlist(test_dir + 'test_components_output.asc') + self.edt.save_netlist(test_dir + 'test_components_output.asc') self.equalFiles(test_dir + 'test_components_output.asc', golden_dir + 'test_components_output.asc') self.assertEqual(self.edt.get_component_value('R1'), '33k', "Tested R1 Value") # add assertion here self.edt.remove_component('R1') - self.edt.write_netlist(test_dir + 'test_components_output_1.asc') + self.edt.save_netlist(test_dir + 'test_components_output_1.asc') self.equalFiles(test_dir + 'test_components_output_1.asc', golden_dir + 'test_components_output_1.asc') def test_parameter_edit(self): self.assertEqual(self.edt.get_parameter('TEMP'), '0', "Tested TEMP Parameter") # add assertion here self.edt.set_parameter('TEMP', 25) self.assertEqual(self.edt.get_parameter('TEMP'), '25', "Tested TEMP Parameter") # add assertion here - self.edt.write_netlist(test_dir + 'test_parameter_output.asc') + self.edt.save_netlist(test_dir + 'test_parameter_output.asc') self.equalFiles(test_dir + 'test_parameter_output.asc', golden_dir + 'test_parameter_output.asc') self.edt.set_parameter('TEMP', 0) # reset to 0 self.assertEqual(self.edt.get_parameter('TEMP'), '0.0', "Tested TEMP Parameter") # add assertion here @@ -41,10 +41,10 @@ def test_instructions(self): self.edt.add_instruction('.save I(R1)') self.edt.add_instruction('.save I(R2)') self.edt.add_instruction('.save I(D1)') - self.edt.write_netlist(test_dir + 'test_instructions_output.asc') + self.edt.save_netlist(test_dir + 'test_instructions_output.asc') self.equalFiles(test_dir + 'test_instructions_output.asc', golden_dir + 'test_instructions_output.asc') self.edt.remove_instruction('.save I(R1)') - self.edt.write_netlist(test_dir + 'test_instructions_output_1.asc') + self.edt.save_netlist(test_dir + 'test_instructions_output_1.asc') self.equalFiles(test_dir + 'test_instructions_output_1.asc', golden_dir + 'test_instructions_output_1.asc') def equalFiles(self, file1, file2):