-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execution Graph and Computation Optimization #27
Conversation
Test Fixes: update expected output in NLEIS tests to reflect correct units
* Enabled circuit processing and circuit evaluation using execution graph * Updated and passed all the corresponding tests * Updated requirements.txt and setup.py * Bumped up version number * Fixed some docstrings
* Added speed benchmark for graph-based function evaluation to examples * Added release notes * Improved CircuitGraph class docstrings
Pull Request Test Coverage Report for Build 12875811319Details
💛 - Coveralls |
Hi @andersonjacob, Thanks for your excellent code on CircuitGraph. I made small edits to it and it worked seamlessly with my code. With some benchmark results, the graph-based evaluation can at least 3X speed up the function evaluation. Surprisingly it does not introduce much performance improvement when the circuit is matrix-driven and the Main changes to the CircuitGraph function include:
|
nleis/fitting.py
Outdated
dnode = f"d{self.dnum}" | ||
self.dnum += 1 | ||
self.graph.add_node(dnode, Z=circuit_elements["d"]) | ||
for elem in pd_elem: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if statements are really only needed to get the number to use. You could simplify it a lot with
if operator == "p":
nnum = self.pnum
self.pnum += 1
elif operator == "d":
nnum = self.dnum
self.dnum += 1
node = f"{operator}{nnum}"
self.graph.add_node(node, Z=circuit_elements[operator])
for elem in pd_elem:
elem = self.add_series_elements(elem)
self.graph.add_edge(elem, node)
parsing_circuit = parsing_circuit.replace(pd, node)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spending time reviewing my implementation. I agree that this will make the code cleaner and simpler. I will make the changes accordingly.
One thing that may make things easier/better for the long term, but not for the short term. Your code depends on |
Thanks for the note! That is exactly my long-term goal for the |
* simplify the code for parse_circuit * Update compute methods to return impedance value * add networkx dependency to environment.yml
The code itself looks very similar to what I would expect. I haven't run anything so I can't verify that it works as one would expect, but I am assuming that your tests will cover most all of that. I think it looks good. |
Yes, the tests cover most of the essential use cases and make sure the graph-based calculation is equivalent to the Thank you so much for your contribution and I will merge the PR soon. 🚀 |
@all-contributors please add @andersonjacob for code and review. |
I've put up a pull request to add @andersonjacob! 🎉 |
Execution Graph
Computation Optimization
New Circuit Elements
Documentation
General Code Improvement