Comments (4)
Hey there! Somehow this originally fell threw the cracks in my inbox, but the improvement looks great and I'd love to figure out how to get it merged!
from ahkab.
Thinking about this further:
I like
value = value_parser_and_checker(value, should_be='ohm')
if value is None:
raise CircuitTypeError("Circuit components need to have nonzero values)
This way, I think we have a utility function to add, which you already wrote, and hooks to add to the __init__
methods of the relevant classes, or, less generally, in the Circuit.add_foo
methods for each circuit element.
Personally, I'd move even the existing if value == 0
check into the __init__
calls for each circuit element, as they're only implemented for a few select components, and it might be worth adding sanity checks that keep someone from trying to simulate the transient response of a circuit with a 1 megafarad capacitor and a 1 megaohm resistor, or other equally awkward unit-ed component combinations.
from ahkab.
We already have more infrastructure for this than I realised, as G took the initiative to work towards SPICE syntax compatibility!
Found just reading netlist_parser thinking about unicode units.....
from ahkab.
SPICE annoyingly equates M
with "milli", when it means "mega" everywhere else. Also what is mil = 25.4x1e-6 for? PCB dimensions?
Anyway the intent was for this to be for the pythonic API, not SPICE.
from ahkab.
Related Issues (20)
- Issue with ankab HOT 5
- Tran example : 'op_solution' object has no attribute 'asmatrix' HOT 5
- voltage pulse source for a MOS inverter + questions HOT 4
- Zener Diode HOT 2
- Subcircuit call problem HOT 1
- RL circuit vs. LR circuit: different output HOT 5
- Plot circuit HOT 1
- Voltage-Controlled Switch Issue HOT 1
- Issue with a switch
- Compute on GPU using TensorFlow
- Verification RC cutoff frequency HOT 1
- error in AC and TRAN tutorial
- AttributeError: module 'pylab' has no attribute 'hold' HOT 3
- ImportError: No module named matplotlib.pyplot HOT 1
- Help : Finding current through a resistor
- Cant define diode HOT 1
- Help : Modeling a circuit with parallel components HOT 2
- Locale appears not set HOT 2
- How to use User definement device with non-linear property
- print_symbolic_results / print_symbolic_transfer_functions: sort key bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ahkab.